How to Embed a Tweet on Your Website: Complete Guide for 2026

Embedding tweets on your website is one of the best ways to add social proof, display real-time conversations, and enrich your content with authentic voices. Whether you are writing a blog post that references a viral tweet, building a testimonials page, or curating industry commentary, embedded tweets bring dynamic content to your site without requiring screenshots that quickly become outdated.

This guide walks you through every method for embedding tweets in 2026, from the simple copy-paste approach to advanced API integration. You will learn how to embed tweets in HTML, WordPress, Shopify, Squarespace, and other platforms, plus how to customize the appearance and handle privacy compliance.

Why Embed Tweets on Your Website?

Embedding tweets instead of taking screenshots offers several important advantages:

  • Live content - Embedded tweets update automatically. If the tweet author edits their display name or the like/retweet counts change, the embed reflects those updates.
  • Interactive - Visitors can like, reply, retweet, and follow directly from the embedded tweet without leaving your page.
  • Verified authenticity - Unlike screenshots, embedded tweets link directly to the original post on Twitter, proving the content is real and unaltered.
  • Responsive design - Twitter's embed widget automatically adjusts to fit different screen sizes and container widths.
  • SEO benefits - Embedded tweets add relevant, dynamic content to your pages. The text content within embeds is visible to search engines.
  • No copyright issues - Twitter's terms of service explicitly allow embedding tweets through their official embed functionality.

How to Get the Embed Code from Twitter

The easiest way to embed a tweet is to copy the embed code directly from Twitter (X). Here is how to do it on both desktop and mobile.

On Desktop (Web Browser)

  1. Navigate to the tweet you want to embed on twitter.com or x.com.
  2. Click the share icon - This is the arrow icon (or the upload/share icon) at the bottom of the tweet, next to the like and retweet buttons.
  3. Click "Embed Post" - In the share menu, select the "Embed Post" option. This redirects you to publish.twitter.com with the embed code ready.
  4. Copy the embed code - The page displays the HTML embed code. Click the "Copy Code" button to copy it to your clipboard.
  5. Paste into your website - Paste the code into your website's HTML where you want the tweet to appear.

On Mobile (iOS / Android)

  1. Open the tweet in the Twitter app or mobile browser.
  2. Tap the share icon at the bottom-right of the tweet.
  3. Tap "Share via..." or "Copy link" - The mobile app does not directly show an "Embed" option, but you can copy the tweet URL.
  4. Visit publish.twitter.com - Open this URL in your browser and paste the tweet link. It will generate the embed code for you.
  5. Copy the code and paste it into your website.

What the Embed Code Looks Like

A typical Twitter embed code consists of two parts:

  • A blockquote element - Contains the tweet text, author information, and a link to the original tweet. This serves as a fallback if the JavaScript fails to load.
  • A script tag - Loads Twitter's widgets.js file, which transforms the blockquote into an interactive, styled tweet widget.

The blockquote contains the tweet content in plain HTML, so even if JavaScript is disabled or blocked, visitors still see the tweet text and a link to the original.

How to Embed a Tweet in HTML

Embedding a tweet in a standard HTML page is straightforward. Simply paste the embed code from Twitter into your HTML file where you want the tweet to appear.

Step-by-Step

  1. Get the embed code from Twitter (see previous section).
  2. Open your HTML file in a text editor or code editor.
  3. Paste the code at the desired location within the <body> of your page.
  4. Save and preview your page in a browser.

Performance Tip: Load the Script Once

If you are embedding multiple tweets on a single page, you only need the widgets.js script tag once. Include it at the bottom of your page before the closing </body> tag and remove the duplicate script tags from each individual embed code. This significantly improves page load performance.

Lazy Loading Embeds

If your page has many embedded tweets (such as a roundup or listicle), they can slow down your page load. To lazy-load embeds:

  • Include only the blockquote elements initially (without the script tag).
  • Load the widgets.js script only when the user scrolls near the embeds, using the Intersection Observer API or a lazy loading library.
  • Call twttr.widgets.load() after the script loads to render all blockquotes into interactive embeds.

How to Embed a Tweet in WordPress

WordPress makes embedding tweets incredibly easy. You have three methods available depending on your editor and preferences.

Method 1: Paste the URL (Easiest)

WordPress has built-in oEmbed support for Twitter. Simply:

  1. Copy the tweet URL from your browser's address bar (e.g., https://twitter.com/username/status/1234567890)
  2. Paste the URL directly into the WordPress block editor on its own line.
  3. WordPress automatically converts it into an embedded tweet preview.

This is the fastest method and works in both the Block Editor (Gutenberg) and the Classic Editor.

Method 2: Use the Twitter Block

  1. In the Block Editor, click the "+" button to add a new block.
  2. Search for "Twitter" and select the Twitter block (under the Embeds category).
  3. Paste the tweet URL into the input field.
  4. Click "Embed" to load the tweet.

Method 3: Custom HTML Block

If the URL methods are not working or you want more control:

  1. Add a "Custom HTML" block to your post or page.
  2. Paste the full embed code from Twitter (the blockquote and script tag).
  3. Switch to the "Preview" tab to verify the tweet renders correctly.

