# 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.

[![apidojo](/blog/authors/apidojo.png)**Apidojo** *15+ years of experience in data retrieval.*](/blog/authors/apidojo/)

**7 October 2026** Published

**3 min** Read

![Cover card reading 'How to Embed a Tweet on a Website'](/blog/covers/embed-a-tweet.png)

**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](https://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](/blog/x-guides/what-is-a-tweet/).

## 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.

1.  **Open** the post on x.com in a browser.
2.  **Select** the three-dot menu or the share icon, then **Embed post**.
3.  **Copy** the code that publish.x.com shows, after choosing any display options.
4.  **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](/blog/x-guides/post-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](/blog/x-guides/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](https://apify.com/apidojo/tweet-scraper) 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](/scrapers/twitter-scraper/).

## The scrapers behind this

-   [Tweet Scraper V2 Tweets from searches, profiles, Lists and URLs; 49–64 tweets/sec; minimum 50 per query $0.40 / 1K tweets](/scrapers/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.

## More X guides

-   [What Is a Tweet? Posts, Replies and IDs Explained What a tweet is, what it can contain, the 4 types of posts on X, how tweet IDs work, and guides to every everyday X task.](/blog/x-guides/what-is-a-tweet/)
-   [How to Post a Tweet on X: Step by Step (2026) Post a tweet on the X app or x.com: write up to 280 characters, add up to 4 photos or a video, post longer text, reply, delete and pin.](/blog/x-guides/how-to-post-a-tweet/)
-   [How to Quote Tweet on X (Desktop and App) Quote a tweet on the X app or x.com, see who quoted a post, and learn the difference between a quote post and a repost.](/blog/x-guides/quote-tweet/)
-   [How to Post Two Pictures Side by Side on X Attach 2 images to post them side by side on X, size them so the preview doesn't crop them, and see how X lays out 1 to 4 images.](/blog/x-guides/two-pictures-side-by-side/)
-   [Can You Pin Someone Else's Tweet on X? X only lets you pin your own posts, but quoting someone else's post and pinning your quote works. Here's how, step by step.](/blog/x-guides/pin-someone-elses-tweet/)
-   [How to View a Tweet by ID on X Open any tweet from its ID with x.com/i/status, find a tweet's ID, read its posting date from the ID, and fetch many at once.](/blog/x-guides/view-tweet-by-id/)
-   [How to Find Deleted Tweets: What Works in 2026 The 4 ways to find deleted tweets in 2026, from your X archive to the Wayback Machine, which methods no longer work, and how to save posts.](/blog/x-guides/find-deleted-tweets/)
-   [What Does 'Deleted by Tweet Author' Mean? What X's "deleted by the post author" notice means, where it appears, how it differs from an unavailable post, and what you can recover.](/blog/x-guides/deleted-by-tweet-author/)
-   [Why a Tweet Says 'This Post Is Unavailable' The reasons X shows "this post is unavailable", from deleted posts to blocks, how to tell which applies, and when you can view it.](/blog/x-guides/post-unavailable/)
-   [How to Tell If a Tweet Was Written by AI Why AI detectors fail on tweets, the account signals that do suggest automation, and how to check a whole thread for bot replies.](/blog/x-guides/tweet-written-by-ai/)
-   [Who Blocked Me on Twitter (X)? How to Check in 2026 Twitter (X) does not show who blocked you: no list, no notification, no API endpoint.](/blog/x-guides/who-blocked-me-on-twitter/)

![apidojo](/blog/authors/apidojo.png)

## [Apidojo](/blog/authors/apidojo/)

15+ years of experience in data retrieval.

API Dojo is always ready for you. With 15+ years of experience, data acquisition has never been that easy. Cheapest prices with high availability.

-   🏯 15+ years of experience in data retrieval.
-   💰 Cheapest prices, qualified data.
-   ⚙️ High availability, extreme maintenance.
-   🐉 Hyper communicative, excellent support.

-   [apify.com](https://apify.com/apidojo)
-   [x.com](https://x.com/apidojo_)
-   [github.com](https://github.com/apidojo-io)
