How to Embed a Tweet in a WordPress Post or Page

If you want to embed a tweet in a WordPress post or page, WordPress supports a really simple way to do it. It takes just three simple steps.

Step 1

Start with the URL of the tweet. The easiest way to get that is to look at the tweet on its own and not on the Twitter homepage or in someone’s twitter stream. Click on the timestamp just to the right of the tweet. It usually has the age of the tweet like “30m” or “4h” or else a date like “2 Jul”. Once on that page showing just that one tweet (and maybe some replies), copy the URL from your browser’s address bar to the clipboard.

Alternatively, right-click the timestamp link and select “Copy link address” or whatever your browser uses.

Image shows the location of a tweet's URL

Step 2

Next, back in your WordPress dashboard, paste that URL into your post or page on a line on its own. Make sure it is not a link, just plain text.  If it does get pasted as a link (it will show blue and underlined) you can click once in the link and click the “unlink” toolbar button.

paste_tweet_URL

Step 3

Publish your post or page and enjoy a fully interactive tweet embedded on your site. It’s as simple as that.

Even the “Follow”, “Reply”, and “Retweet” buttons work.

embed a tweet in a WordPress post

The Result: An Embedded Tweet

Here’s an example embedded in this post.

Update: If it Doesn’t Work

If it doesn’t work for you and your site just shows a link, it will be because your browser has pasted the URL as a link into your post or page. To remedy it, follow these steps:

  1. Edit your post or page.
  2. Click once on the Twitter URL.
  3. Click the “unlink ” button in the toolbar.
  4. Update or publish your post or page.

Unlink_a_link

Have you tried this yourself? Did you manage to get it working? Let me know in the comments below.

Sign up now for email updates

  • Just enter your primary email address and hit the button!

