WP to Twitter

Current version: 2.3.8

All plug-ins:
Donations: $5197.40. Downloads: ~870,000. That’s about one half cent per download. Donors’ Roll

Support this plugin!

The WP-to-Twitter plugin posts a Twitter status update from your blog. URLs can be shortened using a variety of services; the focus is on services which provide statistics for the link. Available shorteners are Cli.gs, Bit.ly, Yourls, and WordPress.

Version 2.3.0 released. – Now with support for custom post types

The plugin can send a default message for updating or editing posts or pages, but also allows you to write a custom Tweet for your post which says whatever you want. Both custom Tweet texts and your default message supports a variety of shortcodes to substitute your blog title, post title, etc., in your tweeted update.

Any status update you write which is longer than the available space will automatically be truncated by the plugin. This applies to both the default messages and to your custom messages.

This plugin is based loosely on the Twitter Updater plugin by Jonathan Dingman, which he adapted from a plugin by Victoria Chan. Other contributions by Thor Erik and Bill Berry.

Installation

  1. Upload the `wp-to-twitter` folder to your `/wp-content/plugins/` directory
  2. Activate the plugin using the `Plugins` menu in WordPress
  3. Go to Settings > WP->Twitter
  4. Adjust the WP->Twitter Options as you prefer them.
  5. Provide your OAuth integration keys.
  6. Optional: Provide your URL shortener API key if you want to have statistics available for your URL.
  7. That’s it! You’re all set.

Comments on this post are now closed; please make support requests on the support page.

Return to Top

385 Comments to “WP to Twitter”

  1. I just installed the 1.41 update and got the following:

    Warning: main([pathremoved]/nevertoolateguitar/wp-content/plugins/wp-to-twitter/json.class.php) [function.main]: failed to open stream: No such file or directory in [pathremoved]/nevertoolateguitar/wp-content/plugins/wp-to-twitter/wp-to-twitter.php on line 42

    Fatal error: main() [function.require]: Failed opening required ‘/[pathremoved]/nevertoolateguitar/wp-content/plugins/wp-to-twitter/json.class.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in [pathremoved]/nevertoolateguitar/wp-content/plugins/wp-to-twitter/wp-to-twitter.php on line 42

  2. Hi Joe, I upgraded to 1.4 now my posts don’t go to Twitter. I get this error after I make a post. Is there something I should do? Or is this something you can fix? Thanks a lot

    Fatal error: Call to undefined function: str_ireplace() in /nfs/c04/h03/mnt/64150/domains/pessimets.com/html/wp-content/plugins/wp-to-twitter/wp-to-twitter.php on line 291

  3. is it possible to set it to tweet only when I update/post under a specific category , I dont want to tweet every post I just want to tweet specific post under specific category , can I do that and how ?

  4. Damn. That means that your server doesn’t support PHP 5.2, which is something I forgot to account for. I’ll release a new version tomorrow which is PHP 4 compatible.

    Sorry!

  5. NeverTooLateGuitar; August 2, 2009 at 1:35 pm

    I just upgraded to 1.4.0 and added my info to use bit.ly. Now, when I got the settings page fro WP to Twitter I get the following:

    Fatal error: Call to undefined function: json_decode() in /home/jeffsi2/public_html/nevertoolateguitar/wp-content/plugins/wp-to-twitter/wp-to-twitter-manager.php on line 212

    What do I do about this?

  6. Cool I will digg deeper …Thanks

  7. Ah - the “Tweet this” button is totally separate! My plugin doesn’t incorporate any visitor-facing features, so that’s coming from something else: either from another plugin (such as Tweet This) or from your theme.

  8. Yes you are talking about on the settings page…. The title is showing when a new post is added, just not working when you press the tweet this button on the post itself?? only shortened URL ..is there somewhere on the post page or elsewhere I need to put #title#

  9. Are you using the #title# shortcode in your tweet text? The shortened URL will always be added if you have “Provide link to blog” checked, but nothing else is guaranteed unless you’ve provided the appropriate shortcodes.

  10. What am I doing wrong?? When I tweet a post the only thing that it tweets is the shortened URL..No title of the post

  11. Hmmm, in that case I’ll just disable it. No big deal, I just like to use functionality that is in a plugin.

    BTW, I’ve got the “title” selected as the twitter post text.

  12. Posting links isn’t one of the particularly feature-rich options. The custom text box for links only comes into play if the link title or link description isn’t present. It also doesn’t support any of the shortcodes available in blog post updates.

    However, it will post whatever you write in the link description as your Tweet if you have link description as your selected option — so you should be able to write a fairly extensive description and have that work.

    Although I have to admit that I haven’t actually tested the link posting options at all with 2.8 — I wasn’t sure that anybody was actually using that functionality! Now that I know differently, I should probably go in an check that out.

  13. Okay, using WP 2.8.2

    I have the box checked so that it will update when I put up a new link in my site, but it’s not pulling the custom stuff that I have so that it displays fancy on Twitter. It was just posting the link name and a reduced url to the link.

    What do you need from me to correct this?

  14. I use it with Feedwordpress RSS plugin and it works fine, except I get an error_log file in the blog root and wp-admin folder full of entries like this:

    [11-Jul-2009 06:20:15] MagpieRSS: Failed to fetch (HTTP Error: malforme)

  15. It looks like this has been discussed here a little but I can’t find a solution in these comments… the plugin is great, I love it but it doesn’t seem to work with automated posts - only posts done manually. Is this going to be added or is there a workaround?

    Thanks in advance!
     -Tony

  16. Do you have this problem every time or occasionally? Is this a new installation which has never worked or an older installation which stopped working?

    Did you run the test script? (Bottom of the settings page.)

  17. There’s been an error posting your Twitter status! Visit your WP to Twitter settings page to get more information and to clear this error message.”

    I am having the same problem.
    I changed the cli.gs api key but it doesn’t help!

  18. Well, in theory, it determines where your posted Cli.gs URL will be set in the Twitter status update. However, it doesn’t seem to work for a lot of people, so you can just delete it. Hopefully it’ll be better in the next update.

  19. Which Mobile Phone; July 29, 2009 at 2:13 am

    Just started using the plugin today, like what i see so far. I’m just a bit unsure about one thing - whats does the (#url#) actually do? and do i need it? Is there any benefit?

  20. Thanks very much Joe, for letting me know and for looking at our XML-RPC issue!
    Very much appreciated!

    Best, Bart van Poll

  21. @Dani There’s no way for you to use html to make the post-title the link, for the simple reason that Twitter doesn’t support that. Even if you tried to code a link, it wouldn’t actually work out that way.

    Using your normal permalink is something which will eventually be supported, but which I haven’t put in place yet - it’ll be available in the next release.

    Best,
     Joe

  22. I really, really just want to use permalinks instead of clig. The clig url is really ugly and this twitter account is for a business. OR, and this would be preferrable, can I use an a href like deal to not show the url and just make the post title the link?

  23. @Chris — Well, that certainly seems unusual! I’m not seeing it myself, and I haven’t yet heard any other reports in common. Seems very strange. You may want to contact Pierre at Cli.gs and ask if he can see what’s causing the automatic creation of the cli.gs; there’s a source parameter in WP to Twitter which could allow him to see whether these cligs are coming from the plugin or being generated in some other way.

    I suspect, if it’s a WP-to-Twitter thing, it’s being caused by some kind of scheduling weirdness in your WP installation - but it’s hard to say what you can do about that.

    @BartVanPoll I’ll take a look at that — I do remember some kind of problem involving differentiating between new and edited posts with XMLRPC, but don’t recall the details right now. It’ll be sometime next week that I look at this.

    @Vince I won’t be dropping Cli.gs as an option, but I will be adding alternative options for URL shrinking, so that users who have chronic problems with Cli.gs will have other options.

  24. Great plug-in!! I was wondering if anyone else was seeing the same thing I am in my Cli.gs account since using your plug-in. Basically, new cli.gs are getting created for each of my posts every day. It seems to be happening automatically. Anyone else seeing this? This only started happening since I began using your plug-in over another wp to twitter plug-in.

    I am on WordPress 2.8.2, Apache/Linux and I am on the current version of your plug-in.

    Thanks!

  25. Hi,
    I can confirm it seems to work OK with WPMU, except I get an error_log file in the blog root and wp-admin folder full of entries like this:

    [11-Jul-2009 06:20:15] MagpieRSS: Failed to fetch (HTTP Error: malforme)

    Using the feedwordpress plugin, latest version

    I also get the following message in the admin backend every so often:

    There’s been an error posting your Twitter status! Visit your WP to Twitter settings page to get more information and to clear this error message.

    and

    The query to the Cli.gs API failed, and your URL was not shrunk. The normal post URL was attached to your Tweet.

    Maybe best to have option to turn off the Cli.gs integration as it doesn’t seem reliable?
    Any ideas?

    Many thanks

  26. Hi Joe,

    Great plugin! The best mix of everything for me…

    A small issue for me…

    I have selected
    > Update Twitter when a new post is published
    > Update Twitter when an old post has been edited
    > Send Twitter Updates on remote publication (Post by Email or XMLRPC Client)

    I publish new & update postings via XMLRPC.

    When I UPDATE a posting, in Twitter it says “New post” while it SHOULD say “Post Edited”.

    Do you know what could be the issue?

    Thanks!

  27. That’s interesting — I wonder if there’s a change in the security settings for XMLRPC with WordPress that I’ll need to look into. Still surprising, since WP to Twitter doesn’t actually interact with XMLRPC…

  28. It seems there’s a current issue with xmlrpc and WordPress for iPhone anyway: http://iphone.wordpress.org/2009/07/16/xml-rpc-fix-testing-help/ (although that’s not the error I get) so perhaps the problem is related?

  29. That’s interesting, deKay — I’m at a bit of a loss to see exactly how it could happen, but I’ll certainly look into it. The only way WP to Twitter interacts with XMLRPC is to to be aware of XMLRPC posts and Tweet them if the settings allow it; it shouldn’t have any interaction at all with any other XMLRPC actions.

    So, it’s a strange thing. But, that’s programming. Unexpected collisions.

  30. WP to Twitter is stopping other services from posting via my blog using xmlrpc. When I upgraded WP to 2.8, Flickr could no longer post to my blog, but I assumed it was a Flickr problem. Now I find the iPhone apps Blogpress and WordPress for iPhone both fail to talk to it any more, with assorted errors about xmlrpc not existing, my blog not existing, or passwords being incorrect.

    Disabling WP to Twitter allows them to work again. The issue must lie with WP to Twitter (and WP 2.8/2.8.1) because disabling *all* my plugins bar it, and reverting to the standard template still doesn’t work.

  31. If the option to post a URL to Twitter is checked, the plugin will always add the URL, whether the shortcode is in the string or not; if the shortcode is present, the URL is supposed to be added at that location, otherwise it’s just appended to the end of the string.

    I’m still uncertain why the #url# shortcode isn’t working for some people, but hopefully I’ll find it one of these days!

  32. I had the same #url# problem appearing in the Title. Here’s what I did. In the settings, I checked out the Post title and only left #title# in there. I removed the #url# and it posted fine. Apparently the plugin “knows” to place the URL at the end. So it’s almost a duplicate effort.

    Note: when I do this, I never type anything into the Twitter text box at the bottom of the post. I just post.

  33. This is a very wicked plugin. Unfortunately, I don’t currently use WordPress but will be migrating soon.

    Thanks for sharing it here.

  34. I didn’t notice that you mentioned that the revision tweets are only Tweeted when the post actually goes live; that’s rather interesting…that may be a new bug that I wasn’t aware of.

    I’ll look into it!

    -Joe

  35. It won’t get Tweeted if saved as draft post would it?

  36. I just checked those settings and I only have “Update Twitter when a new post is published” checked. I also have Quick Press enabled, but I don’t use that so I turned it off.

  37. You should disable tweeting of posts on editing - you can change that easily in the settings.

  38. Great plugin! I do have an issue when scheduling posts. The plugin Tweets every revision made to the post. So say I write a post and save it 5x before I shedule it to be published. When the scheduled time comes around, there will be 5 Tweets that go out for the post.

    I had one post with over 20 revisions (it was a long editorial article), and so when it went out as scheduled there were 20+ Tweets.

  39. That should be manageable; I’ll look into adding this into the next release, although I have a number of other updates also scheduled in that release — whether this makes it will depend mostly on how long I want to wait before release!

  40. Thanks for the information, Lee — I’ll see what I can do!

  41. Thank You for the great plugin! Like Steven above I would like to suggest having a bit of the post text included in the tweet. Maybe you could make the option to add the first few characters in brackets (140 chars minus the length of the title and the url)?

  42. the urlencode kill my title text as I am writing foreign language blog
    ex.
    ทัà¸?ษิณ ดอดนอนมาเลย์ ถาวร จ่อรวบà¹?ต่หนีทัน => length is 40

    when encoded it says length is 336
     %E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B8%B4%E0%B8%93+%E0%B8%94%E0%B8%AD%E0%B8%94%E0%B8%99%E0%B8%AD%E0%B8%99%E0%B8%A1%E0%B8%B2%E0%B9%80%E0%B8%A5%E0%B8%A2%E0%B9%8C+%E0%B8%96%E0%B8%B2%E0%B8%A7%E0%B8%A3+%E0%B8%88%E0%B9%88%E0%B8%AD%E0%B8%A3%E0%B8%A7%E0%B8%9A%E0%B9%81%E0%B8%95%E0%B9%88%E0%B8%AB%E0%B8%99%E0%B8%B5%E0%B8%97%E0%B8%B1%E0%B8%99

    I think the substr and strlen should be replace with mb_substr, mb_strlen but can’t not get it work correctly.

    Could you please test and fix
    Thank you

  43. Ahhh, ok. I wasn’t aware of that. Thanks! It’s a great plug in!

  44. @Patrick No, not at the moment. I’ll have to sit down and go through the plugin with WP-MU one of these days; as it is, it’s really just a fortunate coincidence that it works, since I’ve never tested it in that environment!

    @Billy In fact, it’s pretty much out of my hands. I can tell you how to change it: write a plugin and register it with Twitter using your blog name and URL as the software home address and name.

    In short, that link is coming from the information I gave Twitter in registering my plugin with them.

  45. Hello!

    I doubt you’ll allow this because this is how your plugin gets promoted. BUT, is there any way you could tell me how to change the posted “from WP to Twitter” line below the tweets which links to this page?

    It would obviously just be more professional if I could make it say that the tweet was posted “from My Blog Name”.

  46. Never mind in re #2. Its working. I’m still not sure why it was not working for a bit. Guess I need to slow down and practice good techniques.

  47. Hey Joe,

    Thanks for the feedback. I was mixing messages in there. I’m using Register Plus, which allows you to theme the subscriber profile in addition to login/register/password pages, and I was hoping to theme other roles. Sorry about the mix up.

    Regarding defaults, this is for a WPMU install, so modifying defaults would be really useful to me. I’ll mod the file as you suggested.

    I have 2 other questions?

    1) Is there any way to add another option on the settings page that allows admin users to check a box to automatically post comments to Twitter as well?

    2) Can you think of any reason that the option to add twitter credential to author profiles wouldn’t work? I’ve checked the box on settings that allows authors to enter their accounts, but its not showing up on their profile page. It was there previously, but I’ve been moving at such a break neck speed and made many changes to sitewide config, plugins, etc., that I can’t retrace my steps and identify the problem. Any know conflicts that cause this particular problem?

  48. @matt If what you’ve written is exact, then you need to use the #url# shortcode in lowercase - in the next version it won’t be case specific, but for now…

    @vineesh Eventually…just need to find the time.

    @vince Judging from @patrick’s comment, it appears that it works just fine with WPMU - I haven’t tested it myself, but it seems promising!

    @patrick Theming roles: I’m not sure how this applies to the plugin. Not really sure what the question is… Changing Default Settings: Might be something worth adding for WPMU use, but for individual blog use I haven’t really had a reason to offer that. You can go into the plugin file itself and make changes, but there’s no easier way to do it. The settings are all in the file wp-to-twitter/wp-to-twitter-manager.php.

  49. I just installed the latest version of WP to Twitter on WPMU 2.7.1 and it works great! Nice work with this plugin. I have a few questions, and I did a search on these comments but didn’t find an answer, so apologies for repeats…

    1) Is it possible to theme roles other than Subscriber? In my particular case, I’d actually like to theme everyone’s profile but admin. (Lengthy reasons…)

    2) Is it possible to change the default settings for the plugin? For example, I’d like “Update Twitter when an old post has been edited” to be unchecked by default (the default settings are used each time a new blog is created on WPMU, and I have some specific defaults I’d like to use).

    Thanks!

    Patrick

  50. Hi,
    Does this plugin work with WPMU?
    I tried the Twitter Suite plugin which works fine on standard WP, but gives SQL errors on WPMU
    Would I have same issues with WP to Twitter plugin?
    Many thanks