// you’re reading...

Wordpress

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.

GD Star Rating
loading...
GD Star Rating
loading...
A Perfect Integration of WordPress and Twitter10.0103
  • Share/Bookmark

Discussion

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

  1. Very neat indeed. Must check out what all would work for me from this, but the idea of the tags and digest does make a lot more sense than just a two-way sync.

    Cheers…Kishore

    GD Star Rating
    loading...

    Posted by Kishore Bhargava | May 5, 2009, 6:20 pm
  2. Great solution!

    With the Category Excluder, would subscribed people be emailed when a new twitter digest is posted, even though it wouldn’t appear on the home page?

    GD Star Rating
    loading...

    Posted by Wibbler | June 13, 2009, 3:11 pm
  3. Hi Wibbler,

    With the Category Excluder, would subscribed people be emailed when a new twitter digest is posted, even though it wouldn’t appear on the home page?

    Yes, subscribers will be emailed when a new Twitter digest is posted despite the exclusion from the home page.

    GD Star Rating
    loading...

    Posted by Shekhar | June 13, 2009, 8:55 pm
  4. Is one’s twitter password safe in such a plugin? I have found that twitter accepts both http and https login. Wonder how this plugin interacts with twitter?

    GD Star Rating
    loading...

    Posted by Jay | July 27, 2009, 8:18 am
  5. Hi Jay, it seems this plugin interacts using http (plain text).

    But sniffing the password from the blog site hosted on an Internet Web Server is not as easy as sniffing in a local network.

    Barring the first time entry of the Twitter username and password (in the plugin settings), the Twitter credentials will travel from your Blog’s server to Twitter’s server(s) and both of them would be, typically, Internet servers.

    GD Star Rating
    loading...

    Posted by Shekhar | July 28, 2009, 11:56 am
  6. [...] See the article here: A Perfect Integration of WordPress and Twitter | Shekhar Govindarajan’s Blog [...]

    Posted by A Perfect Integration of WordPress and Twitter | Shekhar Govindarajan’s Blog | WpMash - WordPress News | July 31, 2009, 12:39 am
  7. Thanks for the article, i’m currently feeding my wordpress site posts to my twitter with the post title, and the url. I would like to get the category to appear on my twitter, any tips to do so?

    GD Star Rating
    loading...

    Posted by chris | October 29, 2009, 5:15 pm
  8. Chris, help me understand this.

    Right now Twitter Tools plugin posts a new blog post on Twitter as follows:

    New blog post: [post title] [link]

    What you want is to include the blog post category too, something like:

    New blog post: [post title] [link] in [category]

    Is that right?

    GD Star Rating
    loading...

    Posted by Shekhar | October 31, 2009, 3:23 am
  9. Hi Shekhar,

    Yes something on the lines of that, prefferably i would like on my Twitter the feeds appearing…

    New [category name] post: [post title] [url]

    As I have various categories feeding into my blog, It gets a bit confusing what is actually being posted without the category name. Does anyone know if this is possible?

    GD Star Rating
    loading...

    Posted by chris | November 2, 2009, 1:16 pm
  10. I’d love to try your fix for getting twitter tools running. Mine’s been dead a while.

    But I keep getting errors with that mysql query in phpmyadmin.

    SQL query:

    DELETE FROM wp_options WHERE option_name LIKE ‘aktt % ’

    MySQL said:

    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘%’’ at line 1

    GD Star Rating
    loading...

    Posted by Rev. Voodoo | November 19, 2009, 2:23 am
  11. never mind my comment, I should have known by the gibberish in the response from SQL that I needed to type that line and not copy/paste

    GD Star Rating
    loading...

    Posted by Rev. Voodoo | November 19, 2009, 6:05 pm
  12. Hey Rev. Voodoo, sorry for the delay in response (that reminds me I still need to reply to Chris).

    I needed to type that line and not copy/paste

    That’s right. I have now made the line copy paste friendly. Thanks for pointing it out.

    Please do let me know whether the solution worked for you

    GD Star Rating
    loading...

    Posted by Shekhar | November 19, 2009, 8:29 pm
  13. Unfortunately, it did not. My problem is that twitter tools does not bring my tweets into my sidebar, nor does it make daily digests. I have everything setup OK. I tried the procedure twice. The plugin partially works, I can post tweets from my sidebar, and my blog updates are posted to twitter….so I’m halfway there.

    GD Star Rating
    loading...

    Posted by Rev. Voodoo | November 19, 2009, 11:32 pm
  14. The tweets are stored in a table called wp_ak_twitter. Are you able to see your tweets when you do a: select * from wp_ak_twitter; ?

    GD Star Rating
    loading...

    Posted by Shekhar | November 20, 2009, 12:25 pm
  15. yup, I’ve got hundreds of tweets in there!

    GD Star Rating
    loading...

    Posted by Rev. Voodoo | November 20, 2009, 6:17 pm
  16. Check if you have your latest tweets there. If yes, Twitter Tool is able to get the tweets from Twitter. In this case, the solution I suggested should have worked.

    You may also try clicking on the buttons “Update Tweets”, “Reset Tweet Checking” and “Reset Digests” in the Twitter Tools settings in the Wordpress admin. Note that this did not work for me though ;-)

    GD Star Rating
    loading...

    Posted by Shekhar | November 22, 2009, 8:52 pm
  17. yeah…my tweets are in the database, just not appearing within the actual widget for some reason. And my daily digest function still doesn’t work. None of those reset options do anything. hmmmm…strange eh?

    GD Star Rating
    loading...

    Posted by Rev. Voodoo | November 23, 2009, 8:58 pm
  18. [...] De cand am actualizat WP la 2.8.6, plug-ul Twitter Tools 2.0 a incetat sa mai faca “weekly digests” (bloc notes). Solutia am gasit-o aici. [...]

    Posted by bloc operator 3 – Blog » Blog Archive » Twitter tools 2.0 + Wordpress 2.8.6 | November 30, 2009, 4:32 am
  19. Hey Rev. Voodoo, whats the version of Twitter Tools you are using? I’m using 2.0 and all these steps worked for me with Twitter Tools 2.0 installed on WordPress 2.8.6

    GD Star Rating
    loading...

    Posted by Shekhar | December 5, 2009, 10:52 am
  20. Thanks for the advice on getting Twitter Tools 2.0 to work with Wordpress 2.8.6 Shekhar. Worked a treat.

    GD Star Rating
    loading...

    Posted by Ian Devlin | December 7, 2009, 9:35 pm
  21. [...] for earlier versions of Wordpress, and not the latest 2.8.6. Eventually I found one blog post by the integration between Wordpress and Twitter whilst also providing a solution to the problem that I was having. I will post here what I did, [...]

    Posted by Twitter Tools 2.0 and Wordpress 2.8.6 Issues - iandevlin.com – blog | December 7, 2009, 9:59 pm
  22. [...] of Wordpress, and not the latest 2.8.6. Eventually I found one blog post by Shekhar Govindarajan on the integration between Wordpress and Twitter whilst also providing a solution to the problem that I was having. I will post here what I did, [...]

    Posted by Twitter Tools 2.0 and Wordpress 2.8.6 Issues - iandevlin.com – blog | December 7, 2009, 10:04 pm
  23. I’m using twitter tools 2.0 with WP 2.8.6, same as you it looks like! Tried running through all the steps again. Still no go

    GD Star Rating
    loading...

    Posted by Rev. Voodoo | December 15, 2009, 12:28 am
  24. Likewise as Rev. Voodoo, although I’m TT 2.0 and WP 2.9. I tried to delete the entries from the DB table (which worked), but even after entering a fresh username and password after logging out, reactivating the plugin (installed via ftp into the wp-content/plugins dir, this still does not work. Hate to say it, but I’m going to have to let go of TT. This has happened too many times, and I know it’s hard to maintain software for free, so I don’t fault the developer, but I’ve got to move on. Thanks for the tips tho! Wish it had worked for me. I’d love to hear if anyone has finally gotten to the end of this bug.

    PJM

    GD Star Rating
    loading...

    Posted by Patrick Miller | December 25, 2009, 6:25 am
  25. new version of TT just came out, and fixed my problems!

    GD Star Rating
    loading...

    Posted by Rev. Voodoo | January 13, 2010, 10:53 pm
  26. Guess what, I still haven’t upgraded to Twitter Tools 2.1.1 or 2.1.2, from 2.0.
    Was fearing that I may loose what I have ;-) Your comment has given me some strength.
    Perhaps my weekend task is this. Thanks! Will keep everyone updated via comments on this post.

    GD Star Rating
    loading...

    Posted by Shekhar | January 15, 2010, 12:47 am
  27. 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.

    GD Star Rating
    loading...

    Posted by Shekhar | February 4, 2010, 3:39 pm
  28. Excellent post!! I wish it worked for me though.. :(

    I was on Wordpress 2.8.6 and TwitterTools 2.0 when my weekly digests stopped getting posted. I upgraded to TwitterTools 2.2.1. No luck. I then upgraded to Wordpress 2.9. Still no luck. Using the method you described, I uninstalled TwitterTools 2.2.1 and installed 2.0 instead. No luck.

    In all, the combos I’ve tried are:
    TT 2.0 + W 2.8.6
    TT 2.2.1 + W 2.9.1
    TT 2.0 + W 2.9.1

    But my weekly digest do not get posted. Checked for my tweets in wp_ak_twitter. They’re all there..

    Any suggestions?

    GD Star Rating
    loading...

    Posted by tanya25m | February 20, 2010, 12:04 am
  29. Did you follows all the steps under Update (November 15, 2009) ? Including the step to delete the twitter tools options with SQL query “delete from wp_options where option_name like ‘aktt%’;” ?

    You will be able to run a query like this using phpMyAdmin or any MySQL database tool

    GD Star Rating
    loading...

    Posted by Shekhar | February 20, 2010, 5:10 pm
  30. As like tanya25m stated… my issue is also same here… I even can’t test login.. the message “Sorry, login failed. Error message from Twitter:” oftenly shows…

    please solve this issue

    GD Star Rating
    loading...

    Posted by Mark | March 4, 2010, 12:13 am
  31. Hi Mark,

    I never faced the problem of failed login. But as per posts across the Web, this may happen due to conflict with some other WordPress plugin.

    Try the following:

    1. Deactivate and reactivate the Twitter Tools plugin.

    2. If 1. does not work, deactivate all other plugins and then try Twitter Tools test login.

    Also let me know the version of WordPress and Twitter Tools that you are using.

    GD Star Rating
    loading...

    Posted by Shekhar | March 7, 2010, 9:08 pm

Post a comment

Overslept last night to keep my eyes open for a long meeting at UNESCO. But still wish to have a power nap before the meeting ;)
28 minutes ago, comment
Your brain may be overflowing with new ideas today and your se... More for Leo http://twittascope.com/twittascope/?sign=5
28 minutes ago, comment
For the fans RT @wordpress WordPress personas for Firefox: http://short.to/1goju
3 hours ago, comment
Hit by Twitter rate limit in a project. Requested client 2 fill http://tinyurl.com/ye6zwrh Within 24 hrs got mail: 20K requests/hr in 48 hrs
3 hours ago, comment
New blog post: Drupal 6: Different Page Templates for different Content Types http://bit.ly/bfX1yc
3 hours ago, comment