Matt's Blog

DisAllow Indexing for “Random Post” Links

May 31st, 2007 at 6:21 PM (18 years ago) by Matt Freedman

For those of you who use Matt Mullenweg‘s Random Redirect Plugin, this post will be useful for you.

If you’re not familiar with the Plugin, it will redirect you to a random post when you visit /?random.

I was searching Google with the top search terms to my Blog, and I noticed that for one of them, Google had the URL of the result as http://mattsblog.ca/
?random
. Which isn’t exactly going to be helpful, since the person who clicks on that result is probably not going to get the same Post that Google had gotten when they crawled the page.

So, how do you prevent this from happening? Simple, you tell bots not to index /?random. You can just add this to your robots.txt file:

User-Agent: *
Disallow: /?random

That’ll tell all the Bots that crawl your site (or, at least, the ones that follow the robots.txt standard) not to index /?random. Or, if you don’t want to do that, you can just add the following to your link for the Random Redirect:

rel="nofollow"

Now, hopefully those links to http://mattsblog.ca/?random will disappear out of search engines fairly quickly. 😀

Oh, and by the way, you can get a Random Post by clicking here.

Leave a Reply

Quote selected text

Leave the following field empty: