How to Embed a Tweet (X Post) on Your Website
Open the post on X, click the three-dot menu and choose Embed post; that opens publish.x.com with the code. The code is a blockquote plus X's widgets.js script, which turns the quote into a styled post. Only public posts work. On WordPress the X (Twitter) embed block takes the post URL.
| Visitor sees | Likely reason |
|---|---|
| Full styled post | widgets.js loaded and the post is public |
| Plain quoted text and a link | widgets.js blocked or not loaded |
| Nothing for a post you added later | twttr.widgets.load() was not called after inserting it |
| No embed option | The account is protected |
Updated
Embedding a post keeps the author, date and link intact, which is why it beats a screenshot for quoting a customer or a press mention. The trade-off is that the styled version depends on X's script running in the visitor's browser.
Embed an X post on We.Inc, WordPress, Wix, Squarespace or plain HTML
We.Inc
- Copy the post's URL from X.
- Paste it into the AI chat with a note like "embed this post in the testimonials".
- Review it in the preview and publish.
Uses AI chat credits on a paid plan.
WordPress
- Add the Twitter (X) embed block.
- Paste the post URL and click Embed.
- Update.
The embed block works on every WordPress.com plan; pasting the raw script needs a plugin-enabled plan.
Wix
- Go to Add Elements, then Embed Code, then Embed HTML.
- Paste the code from publish.x.com.
- Resize the box so the post is not cut off, then publish.
Squarespace
- Add an Embed block.
- Paste the post URL, or open the code option and paste the blockquote and script.
- Save.
Plain HTML
- Paste the blockquote where the post belongs.
- Include the widgets.js script tag once, near the end of the page.
- Upload and check with an ad blocker off and on.
The shape of X's embed code
Blockquote plus widgets.js
Copy the real code from publish.x.com; it fills in the text, author and date for you.
<blockquote class="twitter-tweet">
<p>Post text appears here as the fallback.</p>
<a href="https://x.com/USERNAME/status/POST_ID">Link to the post</a>
</blockquote>
<script async src="https://platform.x.com/widgets.js"></script>Sources
- X Help Center: How to embed a post, https://help.x.com/en/using-x/how-to-embed-a-post, checked October 28, 2026, for the X post steps
- X Developer docs: Embedded posts overview, https://docs.x.com/x-for-websites/embedded-posts/overview, checked October 28, 2026, for the X post steps
- WordPress.org: Embeds, https://wordpress.org/documentation/article/embeds/, checked October 28, 2026, for the X post steps
- Wix: Embedding a site or a widget, https://support.wix.com/en/article/adding-html-code, checked October 28, 2026, for the X post steps
The blockquote is the fallback
X's code puts the post's text inside a blockquote with the class twitter-tweet. When widgets.js runs, it swaps that for the full post. When it is blocked, by an ad blocker, tracking protection or a strict policy, visitors still see the text and a link. That is a good failure, so do not delete the blockquote to save space.
If posts are added to the page after it loads, for example in a carousel, call twttr.widgets.load() afterwards so they render.
Privacy
widgets.js loads from X's servers and counts as a third-party embed. For EU and UK visitors, load it after consent or show the blockquote until they click; see our cookie banner guide.
How it works
- Open the post on X in a browser.
- Use the three-dot menu and click Embed post.
- Set options on publish.x.com, such as hiding the conversation for a reply.
- Copy the code and paste it into an HTML block on your page.
Tips
- Load widgets.js once per page even if you embed several posts.
- Tick Hide Conversation when embedding a reply, unless the parent post matters.
- If the author deletes the post, the embed stops showing the post; quote anything critical in your own words too.
Frequently asked questions
Why does my embedded tweet show as plain text?
The widgets.js script did not run. It may be missing, blocked by tracking protection or an ad blocker, or the post was added after the page loaded.
Can I embed a post from a protected account?
No. Embed code is only available for public posts.
Is it twitter.com or x.com in the code?
Older code uses platform.twitter.com and publish.twitter.com; X's current docs use the x.com names. Copy fresh code from the Embed post menu and use what it gives you.
How do I embed a post on a We.Inc site?
Give the AI chat the post's link and say where it should appear. X posts are not an add-on, so the AI adds the embed to your site's code.
Related: Embed a TikTok video, Embed an Instagram feed, Add a cookie banner, Open Graph tags.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
More in Guides
- How to Embed a Facebook Page on Your Website
- How to Embed Google Calendar on Your Website
- How to Embed a Google Form on Your Website
- How to Embed an Instagram Feed on Your Website
- How to Embed a PDF on Your Website
- How to Embed Spotify on Your Website
- How to Embed a TikTok Video on Your Website
- How to Embed a Vimeo Video on Your Website
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App