Comments

  1. Always works like a charm. So awesome that WordPress makes it so so simple.

  2. Wisdom Sankara says:

    Lol I can’t believe it took me over an hour to figure this out until I gave up and googled it, great job Mike, your explanation along with the screenshots were perfect.

  3. tamar says:

    Thanks for that! Great explanation – took me just 3 min to do.

  4. Becky says:

    I cannot get this to work–It only leaves the link despite following your directions, but does not add any of the details from Twitter. Do you need WordPress Pro?

    • Becky,
      It sounds like your browser has pasted the URL as a link. To fix that, go back to editing the post or page. In the editing box, click on the Twitter url once, then click the break link icon on the toolbar (next to the link icon). Save your changes and try it again. I’ve added these extra instructions to the article.

      • Becky says:

        Hi Mike,

        Thank you for getting back to me so quickly. The problem was that I was in visual editing mode instead of text. Once I switched the view it worked.

  5. Max Manroe says:

    Hello Mike, it doesn’t work in my wordpress. I’ve tried many times, but it still show the URL not embed tweet from twitter. I don’t know what’s wrong :(

    • Ma, Try to make sure that in the editor the URL is not a link. I added instructions how to do that.

      • Steve says:

        I also get this issue, it’s just showing as the url (unlinked). I end up having to use the embed code given by twitter.

  6. How do you post a tweet MINUS all the replies? Really popular tweets tend to come with tens, if not hundreds of replies but I don’t want these in my WordPress post. I just want the original tweet. Thank you for your help.

  7. Hi Sierra,
    I know if you look at the individual tweet on Twitter it includes all the replies, but when I embed a tweet with replies in to a post, It only shows the original tweet.

    I’ve updated my example above to embed a tweet that has a reply (where it says “the Result”). It only shows the original tweet, but if you click on the date stamp it takes you through to twitter.com where you can see it has a reply

    Hope that helps,
    Mike

  8. Hi Mike, thanks for this tip and it works like a charm. If you don`t mind and if I can explain well, I would like to ask a question on using tweets in post.

    Lets say I have a post which have 300 words and a picture. On my main page I show the image and short description (excerpts) with a “read more” link next to it and when clicked it opens the main post page with full post details.

    What I would like to do is, I want to show picture and short description as normal and show 2 tweets related to that post on the main page with a read more link. And when they click on read more they see full article with an image and all the embedded tweets under the post! Any suggestions?

    Regards

    • The only way you could do that is to use a plugin that allows you to use autoembeds in your excerpts. I’ve not seen on that does that though there may be some.

      Or, if you are confident with your editing your theme’s functions.php you can add the following two lines of code:


      add_filter( 'the_excerpt', array( $wp_embed, 'run_shortcode' ), 8 );
      add_filter( 'the_excerpt', array( $wp_embed, 'autoembed'), 8 );

  9. Imran Aftab says:

    What about the size of the tweet? How can we change its size, I tried the WordPress instructions from the official post, but that is not working for me.

  10. Gema says:

    Hey!

    Thanks for your instructions but it does not work on my WP. I am trying to embed all the tweets onto one post, but when I save the changes they all go away and disappear. So then I edit the post, break the links as you proposed, but still got the same problem. The tweets won’t appear on my post. Only one appears. I have tried everything and so far it does not work. Any recommendation will be much appreciated.

    Cheers

  11. Gordon Blue says:

    The above method is too flaky. Try this, works guaranteed

    https://dev.twitter.com/docs/embedded-tweets

    • Gordon,
      The second half of the information on that page is exactly what WordPress does for you. It uses the oEmbed protocol to retrieve the HTML from Twitter and save you from having to write it yourself. The majority of WordPress users are not HTML savvy and this kind of functionality allows them to get on with writing great blog posts and articles without having to worry about closing tags and attributes.

      • Gordon Blue says:

        Sure. but this in this case is it just matter of copying and pasting the HTML embed code from Twitter into your post nothing else. I found WordPress built-in capabilities unpredictable hence my suggestion.

        Cheers

        • You have to switch to text mode to be able to copy and paste in html, and that’s scary for a lot of users. Whereas this method only requires you to paste in a URL in either visual or text mode, it really couldn’t be simpler.

          I’d be interested to know which of WordPress’ built-in capabilities you find to be unpredictable.

          • Unfortnately neither your way to do it NOR pasting the html code provided by twitter works for my blog apparently. I use 3.8+ and nothing, it just shows up as either a text link (mike’s method) OR just as a quoted text. Not the embedded tweet. :(

  12. Folks,
    it looks like Twitter changed something at the beginning of January that has broken the auto embedding. Currently WordPress does not autoembed for any new tweets you try to embed or if you re-save any old ones.

    This tweet here

    https://twitter.com/cftp/status/424148190674563072

    Includes a link to a temporary fix plugin that will remedy the situation (at least it did for me).

    The fix (https://core.trac.wordpress.org/ticket/26844) should be in version 3.8.1 when it is released.

    Mike

  13. I have tried all the suggestions and read all the comments. Tweet Embedding is not working in my WordPress blog. Is there a fix for it?

    thanks!

  14. Henry Shivley says:

    It worked great for a while and then stopped working. Now it is just showing the link (without being a link). Any solutions?

  15. Hi

    I have a wordpress 3.8.1 issue – the insert/edit link button doesn’t work. I will highlight the word I want to link from and click on the button and nothing happens. I have contacted WordPress/read forums etc but have had no reply. I have also googled it and its not helped. I need someone to tell me what I can do – I have re-installed it, removed cookies and browser history and I don’t know what to do next. I have no training in WordPress and hope you can help…..

    • It could be a problem with one of your plugins or your themes. Try disabling all plugins and switching to a built in theme. If it now works, then one of those was causing the problem.

      Re-enable the theme and your plugins, one at a time, testing each time. When it breaks again, the last thing you enabled is the culprit. Contact the theme or plugin author.

  16. gavin says:

    I’m not getting this to work. I have no plugins installed and I have changed to the built in 2014 theme of wordpress but it still does not work

  17. Hi Mike

    Any idea how I might use have the twitter profile image as the featured thumbnail image when posting a single embedded tweet as a post?

    • Hi Gareth,
      You would need to upload the image to your site as WordPress doesn’t let you set an external image as the featured image (thumbnail). You would need to make sure you have the rights to do that first, of course.

Speak Your Mind

*