How to Use URL Shorteners to Send Blog Posts to Twitter

Question: How do I create a twitter icon/link that readers can use to promote my blog posts, scrunch up the URL of the blog post so it fits appropriately within the 140 character limitation of twitter, and send it to twitter when someone click on the icon/link?

Answer: Use a TweetMeme button plugin by installing the WordPress plugin.

Well, that’s one way.  Another way is to use a couple WordPress plugins (assuming you’re using WordPress as your blog platform) to customize how you want to tweet blog posts to twitter.

The purpose of this article then is to show you how to shrink a URL using a URL shortener before sending it to twitter.  If you don’t shrink a URL, it could very well go over the 140 characters per tweet limit.

What you’ll need:

  1. Browse over to the WordPress Plugin Directory and download the Simple Twitter Link plugin.
  2. While there, you’ll need to download the Simple URL Shortener plugin.
  3. Both plugin folders need to be uploaded to your wp-content/plugins folder.
  4. Make sure the settings for the cache folder under the Simple URL Shortener folder is set to 0777.  You can do this using your FTP client software.
  5. Activate both plugins using the WordPress plugins screen.

Note: There are no options screen for these plugins.  You’ll use them via code.  Even though this example shows the use of the Simple Twitter Link plugin, that plugin calls the Simple URL Shortener.

Here’s the code:

<a href=”<?php simple_twitter_link(‘%bit.ly%Reading “%title%” – %url%’); ?”>Send to Twitter</a>

The above code is used in the Thesis Theme custom_functions.php file.  It is something like the code I use for the twitter button at the end of this post.

There are other ways to use these two plugins.  Check out the links above and discover how you can format them.

Also, you don’t have to just use bit.ly as your URL shortener.  Many other URL shorteners are available for you to use.  See the Simple URL Shortener plugins descripition page for more URL shorteners.

If everything is aligned after you install the plugins, then the above code should work for you.

However, if you’re using PHP in your blog posts, blog pages and text widgets, you’ll need to download and install one extra plugin called Exec-PHP.  Exec-PHP allows you to run PHP syntax in your posts, pages and text widgets.

If you like this article, please try tweeting this blog post using the twitter button below to try out what this article is about.  Also, if you’d like a couple ways I’m using twitter, please subscribe to my newsletter and you’ll receive that free right away.

Get Free Email Updates

{ 2 comments… read them below or add one }

TamahomeJenkins November 30, 2009 at 10:35 pm

I personally use the su.pr plugin. It uses the Stumbleupon URL shortener and adds the stumblebar at the top so people can RT, stumble, and share on Facebook.

Reply

TamahomeJenkins December 1, 2009 at 4:35 am

I personally use the su.pr plugin. It uses the Stumbleupon URL shortener and adds the stumblebar at the top so people can RT, stumble, and share on Facebook.

Reply

Leave a Comment

Comment Policy: Please leave the best comment you can. Comments like, "Hey Nice Post" or comments that have been automated and make no sense will be deleted. Feel free to argue when necessary, but no name calling. I appreciate it and others will too.

CommentLuv badge

Previous post:

Next post: