WP to Twitter

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

The plugin can send a default message for updating or editing posts, pages or any custom post types, and also allows you to write a custom Tweet for each post which says whatever you want. Both custom Tweet texts and your default message support 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 be truncated by the plugin. This applies to both the default messages and to your custom messages.

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.

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

Return to Top

384 Comments to “WP to Twitter”

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

  2. Hey Joe

    Any possibility of using bit.ly with WP->Twitter?

    Thanks.
     Vineesh

  3. Hi, thanks for developing this plug in in, it seams to be great, but apparently I’ve got a problem. It does post to twitter, but it only fills the custom field #title#. #url# is not replaced with the post’s URL? So my tweet looks like: Blog Update: This is a test post, (#url#)

    What could be the problem?
    I am using WP 2.7 on apache.

  4. I haven’t observed any problems with 2.8 myself; I’m intrigued by the apparent fact that people are finding the plugin to fail in 2.8 after initially working…that’s *extremely* strange, to say the least.

    I would appreciate it if somebody who’s having this problem would post their settings for me and let me know what publishing circumstances are causing problems so that I can test this more thoroughly (without having to go through every possible settings combination!)

    For the moment, I’m going to continue to consider it stable in 2.8, lacking any obvious evidence to the contrary…

  5. @mo the plugin does work for 2.8 however like from what I see in many of the comments I do fail silently. I was able to send one tweet with the app before it cut out on me.

  6. 2.7.1 runs perfectly, i wanna update to 2.8 but without WP-to-twitter its shite :)
    idk if it runs on 2.8, if you say yes, it would be awesome :)
    peace
     mo

  7. What are your other settings? What method are you using to post which is causing the problem?

  8. will there be an update for 2.8 ?

  9. i have no idea what im doing wrong but i have “Update Twitter when a new post is published” checked and it still wont tweet the posts.

  10. Joe, love the plugin! as far as I can tell everything is working as advertised with the exception of one bug I can not resolve. Tweets look great for new posts, but the tweets for post updates are not translating the #url#. The tweet literally posts ‘Post Edited: Title of Post (#url#)’.

    Any reports of this or any thoughts?

    -Tim

  11. My bad…your great plugin is working just fine!

  12. Thanks, Mike! I appreciate your comments - especially without a problem to report!

    @donne I wish I could help you, but without some kind of information about how you’re using the plugin, there’s really nothing I can say.

  13. Just had to say what a great plugin. Works fine on latest 2.8 WordPress.
    Sorry I don’t have any problems for you :)

  14. It is still not tweeting.

  15. Thanks, Joe.

    I am pretty busy myself, but as time permits I will dink with the code. If I work out a solution before I hear from you, I’ll post it up on the site. In the mean time the external_url will do OK.

  16. That looks like it would be pretty easy to connect with this plugin. Although I don’t have time to do it this week, I should be able to get support for it added before the end of the month.

    Until then, you can place the Twitter Friendly link into an external_url custom field and the plugin will substitute the external_url for the shortened URL.

  17. WordPress 2.7.1.
    - Operating System : Linux
    - Server : Apache
    - MYSQL Version : 5.0.67.d7
    - PHP Version : 5.2.5

    My Current Plugins include:

    Twitter Friendly Links 0.3.4
    WP to Twitter 1.3.7

    I have had too many times when Cli.gs simply did not respond. I couldn’t even log in to Cli.gs to review my account. I installed Twitter Friendly Links and it gives me acceptably short urls.

    How do I get WP to Twitter to use the short links from Twitter Friendly?

  18. @Richard Khaaliq The only suggestion I have would be to disable and re-enable the plugin in WordPress. You could also simply try refreshing the page — this is outside the control of the plugin, however: the update notifications are pretty much entirely controlled by the WordPress core.

    @donne It should appear pretty much immediately, unless you’re using scheduled posts, in which case it will appear whenever the post actually launches.

  19. How long does it take for the tweet to appear?

  20. After upgrading to 1.3.7 the message “There is a new version of WP to Twitter available.” continues to display in my blog. How can I fix this?

  21. @Tom - You do need to edit the file in an external editor with line numbering, then upload the edited file to the server. Almost any external editor would work — if you have something like Dreamweaver already, it’s built in, or you can open the file in a text editor such as Notepad++ or a similar product.

  22. Hi Joe,

    unfortunately, the settings will not show in WP. I would like to solve the problem following your advice above “commenting out lines 145 - 190 in wp-to-twitter/wp-to-twitter-manager.php” . But in WP Plugins Editor are no line numbers indicated. So which content should I comment out? Which other editor should be used?
    Thx for your help!
     Tom

    WP 2.7.1, new installation, server type n/a

  23. Yes, I just tried it out tonight, the plugin works as advertised, creating the Cligs link and everything, when I publish a fresh post.

    Sadly, this is the last time in my life I plan on doing so, however… I really need the scheduled posts to go out with it too!

    Thanks in advance for your help.

    Luke

  24. My first question for you is if the xmlrpc issue got fixed or not, I noticed in the thread above someone having that problem says it’s working now, but you never officially said it was working fine.

    It is officially working fine. [For what it’s worth, that information can all be found in the version notes in the file readme.txt which is supplied with the plugin.]

    Second, Is a post made the old-fashioned way, but scheduled for later, handled the same way as an xmlrpc post, as far as your plugin is concerned? I can’t get either to send a new post notification to twitter.

    No. They are completely separate functions. However, it could be that problem effecting your server is common to both functions.

    Question #3: Is the checkbox for “Send Twitter Updates on remote publication (Post by Email or XMLRPC Client)â€? supposed to be checked for one or both of these situations in order to send out a new post tweet?

    It must be checked in order for XMLRPC clients to be able to publish to the blog. It has no impact at all on scheduled posting.

    All in all, I’d say that these are probably two completely separate problems. XMLRPC is sometimes disabled by hosting services for security reasons; Hostgator probably has some kind of documentation about this if they do.

    I’m not sure what might be causing problems with scheduled posts. If the scheduled posting is happening at all, it should be fine with the plugin as well.

    Can you confirm for me that the plugin is working when you publish a post normally?

  25. Hi Joe, thanks in advance for your awesome plugin & support. I’ve used two other Twitter reposting plugins, and yours is clearliy the most feature rich and user friendly. Congrats!

    Unfortunately, all three of these plugins (yours included) fail to work on a bunch of my blogs. They simply won’t post a new post tweet for any of my scheduled posts, xmlrpc or not.

    My first question for you is if the xmlrpc issue got fixed or not, I noticed in the thread above someone having that problem says it’s working now, but you never officially said it was working fine.

    Second, Is a post made the old-fashioned way, but scheduled for later, handled the same way as an xmlrpc post, as far as your plugin is concerned? I can’t get either to send a new post notification to twitter.

    Question #3: Is the checkbox for “Send Twitter Updates on remote publication (Post by Email or XMLRPC Client)” supposed to be checked for one or both of these situations in order to send out a new post tweet?

    I’m using your latest (1.3.5) with WP version 2.7.1. I admit that I do have a buttload of plugins turned on, but I’ve tested this with all but askimet disabled to the same effect.

    I’m being hosted at hostgator with PHP 5-something. A standard, modern linux shared-server package.

    The rest of my settings are as follows:

     —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  — 
    O Update Twitter when new WordPress Pages are published
    O Update Twitter when WordPress Pages are edited
    X Update Twitter when a new post is published
    Text for this Twitter update: New post today! #title#
    X Provide link to blog?
    O Update Twitter when an old post has been edited
    O Provide link to blog?
    O Update Twitter when you post a Blogroll link
    O Use link title for Twitter updates
    X Use link description for Twitter updates
    O Text for this Twitter update (used if above choice isn’t available.)
    O Set default Tweet status to ‘No.’
    O Send Twitter Updates on remote publication (Post by Email or XMLRPC Client)
    O Update Twitter when a post is published using QuickPress
    Custom text to be prepended on every Tweet (none)
    Custom text to be appended on every Tweet (none)
    Custom field containing an alternate URL to be shortened and Tweeted. (none)
     —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  — -

    Additionally, I’ve entered my Cli.gs API key, but problem existed before doing that too.

    Looking forward to finally using twitter!
     -Luke

  26. Works great, thank you

  27. Thanks for the detailed information, Matt and Brian! I should be able to get the problem identified fairly quickly, now.

    I’m not sure about the issue with user roles — I’ll look into it.

  28. Joe - can you help us out?

  29. Matt - thanks so much. You are right, if “Provide link to blog” is checked, then #title# works fine. If its not, then it doesn’t work.

    Also, on my system I have user roles that can only submit drafts for review. They are then published by supervisors. It appears that those blogs aren’t sent to Twitter - only those created by the admin account????

  30. I’m having the same issues now (#title# showing instead of the actual title of the post)… seems like this only happens when “Provide link to blog?” is unchecked. My previous setup just the post title and link to the homepage of the site, not the URL to the actual post. can’t seem to do this now.

  31. I’m having the same problem as Zale. WP 2.7.1 and WP — >Twiter 1.3.4. My tweets show #title# and #url# instead of the actual title and URL.

  32. What an incredibly usefull plugin! Works like a dream.

    Thanks for your hard work!

  33. I’m definitely aware of people’s concern with the longevity of these URL shortening services, and a custom shortener option is planned for the plugin in time.

  34. Instead of using a 3rd Party URL shortener like Cligs why not have WP create it’s own short URL like the Link Shortcut plugin does? Would love to see it integrated into a Twitter plugin like this one.

    I’m weary of the long term viability of many URL shortening services and would just prefer to have my own short URL’s.

  35. Tried quite a few WP to Twitter plugins, but like this one the best…..

    Thanks

  36. Hi There,

    I just installed the plugin and its sending out the Tweet - but I get #title# instead of the title.

    Running 2.7.1 on Bluehost with a number of plugins.

    Any ideas?

    Zale

  37. working fine! Thanks!

  38. I’ve been planning on incorporating this into WP-to-Twitter since the beginning, and have just been waiting for Pierre to get that feature developed into the API. He knows this; and I’m keeping on top of API development.

    So, in short - yep. It’ll be there. Eventually.

    Thanks!

  39. Hi Joe,

    I have been using WP to Twitter since the “early” days and apart from a few glitches earlier on it has been humming along nicely for me. I commend you on the continued and prompt support you provide for your plugin.

    I have also taken advantage of the cli.gs service for shortened URL names and last night I thought I’d check out the cli.gs siteto see what information and stats they offered on my tweets and I was quite surprised to see how many clicks on the cli.gs I’m getting from my tweets.

    My website/blog is certainly no 1000’s a day blog but I do take an interest in stats (as one does) and I began to wander how I could show my cli.gs stats on my blog. Did a bit of searching to check if anyone had developed a plugin/function for this but no luck. This led me to email cli.gs to see what they might suggest. This is the response I got from Pierre:

    Good question about showing stats on a WP blog. Currently, there isn’t
    an API to extract the data and so it’s not easy to do. But: the new
    Cligs platform will allow such an API to be built efficiently (i.e.
    not kill the server) and so in a few weeks time, this kind of plugin
    will be possible.

    Now Joe - my question to you and possibly to other readers…. are you or any of your readers aware of any plans to develop and make available such a plugin. Would you perhaps consider including this feature in WP-to-Twitter.

    R

  40. Awesome. That’s what I hoped to hear.

  41. Hello Joe,
    Thanks for the Update, it is finally working now correctly with my blog :) .

    - Tony

  42. That’s a section of the script which checks whether or not the server supports the methods needed to contact the Cli.gs and Twitter APIs; if you have the needed support, it’ll work just fine without those lines. They just provide some more user-friendly error messages so users have some idea what isn’t working if there’s a problem.

    And they also, for some reason, cause the script to exit; on some IIS servers. It’s a mystery to me.

  43. Ah, it’s so clear when you know where to look. 8)

    Thanks much for the help, this seems to be working now. Once I’ve set my settings, should I add back those lines, or leave them commented out?

    Thanks,
     Andrew

  44. Ah - you’re looking at the wrong file. The lines need to be removed from wp-to-twitter-manager.php, not wp-to-twitter.php.

  45. I appreciate the quick answer, but this doesn’t seem to be any better. Here’s what my editor thinks lines 145-190 are. There’s still a function declaration right in the middle.

    
    		return FALSE;
    		}
            }
    	}
    }
    
    // cURL query contributed by Thor Erik (http://thorerik.net)
    function getfilefromurl($url) {
    	$ch = curl_init();
    	curl_setopt( $ch, CURLOPT_HEADER, 0 );
    	curl_setopt( $ch, CURLOPT_VERBOSE, 0 );
    	curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
    	curl_setopt( $ch, CURLOPT_URL, $url );
    	$output = curl_exec( $ch );
    	curl_close( $ch );
    	return $output;
    }
    
    function jd_truncate_tweet( $sentence, $thisposttitle, $thisblogtitle, $authID=FALSE ) {
    
    if ( get_usermeta( $authID, 'wp-to-twitter-enable-user' ) == 'userAtTwitter' ) {
    $at_append = "@" . get_option('twitterlogin');
    } else if ( get_usermeta( $authID, 'wp-to-twitter-enable-user' ) == 'mainAtTwitter' ) {
    $at_append = "@" . get_usermeta( $authID, 'wp-to-twitter-user-username' );
    } else {
    $at_append = "";
    }
    	$sentence = $at_append . " " . $sentence;
    	if ( get_option( 'jd_twit_prepend' ) != "" ) {
    	$sentence = get_option( 'jd_twit_prepend' ) . " " . $sentence;
    	}
    	if ( get_option( 'jd_twit_append' ) != "" ) {
    	$sentence = $sentence . " " . get_option( 'jd_twit_append' );
    	}
    
    	$twit_length = strlen( $sentence );
    	$title_length = strlen( $thisposttitle );
    	$blog_length = strlen( $thisblogtitle );
    	if ( ( ( $twit_length + $title_length ) -  7 ) < 140 ) {
    	$sentence = str_replace( '#title#', $thisposttitle, $sentence );
    	$twit_length = strlen( $sentence );
    	} else {
    	$thisposttitle = substr( $thisposttitle, 0, ( 140- ( $twit_length-3 ) ) ) . "...";
    	$sentence = str_replace ( '#title#', $thisposttitle, $sentence );
    	$twit_length = strlen( $sentence );
    	}
    
    
  46. Nope! Thanks - the line numbers changed with the new version, and I didn’t catch that. It’s now line numbers 145-190.

  47. Is the FAQ answer about not seeing the settings page correct? The lines you indicate seem to include the bottom of one function and the top of another - removing them will eliminate the 2nd function and merge part of it with the first. Is this really what you’re recommending we do?

    Thanks,
     Andrew

  48. Yes, I’m aware of that - it’s next in line for treatment.