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 type | What it shows | Good for |
|---|---|---|
| Profile timeline | The latest posts from one public X account, newest first | Showing your own posts on your homepage or blog |
| List timeline | The latest posts from a curated public list of accounts, with a header showing the list name, description and curator | An 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
- Go to publish.x.com, the tool X provides for generating embed codes for profiles and lists.
- Tell it which X profile, or which public list, you want the feed to show.
- Copy the timeline code it generates.
- Paste it into your site where you want the feed, such as a page template, sidebar or widget area.
- 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
| Setting | What it does | Default |
|---|---|---|
| width | Sets the maximum width in pixels | Fits the space it's placed in |
| height | Sets a fixed height in pixels | 600 |
| tweet-limit | Shows a fixed number of posts, from 1 to 20 | Not set |
| theme | Dark text on light, or light on dark | Light |
| show-replies | Includes replies to other posts | Off |
| chrome | Hides parts of the frame (see below) | Not set |
| dnt | Stops the feed and your page being used for personalised suggestions and ads | Off |
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.
Hiding the header, footer or borders
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:
- 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.
- Children's sites. Sites aimed at under-13s must switch on the opt-out setting for embedded posts and timelines.
- Big sites. If your site passes 10 million daily impressions, X says you must contact it about API access.
- 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.
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.