WordPress Troubleshooting

  • Embed not loading? - Some security plugins or CDN configurations block external scripts. Check if widgets.js is being blocked by your content security policy.
  • Tweet showing as plain text? - Make sure the URL is on its own line (not inline with other text) and is not hyperlinked. The raw URL must be plain text for oEmbed to work.
  • Using a page builder? - Elementor, Divi, and other page builders have their own Twitter embed widgets. Use those for the best results within the builder's layout system.

Embedding Tweets on Other Platforms

Here is how to embed tweets on other popular website builders and platforms.

Shopify

  1. In your Shopify admin, go to the page or blog post you want to edit.
  2. Switch to the HTML editor (click the </> button in the rich text toolbar).
  3. Paste the Twitter embed code.
  4. Save and preview your page.

Squarespace

  1. Edit your page and add a new Code Block (or Embed Block) where you want the tweet.
  2. Paste the full Twitter embed code into the code block.
  3. Toggle "Display Source" off to render the embed.
  4. Save your changes.

Wix

  1. In the Wix Editor, click "Add Elements" (the + button).
  2. Select "Embed & Social" then "Social Media".
  3. Choose "Twitter" from the social media options.
  4. Paste your tweet URL into the settings panel.

Alternatively, use an HTML embed element in Wix and paste the full embed code for more control.

Medium

Medium has native Twitter embed support:

  1. Paste the tweet URL on a new line while editing your Medium article.
  2. Medium automatically converts it into an embedded tweet.

No embed code or HTML editing is needed. Medium handles everything automatically.

Notion

  1. Type /embed or /tweet in your Notion page.
  2. Select the "Tweet" embed type.
  3. Paste the tweet URL.
  4. The tweet renders inline in your Notion page.

How to Embed a Twitter Timeline or Feed

Beyond individual tweets, you can embed an entire Twitter timeline, list, or collection on your website.

Embedding a User Timeline

  1. Go to publish.twitter.com.
  2. Enter the Twitter profile URL (e.g., https://twitter.com/username).
  3. Choose "Embedded Timeline" as the display option.
  4. Customize the height, width, theme (light or dark), and number of tweets.
  5. Click "Copy Code" and paste the code into your website.

Embedding a Twitter List

  1. Go to publish.twitter.com.
  2. Enter the URL of your Twitter list.
  3. Customize the appearance settings.
  4. Copy and paste the embed code.

Timeline Embed Options

  • Height - Set a fixed pixel height. Recommended: 400-600px. The timeline becomes scrollable within this height.
  • Width - Set a fixed width or leave blank for responsive (100% width of container).
  • Theme - Light or dark. Match your website's color scheme.
  • Chrome - Hide specific elements like the header, footer, borders, or scrollbar.
  • Tweet limit - Limit the number of tweets shown (1-20).

Customizing Embedded Tweets

Twitter offers several customization options for embedded tweets through data attributes on the blockquote element.

Dark Mode

Add data-theme="dark" to the blockquote element to render the tweet with a dark background. This is useful if your website uses a dark color scheme.

Hide Conversation Thread

By default, if you embed a reply tweet, Twitter shows the parent tweet above it. Add data-conversation="none" to hide the thread and show only the specific tweet you embedded.

Set a Specific Width

Add data-width="550" (or any pixel value between 250 and 550) to set the width of the embedded tweet. Without this, the embed expands to fill its container up to a maximum of 550px.

Align the Embed

Add data-align="center", data-align="left", or data-align="right" to control the horizontal alignment of the embed within its container.

Language

Add data-lang="es" (or any supported language code) to change the language of the embed's UI elements (buttons, timestamps).

Hide Media

Add data-cards="hidden" to hide images, videos, and link card previews within the embedded tweet. Only the tweet text will be displayed.

Embedding Tweets via the oEmbed API

For developers who need to programmatically generate embed codes, Twitter provides an oEmbed API endpoint. This is useful for CMS integrations, dynamic content, and applications that need to embed tweets at scale.

How oEmbed Works

The oEmbed API accepts a tweet URL and returns the embed HTML in a structured JSON response. The endpoint is:

https://publish.twitter.com/oembed?url=TWEET_URL

Key Parameters

  • url (required) - The URL of the tweet to embed
  • maxwidth - Maximum width in pixels (220-550)
  • hide_media - Set to true to hide images and videos
  • hide_thread - Set to true to hide the parent tweet in a reply thread
  • theme - "light" or "dark"
  • lang - Language code for the embed UI
  • omit_script - Set to true to omit the widgets.js script tag (useful when loading the script separately)

When to Use oEmbed

The oEmbed API is the right choice when:

  • You are building a CMS that needs to auto-embed tweets from URLs pasted by editors
  • You need to embed tweets server-side without browser JavaScript
  • You want to cache embed HTML to reduce API calls and improve page load speed
  • You are building a content aggregation tool that displays tweets from multiple sources

Privacy and GDPR Considerations

Embedded tweets load external resources from Twitter's servers, which has implications for user privacy and GDPR compliance in the EU.

What Embedded Tweets Load

When a visitor views a page with an embedded tweet, their browser loads:

  • widgets.js - Twitter's JavaScript file from platform.twitter.com
  • Tracking cookies - Twitter may set or read cookies on the visitor's browser
  • Third-party resources - Images, profile pictures, and other media from Twitter's CDN

This means Twitter can potentially track your website visitors, even if they do not have a Twitter account.

GDPR Compliance Steps

  • Cookie consent - If your website serves EU visitors, you should obtain consent before loading Twitter embeds. Use a cookie consent banner that blocks the embed scripts until the user opts in.
  • Two-click solution - Display a placeholder image or text with a "Load Tweet" button instead of automatically loading the embed. The tweet only loads when the visitor actively clicks the button, constituting informed consent.
  • Privacy policy - Mention in your privacy policy that your site uses Twitter embeds, which may set third-party cookies and transfer data to Twitter's servers.
  • Static screenshots as fallback - For privacy-sensitive contexts, consider using a screenshot of the tweet with a link to the original instead of an interactive embed. This avoids loading any external resources.

Troubleshooting Common Embed Issues

Embedded Tweet Not Loading (Blank Space)

  • Check your ad blocker - Many ad blockers and privacy extensions block Twitter's widgets.js script. Test with extensions disabled.
  • Content Security Policy (CSP) - If your website has a strict CSP, you need to allow scripts and frames from platform.twitter.com and syndication.twitter.com.
  • HTTPS issues - Make sure your website uses HTTPS. Mixed content (HTTP page loading HTTPS scripts) can cause browsers to block the embed.
  • JavaScript errors - Check your browser's developer console for errors. Other JavaScript on your page may conflict with Twitter's widget script.

Tweet Showing "This Tweet has been deleted"

If the original tweet was deleted or the account was suspended, the embed will show a "This Tweet has been deleted" or "This Tweet is unavailable" message. There is no way to restore deleted tweet embeds. Replace it with a different tweet or remove the embed from your page.

Embed Code Not Working in Page Builder

Some visual page builders strip JavaScript from HTML inputs. Try these solutions:

  • Use the builder's dedicated Twitter or social media widget if available
  • Switch to a raw HTML or code block that preserves scripts
  • Add the widgets.js script tag in your theme's footer instead of inline with the embed

Slow Page Load from Multiple Embeds

Each embedded tweet adds approximately 500KB-1MB to your page size. If you have more than 5-10 embeds:

  • Load widgets.js only once (remove duplicate script tags)
  • Implement lazy loading so embeds only load when scrolled into view
  • Set a tweet limit on timeline embeds
  • Consider using screenshots for less important tweets and only embedding key ones interactively

FAQ: Embedding Tweets

Can I embed a tweet for free?

Yes. Embedding tweets is completely free. Twitter provides the embed functionality as a standard feature, and there are no costs associated with using it, regardless of how many tweets you embed on your website.

Do I need permission to embed a tweet?

No. Twitter's Terms of Service grant permission for anyone to embed public tweets using Twitter's official embed tools. By posting a public tweet, users agree that their tweets can be embedded on third-party websites. However, this only applies to the official embed method, not to screenshots or reproductions of tweet content.

Can I embed a tweet from a private account?

No. Only public tweets can be embedded. If a user has a protected (private) account, their tweets cannot be embedded, and the embed code will not generate. If a previously public account switches to private, any existing embeds of their tweets will stop displaying.

Will the embedded tweet update if the original is edited?

Twitter (X) introduced tweet editing in 2022. Embedded tweets do show the most recent version of an edited tweet. However, edits can take some time to propagate to embeds due to caching. If the tweet is deleted entirely, the embed will show a "This Tweet is unavailable" message.

Can I customize the look of an embedded tweet?

Yes. You can customize embedded tweets using data attributes: dark or light theme, hide media, hide conversation thread, set a specific width (250-550px), change the language, and control alignment. See the Customizing Embedded Tweets section above for details on each option.

Why is my embedded tweet showing as a plain link?

This usually happens when the widgets.js script is not loading properly. Common causes include ad blockers, Content Security Policy restrictions, JavaScript conflicts, or the script being placed in the wrong location. Make sure the script tag is present and not blocked by browser extensions or security policies.

Can I embed a Twitter thread?

You can embed individual tweets from a thread, but there is no single embed code that displays an entire thread. To show a full thread, embed each tweet in the thread separately on your page. When you embed a reply tweet, it shows the parent tweet above it by default (you can hide this with data-conversation="none").

Do embedded tweets affect my page speed?

Yes. Each embedded tweet loads external JavaScript and resources from Twitter's servers. A single embed typically adds 500KB-1MB to your page size. For pages with many embeds, use lazy loading and load the widgets.js script only once to minimize the performance impact.

Archive and Analyze Your Twitter Content

Embedded tweets are a great way to showcase your best content on your website. To find your top-performing tweets worth embedding, use Tweet Archivist to analyze your tweet engagement, identify your most impactful posts, and build a permanent archive of your Twitter activity. Try it today to discover which tweets deserve a spot on your website.