Most Wanted Twitter Hacks and Plugins for WordPress

By | September 20, 2014

Twitter has grown exponentially over the past year, and it is one of the fastest growing social networks at the moment. It is an extremely powerful marketing and promotion tool that no active blogger can ignore. Twitter has the power to make your articles go viral, and the “Twitter Effect” is something that most bloggers want. In this article, we will share some of the most wanted and extremely useful twitter hacks and plugins that will allow you to maximize your benefits from twitter.

Note: These hacks are for all user levels. Some knowledge of PHP / HTML will be required for some of the hacks. We will try to provide alternative plugins for each hack that we share to make it easy for beginners.

Display a Retweet Button with a Counter

Display a Retweet Button wit ha Counter

If you have visited an active blog, then you have seen a retweet button on their site. Majority of the time, it will be from a service known as Tweetmeme.


One way to get this button on your site is by placing the following code in yoursingle.php template (At a location where you want to put it).

<script type="text/javascript">
tweetmeme_source = 'wpbeginner';
<script type="text/javascript" src=""> </script>

The above code will output a big button like you see on the left hand side of this post. Make sure that you change the source to your twitter account. It is essential that you do this because it will help you get more exposure.

If you do not like the big retweet button, you can display a compact twitter button, which you can see at the end of this post. Simply paste the following code:

<script type='text/javascript'>
tweetmeme_style = "compact";
tweetmeme_source = 'wpbeginner';
<script type="text/javascript" src=""> </script>

Note: Don’t forget to change the source from wpbeginner to your username in the above code.


Tweetmeme also offers a plugin that you can download. The plugin will allow you display these buttons within your posts. You will have an option to pick:

  • The display size (compact or large)
  • Pick the Source of this tweet (Your Username)
  • Where you want to place the button in the post

Display Twitter Follower Count as Text

There are users who absolutely hate buttons like Feedburner buttons or Twittercounter buttons. Are you one of them? Do you want to display your twitter count as text, so it blends in to your new custom design? Well then this hack is just for you.


Paste the following code any where you want to display the count:

$tw = get_option("twitterfollowerscount");
if ($tw['lastcheck'] < ( mktime() – 3600 ) )
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$tw['count'] = $match[1];
$tw['lastcheck'] = mktime();
echo $tw['count'];

Make sure to replace wpbeginner with your twitter name.

Explanation of this code: This code will open the XML file for the username that you specify. It will look for the node followers_count, and then it will display that count on your site. Best part about this code is that it will display cached results, so it will keep the load time to the minimum.

This code was written by Rarst (@rarst)


For those users who do not feel comfortable modifying the theme files, you can use a plugin called “Subscribers Text Counter“. This plugin will let you display the follower count in widgets, or on posts/pages. This plugin also utilizes the caching system, so it is a good solution.

Display Your Recent Tweets

Display Your Recent Tweets

It is great to give a community sense to a site by displaying recent tweets in the sidebar or on a separate page. Many blogs often display their most recent tweets in their site. This section will show you various different ways to display your recent Tweets.


There are numerous codes on the web that will let you display recent tweets from your twitter account without a plugin. Almost all of those codes have some shortfall. Below we will share one of the snippets that will allow you to display your recent tweets with caching.

Paste the codes below, wherever you like to display the recent tweets:

Download the Code File

You must change the username from “wpbeginner” to your username. You can find this towards the very end of this code where it readsparse_cache_feed(wpbeginner, 1). The number in front represents the number of tweets that will be displayed. You can change the number to the amount that you like, but we recommend that you keep it to a minimum because this code is utilizing the Search API.

Known Issues: This snippet is using the Search API, so if your account is removed from twitter search (ofcourse by twitter), then this snippet will not display any results. Also the search API only displays tweets that were posted within the last 7 days.

For those users who are flagged from the search by twitter, we recommend that you contact them and ask why that is the case. In the meantime, you may use a JavaScript solution that will display your tweets from your feed.

Place the following code in your footer.php right above </body> tag.

<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>

Remember to change the username from wpbeginner to your username. Also you can change the count from 5 to whatever you like.

Then add the following HTML tags any where you want to display the recent tweets.

