// you’re reading...


A Perfect Integration of WordPress and Twitter

I have been tweeting and I have been blogging. My blog is powered by WordPress. Integrating the blog and micro blog (Twitter) makes sense and recently I made Twitter and WordPress talk to each other, using WordPress plugins. I used not one, not two but three plugins to perfect the integration as per my taste.

Here is how it started. My initial wishlist from this integration was as follows:

  1. Whenever I write a new blog post, it should be automatically posted (or tweeted) to Twitter
  2. My tweets should get posted on my Blog

Referring to the second point, I did not want a blog post each, for every tweet. Instead I wanted a single blog post with all my tweets – say, for the day.

The plugin which served my above mentioned requirements is Alex King’s Twitter Tools which can be downloaded from here. After installing the plugin, I created a category in WordPress called Tweets.  Next, I configured the plugin (Settings>Twitter Tools) as shown in the screenshot below (click on the image to view the settings clearly):

Twitter Tools Settings

Twitter Tools Settings

Note that I have set “Create a blog post from each of your tweets?” to No, but have set the option “Create a daily digest blog post from your tweets?”. Also I selected the Tweets category for “Category for tweet posts:”. With this, all my tweets will be automatically posted on my blog, under the Tweets category, at 23:59 hrs, every day.

I also opted to use the Twitter Tools widget to display the latest Tweets on my Blog’s sidebar. Depending on whether your WordPress theme is widget enabled, you can setup the Twitter Tools widget via Appearances>Widgets – just the standard WordPress way to display widgets. If you scroll down on my blog’s home page, you can spot this widget, titled “WHAT I’M DOING”.

As a Result
With Twitter Tools, the following is achieved:

  • Whenever I write a new blog post, it gets automatically posted on Twitter as “New blog post: <blog-post-title> <tiny-url>”.
  • All my tweets get posted on my blog at the end of each day, under the Tweets category, as “Twitter Updates for <date>”.  These tweets are searchable using the search on the blog.
  • Hence my knowledge base = blog posts + tweets are now in one place.
  • Google should (more on this below) index the tweets against my blog and lead more traffic to my blog.

But Some Issues
The popular Twitter Tools serves well but not perfect and hence the following issues:

  • The blog posts corresponding to the tweets may not be properly indexed by Google due to lack of meta tags. The only meta tags that Twitter Tools would record against the daily digest of tweets are “twitter, shekharg and tweets”, in my case (see the Twitter Tools setting above). Editing each Twitter update post and adding tags is mundane.
  • I tweet more frequently than writing blog posts. Hence my blog’s home page gets cluttered with Twitter updates. Also, people subscribed to my blog’s RSS feed will start getting more of tweets and less of blog posts – kinda redundant because many of them are following me on Twitter, as well.

I solved the above two issues with a WordPress plugin for each – namely WP Calais Archive Tagger and Ultimate Category Excluder respectively.

Automatic tagging with WP Calais Archive Tagger
This plugin uses the Opencalaisservice to analyze, semantically, the text of the blog post and automatically generates the relevant tags for each post. After installing this plugin, all I had to do is to supply it with a Opencalais API key, which I already had. You can get a API key  by registering, for free, at http://www.opencalais.com/user/register. Once registered, the key will be emailed to you. Type in that key in “Plugins>Calais Archive Tagger” page on the WordPress admin panel.

Subsequently, clicking on the link “Click here to start tagging your posts” automatically start tagging all the posts including the daily twitter updates. Note that it maintains the tags that were entered manually against the blog posts and adds onto them. As you may have guessed, each time you want the Calais Archive Tagger to generate meta tags, you will have to come to this page and click on the link. I do it once in a day or two. Someone has also written a  Cron friendly script to make this happen automatically. I’m not using it, yet.

Note that I have been using All in One SEO Packplugin which displays the past tags as meta tags, on the blog pages, for search engines. Without this plugin, the automatically generated tags may not help in the search engine context. This plugin is highly recommended whether or not you are integrating with Twitter.

Exclude Tweets from Home Page and RSS with Ultimate Category Excluder
This is a nifty and easy to use plugin. Following are the screenshots of how my blog’s home page displays without and with this plugin:

Blog Home Page without the Ultimate Category Excluder Plugin

Blog Home Page without the Ultimate Category Excluder Plugin

Blog Home Page with the Ultimate Category Excluder Plugin

Blog Home Page with the Ultimate Category Excluder Plugin

