How to add an official Twitter widget to WordPress

If I find a site I like, I usually head on over to their Twitter stream to see what kinds of things they tweet about. Assuming I find tweets of interest, I’ll generally visit said Twitter stream again and again. However, having to click through from the original website and wait while the Twitter page loads isn’t something I enjoy, which is why I’m always pleased to see sites that show their latest tweets somewhere on their site, like in the sidebar. Here’s a quick ‘how to’ on adding an official Twitter widget to a WordPress sidebar (much like the one shown towards the bottom of the sidebar of this very site).

Step 1. Create a Twitter widget

Log into your Twitter account and click the little cog icon in the top right corner. Select ‘Settings’ from the drop-down menu. In the left-hand menu that appears on the new page, select ‘Widgets’ (bottom menu item). Then hit the ‘Create new’ button (top right).

Create a new Twitter widget button

Step 2. Choose your settings

You can choose to create a number of different Twitter widgets, such as a ‘User timeline’ widget, a ‘Favorites’ widget and a ‘List’ widget. All of which are explained here. However, for this example, we’ll just stick to the default ‘User timeline’ widget. Choose your desired settings and then copy the code generated (which appears in a small box in the bottom right of the window).

Get the Twitter widget code

Note: further customizations are possible by editing the code – see the customizations section of the official API docs for more info.

Step 3. Getting the Twitter widget into WordPress

Log into your WordPress dashboard and navigate to ‘Appearance’ -> ‘Widgets’ and add a default WordPress ‘text’ widget to the sidebar in which you’d like to display the twitter widget. Give the text widget a title, say ‘Latest Tweets’, for example, and then paste in the code from the end of step 2.

Adding the Twitter widget code to a WordPress text widget

Step 4. Save and display!

Save the widget with the blue ‘Save’ button (bottom right of the text widget) and go take a look at the frontend of your website. Your new Twitter widget should now be displayed wherever you chose to show it!

That’s it – done! Easy huh?!

Tweet about this on TwitterShare on FacebookGoogle+Share on LinkedInEmail to someone

By Brin Wilson

Founder of WinningWP - passionate about all things WordPress! Active on both Twitter and Google+ (preferred).
Comments (policy)