14 Apr 2009, Posted by admin in Featured,Whitehat, 18 Comments
On the one hand, I love the Tweetmeme plugin for WordPress, I think it does an amazing job of letting your visitors easily retweet your blogpost. It looks really nice, it’s really easy to install and it even tracks the number of retweets you get. In short, it’s simple and effective. On the other hand though, I hate it. I really, really hate it. When people hit the retweet button, it doesn’t retweet me – it retweets @techmeme. I can’t style the button, I have to use theirs. And I really, really hate the fact that my links get retweeted with a bit.ly URL shortener. I’ve spoken before about how much I hate URL shorteners – they dilute your brand and can, for some of them, prevent link juice from reaching your site.
The RT @tweetmeme is pretty unneccessary. Tweetmeme are taking your content and attaching their brand name to it instead. This makes me sad.
The styling of the button annoys me because it doesn’t always fit into your theme. Sometimes you want your page to look how you want it to look, rather than have buttons tacked onto it, looking all green and out-of-place.
And the URL shortener is bad. If Google treats bit.ly in the same way as it treats TinyURL, then any links that get passed around because of @tweetmeme won’t give you any link juice. This is pretty much a crime.
But Here’s How To Fix All That
You can create your own URL shortener, exclusive to your blog. Easily, if you’re running WordPress at least. You’ll be able to have URLs that look like http://sharkseo.com/go/154. Check out the Twitter icon at the top of this post , see where that links to if you hit it.
For WordPress, create a folder within the root of your domain. Name it “go”, or something equally short. Then make a .htaccess file and include the following code:
RewriteRule ([0-9]+) /index.php?p=$1 [R=301,L]
RewriteRule (.*) / [R=301,L]
The easiest way to make that a .htaccess file is to post that code into notepad, save it as a .txt and then upload it to the “go” folder on your server. Then rename it to .htaccess. Windows sometimes has a bit of a tantrum if you try to change it on your machine locally.
This code basically says “Whenever the URL /go/ is accessed, and the file specified is numbered, add that to index.php?p=. If it’s not a number, go to the homepage.
Put that .htaccess file in your new /go folder.
To test that your 301s are working, open your WordPress admin panel, go to Manage > Posts and then hover over one of your posts. You should see in the small link-to box a post number.
An earlier examples of linkbait post, for example, is number 190. Try going to http://www.yourdomain.com/go/190 (or whichever number of you found). It should redirect you to the relevant post (like here). That redirect is a 301, by the way, so all the link juice will be passed to the right page when people link to that URL. Hat tip to planetmike.com for revealing this simple but awesome tip.
Next, you’ll want to create and style your own Twitter button so that, when it retweets, it retweets your Twitter name instead of @techmeme. The good news is, you can use any image or text to retweet, it’s just a link to Twitter.
To do this, go into your theme editor in WordPress, open up the single.php (or whichever file you’re using for your single post theme), find the button that you want to be your Twitter button, and add an a href code around it to make it a link to Twitter. Here’s the code for the link:
<a href=”http://twitter.com/home?status=RT @yourname <?php the_title(); ?> – <?php echo get_option(‘home’); ?>/go/<?php echo $post->ID ?>”></a>
The @yourname you obviously change to whatever your Twitter username is. The <?php the_title(); ?> is simply the title of the blog post. The <?php echo get_option(‘home’); ?> is the root domain of your blog, followed by the /go/ which is your new, personalised 301ing URL shortener. The <?php echo $post->ID?> is the number of your post, so it’ll complete the URL shortened link. That will give a result, for my previous TinyURL page, as a link that looks like http://twitter.com/home?status=RT @SharkSEO TinyURL Doesn’t Pass Value – http://sharkseo.com/go/154.
And there you have it, you get to keep your brand name instead of passing out Techmeme’s. If people want to follow you from retweets, it’s easier for them. More importantly, instead of risking losing your well deserved link authority, you’ll get it all going straight to your blog. Enjoy, and don’t forget to retweet this post
(Flickr image from jenteach123)