Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

How to Embed a Twitter (X) Feed on Your Website

To embed a Twitter (X) feed on your website, use X's free tool at publish.x.com: choose your profile or a public list, copy the timeline code it gives you, and add it to your page. X's developer docs call this an embedded timeline. It shows your latest posts in a scrolling column that fits widths from 180 to 520 pixels, and you can limit it to between 1 and 20 posts.

A live X feed is a simple way to make a website feel current without updating it yourself. Here's how X's own documentation says to set one up, the settings that change how it looks, and the rules X attaches to every site that embeds its content.

Two kinds of X feed you can embed

Feed typeWhat it showsGood for
Profile timelineThe latest posts from one public X account, newest firstShowing your own posts on your homepage or blog
List timelineThe latest posts from a curated public list of accounts, with a header showing the list name, description and curatorAn industry news feed, your team's accounts or event speakers

Both only work with public content: a profile timeline needs a public account, and a list timeline needs a public list.

How to embed your X feed, step by step

  1. Go to publish.x.com, the tool X provides for generating embed codes for profiles and lists.
  2. Tell it which X profile, or which public list, you want the feed to show.
  3. Copy the timeline code it generates.
  4. Paste it into your site where you want the feed, such as a page template, sidebar or widget area.
  5. Load the page. The code is a link that X's JavaScript turns into a full timeline, so give it a moment to render.

X's docs explain that an embedded timeline has two parts: the embed code that links your page to the timeline on x.com, and X's JavaScript, which turns that link into the finished feed. If you only see a plain link that says Posts by your username, the JavaScript isn't loading.

Settings that change how your feed looks

SettingWhat it doesDefault
widthSets the maximum width in pixelsFits the space it's placed in
heightSets a fixed height in pixels600
tweet-limitShows a fixed number of posts, from 1 to 20Not set
themeDark text on light, or light on darkLight
show-repliesIncludes replies to other postsOff
chromeHides parts of the frame (see below)Not set
dntStops the feed and your page being used for personalised suggestions and adsOff

Each setting goes on the embed code as a data attribute, such as data-height or data-tweet-limit. There's one trade-off with tweet-limit: X says a limited timeline is fixed once it displays, and it won't check for new posts until the page is refreshed. The height setting also stops applying when you set a post limit.

The chrome setting takes one or more of these words, separated by spaces:

  • noheader hides the timeline header. If you use it, X says you must add your own X attribution, link to the source timeline and follow X's display requirements.
  • nofooter hides the footer.
  • noborders removes the borders around and between posts.
  • noscrollbar hides the scrollbar, though X warns this can affect accessibility.
  • transparent removes the background colour so the feed blends into your design.

Feeds you can't embed any more

If an old guide tells you to embed your likes or a Moment, it's out of date. X's developer changelog for 3 March 2021 announced that the Likes, Collections and Moments timelines would be retired on 23 June 2021, and it recommended profile and list timelines instead. Those two are what the timeline tool supports today.

The rules X sets for sites that embed

Embedding is free, but X's Developer Policy and Developer Agreement attach conditions. The ones that matter for most websites:

  1. Tell visitors. You must give people legally sufficient notice of X's collection and use of data about browsing on your site, get their consent where the law requires it, and explain how to opt out of X's interest-based advertising.
  2. Children's sites. Sites aimed at under-13s must switch on the opt-out setting for embedded posts and timelines.
  3. Big sites. If your site passes 10 million daily impressions, X says you must contact it about API access.
  4. X can crawl your page. The Developer Agreement gives X a licence to access, index and cache pages that display embedded posts or timelines.

X says it doesn't link the browsing data from its widgets to people's names, emails or handles, and deletes, obfuscates or aggregates it within 30 days. You can opt a whole site out of personalisation with X's site-wide do-not-track setting.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

Embedding single posts instead

A full feed isn't always the right fit. If you want to show one post or video inside a blog article, embed that post on its own: my guide to embedding a video or post from X covers it. The same approach works for other platforms too, like embedding a YouTube video or adding a Pinterest widget.

My verdict

Embed a profile timeline if you post on X regularly, because it keeps your site fresh for free. If you don't post often, a feed showing old posts does more harm than good, so embed a list of trusted accounts in your niche instead. Set a sensible height, add a line to your privacy notice about X's data collection, and check the feed on mobile before you call it done.

Frequently asked questions

How do I embed my Twitter feed on my website?

Use X's free tool at publish.x.com. Choose your profile or a public list, copy the timeline code and paste it into your website where you want the feed to appear.

Can I embed my Twitter likes on my website?

No. X retired the Likes, Collections and Moments timelines on 23 June 2021. You can embed a profile timeline or a public list timeline.

How do I limit how many posts my X feed shows?

Add a tweet-limit setting between 1 and 20. X says a limited feed won't check for new posts until the page is refreshed.

What size is an embedded X timeline?

X's docs say it fits its container, from a minimum of 180 pixels wide to a maximum of 520 pixels, with a default height of 600 pixels.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.