How To Embed X (Twitter) In An Iframe

Use the publish.x.com widget or the platform.twitter.com embed script.

Embed Code

<blockquote class="twitter-tweet"><a href="https://x.com/USER/status/TWEET_ID"></a></blockquote>
<script async src="https://platform.twitter.com/widgets.js"></script>

Why The Main Site Won't Frame

x.com sends X-Frame-Options: DENY. Embedding uses the widgets.js script, not a raw iframe. Generate code at publish.x.com.

Official documentation →

See the embedding status of x.com →