<div id="twitter_div"><ul id="twitter_update_list"><li>&nbsp;</li></ul></div>

You would need to edit the CSS file for proper styling.

Known Issues: This plugin does not have caching, so the scripts will be loaded every time the page loads.

Source: Twitter


If you are one of the users who do not want to modify their theme files, there is an alternative plugin that you can use.

Alex King’s Twitter Tool

This plugin will let you display recent tweets from your account. It will store your tweets in the database to limit the API queries. Tweets are archived every 10 minutes.

Note: there are way too many plugins that do this, to list them all here.

Display Recent Tweets from Multiple Accounts

Display Recent Tweets from Multiple Accounts

Display recent tweets from Multiple accounts come can be useful to increase community interaction when you have a multi-author blog. You can spend hours on the web trying to find a good solution, but below are two best solutions that we found.


Tweet is an unobtrusive JavaScript plugin for jQuery that lets you put twitter on your website. This is a great snippet that loads the tweets using JSON. For the download and directions, you should visit the official page.

Known Issues: This script utilizes the Search API which has it’s limits. Your search query has a character limit set to 140 characters. So in short, you will be able to get a maximum of 6 – 8 users depending on the length of their username.

Tweet Blender

Tweet Blender Screenshot

Tweet Blender plugin allows you to display multiple user’s tweet. This plugin actually displays the tweets from user’s feeds, so it does not rely on the Search API. But the more names you put, the longer it will take to load.

Known Issues: None that we know of.

Integrate Twitter Conversations About Your Posts

People are talking about your posts, and their convesation is not limited to the comments in your post. A lot of that conversation is happening on Twitter. Why not bring this conversation right back to your blog?

Tweetback plugin imports those tweets about your posts as comments. You can display them in between the other comments on your blog, or display them separately.

You can also add widgets to your site that shows the “Most Tweeted Posts” and “Recently Tweeted Posts” with the use of a plugin called Tweet Stats . You must have the plugin (Tweetback that we mentioned above in order for this plugin to work).

Tweet Stat Widget Screenshot

Take your Blog communication to Twitter

Above we showed you how you can integrate twitter conversations about your blog posts into your comments. In this trick, you will give the user an ability to post the comment on your site, and then also have their conversation on twitter.


This plugin will add a twitter login area below the comments, so users have an option to post their comment to twitter.

Post blog comments to Twitter

Display a Special Welcome Message for Your Twitter Users

Special Welcome Message for Your Twitter Users

There are some sites that display a special welcome message to their twitter users. This increase their chances of getting more followers and more retweets for that post.

Simply place the following code in your single.php file where you want the welcome message to be displayed.

if (strpos("",$_SERVER[HTTP_REFERER])==0) {
echo "Welcome, Twitter User! If you enjoy this post, don't hesitate to retweet it to your followers";

Display Your Twitter Friends on Your Site

Display Your Twitter Friends

You have seen the Facebook Fan page widget, Google Connect widget, and Mybloglog widget. All three of these display the friends/fans pictures. You can do that with twitter as well.

Twitter Friends Widget

This plugin displays your Twitter friends/followers in your sidebar in the same way that they appear on your Twitter homepage.

Twitter Profile Field in Comments

Twitter Field in Comments

Top tech sites are already doing this. If you go to Mashable or Tech Crunch, then you will see that they have an additional field below the Website URL for Twitter profile. There is a plugin that will let you do that fairly easily.

Twitter Link Comments

This plugin will add an extra field to your comment form so a user can add their Twitter username. A user configured ‘follow me’ link is then displayed along with their details on all their comments. The extra field and ‘follow me’ link can be configured using the settings page without ever needing to modify any template files. (unless you want to)

While these are some of the Most Wanted Twitter Hacks and Plugins, this list is definitely not the end of what you can do with twitter and WordPress. Infact there are 662 Results in the WordPress Plugin Directory when one runs the query forTwitter. There is also a list that we used as our source 107 Twitter Plugins for WordPress.

If you liked this post, then please retweet it, so others can also take advantage of this useful article.

Leave a Reply

Your email address will not be published. Required fields are marked *