Note that with the Ultimate Category Excluder plugin, none of the “Twitter Updates” posts are showing on the home page. A visitor can still access these posts via archives, category (on the sidebar) or using the search. All I had to do, after installing the plugin, is to exclude the Tweets category in the plugin’s settings (Settings>Category Exclusion) as shown in the screenshot below:

Settings for Ultimate Category Excluder Plugin

Settings for Ultimate Category Excluder Plugin

Note that I have opted to exclude the Tweets category from the home page and from the feeds. I left it to appear in the Archives. Bottom line: integrating WordPress perfectly with Twitter requires more than just the Twitter Tools :-)

Update (November 15, 2009): All of a sudden, after October 28, Twitter Tools stopped posting the daily digests of tweets onto this Blog. Similar/same issue is posted hereby others. Blaming WordPress upgrade to 2.8.5 and my server operating system upgrade to CentOS 5.4 did not make sense because these happened before this issue occurred. That is, the daily digests did work, for a few days, after the upgrades.

I kept trying miscellaneous ideas like downgrading to Twitter Tools 1.6, deactivating/deleting the plugin and re-installing the upgrade to WordPress 2.8.5, but nothing worked. Finally what worked for me is as follows:

  • Deactivate and delete the Twitter Tools plugin
  • WARNING: Take a backup of the database before proceeding further
  • Delete all the Twitter Tools related options from the database table called wp_options.  Following is the MySQL query which can be fired using any MySQL database client say phpMyAdmin:
    delete from wp_options where option_name like 'aktt%';

  • Reinstall the Twitter Tools plugin. I downloaded and unzipped the plugin into the plugins directory instead of installing it from the WordPress admin panel (via Plugins.Add New)
  • If logged in, log out from the admin panel
  • Re-activate the Twitter Tools plugin.
  • Ensure that all the configuration under Settings>Twitter Tools are blanked out. If yes, re-enter the settings like your Twitter Username and password, daily digest frequency etc.

Henceforth you should start receiving the digests. I applied this fix on 10th November and it is working for me, for far, even after an upgrade to WordPress 2.8.6.

Update (December 23, 2009): Updated my blog to WordPress 2.9 on December 18th. Twitter Tools working so far without any issues.

Update (February 4, 2010): Updated Twitter Tools to version 2.1.2 on January 25th. Waited for this long to update this post because I wanted to ensure that the daily digests of tweets are posted, regularly, as before. It seems to be working! Expect that on January 30th, the digest got posted thrice. Besides this one of case, Twitter Tools 2.1.2 is behaving. Also after upgrading to Twitter Tools 2.1.2, Open Web Analytics dashboard started working. Earlier I had to deactivate Twitter  Tools temporarily to look at the Analytics dashboard.

Update (May 28, 2010): Again, Twitter Tools stopped posting daily digests – as explained in Update (November 15, 2009) above – from 8th May to 15th May. This time I noticed that my server’s (on which this blog is hosted) system time has gone out of sync. Note that this wasn’t the issue during the earlier occurrences of this problem. Nevertheless, Twitter Tools should have worked as per the wrong server time. I even upgraded to Twitter Tools 2.3.1 hoping that the issue will self heal. Waited for a week, for it to work (or call me lazy :-) ). Finally what resurrected the daily digests is the same solution that I posted above – refer to Update (November 15, 2009). Since 16th May to till date (May 28) the daily tweets are being posted regularly.

Update (October 4, 2010): The latest version of Twitter Tools uses OAuth for authentication. This worked fine for me on WordPress 2.9.2. When I upgraded to 3.0.1, Twitter Tools stopped working. Note that the version of Twitter Tools  I’m using is 2.4.  Next, I followed the same steps as mentioned in Update (November 15, 2009). But this time, I faced a different issue. The authentication (the first step before setting up the plugin) kept failing saying “Authentication Failed. Please check your credentials and make sure Twitter is up and running”. After hours of troubleshooting at the code level, coincidently I happened to check my server’s time (system time). It was lagging behind by several minutes. Updated my server’s time (via ntpdate ntp.ubuntu.com) and voila! the authentication worked. Yet to see if the daily digests will start shooting up again. Will keep this space updated.

Update (October 9, 2010): With reference to Update (October 4, 2010), daily digests seem to be fixed. From October 4 to till date, daily digests are being posted regularly by Twitter Tools :-)

GD Star Rating
GD Star Rating
A Perfect Integration of WordPress and Twitter, 8.7 out of 10 based on 7 ratings

Email This Post Email This Post Print This Post Print This Post Print This Post Post A Comment Tweet your comments/question to me @shekharg


43 comments for “A Perfect Integration of WordPress and Twitter”

Post a comment