How to Embed a Tweet on a Website
To embed a tweet on a website, open the post on x.com, select the three-dot menu or share icon, choose Embed post, copy the code from publish.x.com and paste it into your page's HTML.

To embed a tweet on a website, open the post on x.com, select the three-dot menu or share icon, choose Embed post, copy the code from publish.x.com and paste it into your page’s HTML. The embedded tweet shows the post as it appears on X, with the author, media and a link back, and it updates if the post changes.
An embedded tweet is a live copy of a public post placed on another website. X runs the embed tool at publish.x.com, linked from every X Help Center page. For the parts of a post and where its ID lives, see what a tweet is on X.
What Is an Embedded Tweet?
An embedded tweet is a public post shown inside a web page through X’s embed code, rather than as a screenshot. Readers can like, reply to or follow from it, and it credits the author automatically. Because it loads from X, it reflects the post’s current state: if the author deletes it or protects their account, the embed stops showing the content.
How Do You Get the Embed Code for a Tweet?
You get the embed code from the post’s menu on x.com, or by pasting the post’s URL into publish.x.com. Listed below are the 4 steps.
- Open the post on x.com in a browser.
- Select the three-dot menu or the share icon, then Embed post.
- Copy the code that publish.x.com shows, after choosing any display options.
- Paste it into the HTML of your page, or an HTML block in your site builder.
The code is a short quote block with a link to the post and one script line:
<blockquote class="twitter-tweet">
<a href="https://twitter.com/NASA/status/1140437409710116865"></a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
How Do You Change How an Embedded Tweet Looks?
You change an embedded tweet’s look with options on publish.x.com or attributes on the quote block. Listed below are the 3 most used.
| Option | Attribute | Effect |
|---|---|---|
| Dark theme | data-theme="dark" |
Matches dark websites |
| Hide the parent post | data-conversation="none" |
Shows a reply without the post it answers |
| Hide media cards | data-cards="hidden" |
Shows text without the photo or link preview |
If you embed several posts on one page, include the script line only once.
Why Is an Embedded Tweet Not Showing?
An embedded tweet stops showing when the post is deleted, the account becomes protected or suspended, or the page blocks X’s script. The first three are on X’s side; X explains the notices in why a tweet says this post is unavailable. If the script is blocked by a content security policy or a privacy plugin, allow platform.twitter.com.
Embed or Screenshot?
Embed a tweet when you want a live, credited post; use a screenshot when you need a permanent copy that survives deletion. For posts likely to be deleted, keep both: embed the live post and archive a copy, as shown in how to find deleted tweets.
How Do You Show Many Tweets on a Page?
For many posts, such as a wall of customer praise, collect them as data first and pick the ones to embed. apidojo’s Tweet Scraper V2 on Apify returns each post’s url, which is all the embed code needs, from a search such as "brand name" min_faves:20 -from:brand (Apify). It costs $0.40 per 1,000 tweets; see the apidojo Twitter Scraper.
Questions people ask
Can you embed a tweet from a private account?
No, only public posts can be embedded.
Do embedded tweets slow down a page?
The script loads asynchronously, but many embeds on one page add weight; embed only the posts you need.
Is embedding a tweet allowed?
Yes, X provides the embed tool for that purpose, and the embed keeps the author's credit and link.