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.

What you see and why
Visitor seesLikely reason
Full styled postwidgets.js loaded and the post is public
Plain quoted text and a linkwidgets.js blocked or not loaded
Nothing for a post you added latertwttr.widgets.load() was not called after inserting it
No embed optionThe 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

  1. Copy the post's URL from X.
  2. Paste it into the AI chat with a note like "embed this post in the testimonials".
  3. Review it in the preview and publish.

Uses AI chat credits on a paid plan.

WordPress

  1. Add the Twitter (X) embed block.
  2. Paste the post URL and click Embed.
  3. Update.

The embed block works on every WordPress.com plan; pasting the raw script needs a plugin-enabled plan.

Wix

  1. Go to Add Elements, then Embed Code, then Embed HTML.
  2. Paste the code from publish.x.com.
  3. Resize the box so the post is not cut off, then publish.

Squarespace

  1. Add an Embed block.
  2. Paste the post URL, or open the code option and paste the blockquote and script.
  3. Save.

Plain HTML

  1. Paste the blockquote where the post belongs.
  2. Include the widgets.js script tag once, near the end of the page.
  3. 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

  1. Open the post on X in a browser.
  2. Use the three-dot menu and click Embed post.
  3. Set options on publish.x.com, such as hiding the conversation for a reply.
  4. 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

Product

Who It's For

Features

Resources

Company

View Sitemap