X (Twitter) Embed Generator
<blockquote class="twitter-tweet" data-align="center"> <a href="https://twitter.com/jack/status/20">View this post on X</a> </blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p style="margin:4px auto 0;max-width:550px;text-align:center;font:11px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;color:#a3a7b0;">Created with <a href="https://elfsight.com/tools/twitter-embed-generator/" target="_blank" rel="noopener" style="color:inherit;text-decoration:none;">Elfsight</a></p>
- Click Copy code above to copy it.
- Open the page’s HTML file or template.
- Paste the code inside
<body>, where the content should appear. - Save and upload the page, then open it in a browser to check.
Want a live feed of your posts instead of one? Use a feed widget that stays up to date. See Twitter Feed →
Show your X feed, not one post
Your profile, or posts filtered by hashtag
A custom header for your feed
Grow your audience on X

Why use this instead of the X Embed button
x.com and twitter.com links; ?s= and other parameters are removeddata- attributes in the codedata-dnt yourselfdata-dnt="true"Where you start
X’s Embed button
This generator
Link formats
X’s Embed button
This generator
x.com and twitter.com links; ?s= and other parameters are removedOptions
X’s Embed button
data- attributes in the codeThis generator
Width
X’s Embed button
This generator
Personalization
X’s Embed button
data-dnt yourselfThis generator
data-dnt="true"X embed options reference
<blockquote class="twitter-tweet"> plus X’s widgets.js, which turns it into the full post. These attributes go on the blockquote.data-themelight, darkdark shows light text on a dark background.data-conversationnonedata-cardshiddendata-width250 to 550 pixelsdata-alignleft, right, centerdata-langes, fr, dedata-dnttrue<meta name="twitter:dnt" content="on">.data-theme
What it does
Values
light, darkNotes
dark shows light text on a dark background.data-conversation
What it does
Values
noneNotes
data-cards
What it does
Values
hiddenNotes
data-width
What it does
Values
250 to 550 pixelsNotes
data-align
What it does
Values
left, right, centerNotes
data-lang
What it does
Values
es, fr, deNotes
data-dnt
What it does
Values
trueNotes
<meta name="twitter:dnt" content="on">.Why the X post doesn’t show
The post shows as plain text with a link
X’s widgets.js didn’t load, so the blockquote was never turned into a post. Keep the <script> tag in the code, make sure your site builder doesn’t strip scripts from that block, and check that a browser extension isn’t blocking it.
The post was added after the page loaded
widgets.js scans the page once. Call twttr.widgets.load() after you insert new posts.
The account’s posts are protected
Embed code isn’t available for protected posts. Only public posts can be embedded.
The post was deleted, made protected, or the account was suspended
The text of the post stays on your page, but X no longer loads its media. Replace it with another post.
The visitor uses a very old browser
X widgets don’t render in Internet Explorer 11 and older. Visitors see the plain-text version.
How to embed a post from X (Twitter)
Copy the post link
On X, open the post, choose Share → Copy link.
Paste it and pick options
Paste the link and choose the theme and what to show.
Add the code to your site
Copy the code and paste it into an HTML block where the post should appear.