Tutorials

How to Embed a Twitter Tweet in your WordPress Sidebar

Updated

Written by

Dave Warfel

Reading Time

3 minutes

If you buy something from one of our links, we may earn a commission.

In this article, we’re going to take a look at the quickest and easiest way to embed a tweet in your WordPress sidebar. Like most things with WordPress, there are multiples way to accomplish this. We’re going to focus on using the methods that are built into WordPress core, and don’t require a plugin.

SEE ALSO: How to Embed a Facebook Post in Your Sidebar

You can embed your own tweets into a WordPress sidebar, or any tweet found on a public profile. All you’ll need is the tweet URL, which I’ll show you how to locate. Without further ado, let’s get started.

Several ways to embed a tweet into your WordPress sidebar:

  1. Using oEmbed (what is oEmbed?)
  2. Using the embed shortcode

01Embed Tweet Using oEmbed

To embed a tweet in your sidebar using oEmbed, all you need to do is paste the tweet URL into a WordPress Text widget.

NOTE: This method requires WordPress 4.9 or later.

Find Your Tweet URL

First, navigate to twitter.com, which will display your Twitter feed. All the tweets of those you follow will show up here, reverse chronologically.

Then, find the date that the tweet was published.

Twitter get tweet URL by date
In this example, the “Oct 12” link will provide your tweet URL.

Now, you can either…

  • right-click the date, and choose to Copy Link
Tweet URL copy link
Options shown after right-click

or…

  • click on the date, and then copy the URL in your address bar

How to get tweet URL animation

Either way, be sure the tweet URL is copied to your clipboard.

Go Back Into WordPress

Now head back into your WordPress admin area, and navigate to Appearance > Customize.

Appearance > Customize navigation

Click on Widgets, and find the widget that you’d like to add your tweet to. Depending on your theme, you could have several widgets listed.

List of WordPress widgets available
A list of available widgets for in Twentysixteen theme

Now click the + Add a Widget button.

Add a Widget button in WordPress Customizer

Type in “text” in the search box to quickly locate the Text widget. Add this widget to your sidebar by clicking on it.

Now simply paste the tweet URL into the Text widget, and watch it magically appear in your sidebar.

Embed tweet in WordPress sidebar animation
Animation of a tweet embed in a WordPress sidebar.

Title (optional)

If you’d like a title to appear above the tweet in your sidebar, simply enter one in the box labeled “Title.”

WordPress text widget title input

Publish or Schedule Your Embedded Tweet

The final step is to publish or schedule your tweet to go live in your sidebar. Choosing Publish will make the tweet appear immediately, or you can Schedule it to go live at a later date.

WordPress widget publishing options
How to publish or schedule your tweet.

Learn how to schedule WordPress changes in the Customizer.


02Using the embed Shortcode

Most of you will prefer to use the previously mentioned oEmbed method. That will embed a tweet in your sidebar responsively, and automatically adjust to the user’s screen size.

However, if you want to place an explicit width or height on your embedded tweet, you can use the embed shortcode.

You’ll follow the same process, up through adding the Text widget to your sidebar.

Instead of just pasting the URL into the widget, you’ll use the embed shortcode instead.

Switch from the Visual mode to Text mode.

Twitter shortcode embed code

Your screen should look like this:

Twitter embed shortcode sidebar

The width and height parameters are completely optional. You can use just one or the other, and they can be set to any value. The value is in pixels.

Adjusting the width and/or height is really the only reason I can think of why you’d want to use this method over the oEmbed method of just pasting the URL in the Text widget.


If you have any questions about embedding a Twitter tweet in your WordPress sidebar, please let me know in the comments.

Dave Warfel

LinkedIn  •  X (Twitter)
Dave has been working with WordPress since 2011. He's built 100s of client sites and almost a dozen of his own. He's tested almost every plugin you can think of, hosted with at least 10 different companies, and gone down every SEO rabbit hole you can imagine. When's he's not tinkering with new software, you'll find him in the mountains of Colorado, trail running, summiting peaks, and rippin' downhills on his mountain bike. 🏔️🏃🚴🤸

Leave a Comment