// 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.

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
loading...
GD Star Rating
loading...
A Perfect Integration of WordPress and Twitter, 8.7 out of 10 based on 7 ratings
Share

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

Discussion

43 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

    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?

    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.

    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?

    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.

    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?

    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?

    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?

    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

    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

    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

    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.

    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; ?

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

    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 ;-)

    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?

    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

    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.

    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

    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

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

    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.

    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.

    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?

    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

    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

    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.

    Posted by Shekhar | March 7, 2010, 9:08 pm
  32. This worked perfectly for me, many thanks.

    Posted by Jamie | March 12, 2010, 6:52 pm
  33. Most welcome. Thanks for confirming it Jamie

    Posted by Shekhar | March 12, 2010, 6:55 pm
  34. thanks twitter tools fix worked like a charm.

    Posted by the JR | March 13, 2010, 9:01 am
  35. I again faced the problem with daily digests. Refer to Update (May 28, 2010) in the blog post above.

    Posted by Shekhar | May 28, 2010, 7:58 pm
  36. Twitter tools were working fine so far, however, the option to tweet automatically on new posts fails since a couple of days.

    Good to know: I use FeedWordPress to collect and announce existing posts.

    This is what I observed:

    1) My Settings – Twitter Tools Enable option to create a tweet when you post in your blog? Is set “Yes”
    Tweet prefix for new blog posts: NEW
    Set this on by default: Yes
    Create tweets from your sidebar? I updated this to “yes”, but didn’t receive any new posts yet to verifiy if this changes behaviour, which I would doubt.

    I am using WordPress 3.0.1., FeedWordPress Version 2010.0623 , Twitter Tools Version 2.4 , Twitter Tools – Hashtags Version 2.4

    2) I receive the following type of fatal error log

    Fatal error: Call to a member function do_blog_post_tweet() on a non-object in /home/kudutalk/kudutalk.com/wp-content/plugins/twitter-tools/twitter-tools.php on line 740
    However, I am not sure (even more doubtful) that this is triggered at the moment that new posts are published.

    3) I noticed that the option “Send post to Twitter” was set checked “No” on my last posts.
    If I switch this to “Yes” and save, then this is tweeted correctly.

    4) What has changed recently:
    - I added lots of new syndication feeds for FeedWordPress
    - I removed and re-installed Twitter Tools
    - After this error occurred, I installed Twitter Publisher as failback (only later I noticed observation Nr 3)

    Can you help?

    Posted by kudu | August 23, 2010, 4:02 am
  37. Hi kudu,
    I’m a little confused about the exact problem that you are facing.

    3) I noticed that the option “Send post to Twitter” was set checked “No” on my last posts. If I switch this to “Yes” and save, then this is tweeted correctly.

    Doesn’t this mean that your problem got solved ? Or are you still getting the Fatal Error message?

    Posted by Shekhar | August 23, 2010, 5:22 pm
  38. Shekhar,
    thanks for replying.
    I am sorry I was not so clear.
    This setting on each post is now “No” for new posts. With the general option “set this in by default”, I would expect this to be “yes” for every new post.
    So if I change this “no” manually to “yes”, it posts and tweets well, but it is the purpose to have this automatic.

    Have I clarified this better?
    Thanks!!!

    Posted by kudu | August 24, 2010, 4:28 am
  39. I don’t know if I was clear mentioning that you may have a look at http://www.kudutalk.com to see the type of posting.

    Posted by kudu | August 24, 2010, 4:29 am
  40. Kudu,

    So if I change this “no” manually to “yes”, it posts and tweets well, but it is the purpose to have this automatic

    So you are suggesting that, by default, it should be Yes instead of No ? Fair enough.

    Posted by Shekhar | August 24, 2010, 10:07 pm
  41. i love to microblog that is why i am very addicted to Twit my daily activities**,

    Posted by Nevaeh Green | October 6, 2010, 11:07 pm
  42. Ideal guide! I am only beginning out in marketing and marketing and attempting to learn to carry out it nicely – assets just like this write-up are extremely priceless. As our corporation is based mostly in america, it is all a bit new to us.

    Posted by snsd hoot | December 18, 2010, 10:27 am
  43. […] / syncing with the server. I spent a lot of time reading online forums and found this post by Shekhar Govindarajan to be the most helpful until I found an even easier […]

    Posted by Repairing Twitter Tools Plugin When It Fails to Sync / Update | February 5, 2014, 1:14 am

Post a comment

Recent Tweets

Follow Me on Twitter