Redirect URL to Post

Redirect URL to Post, Version 0.10: Random From a Subsample

Choices - street sign

This version of the free WordPress plugin Redirect URL to Post comes with a new feature: Until now, the parameter random always picked one out of the entire pool of posts (that match the search criteria). Now you can pick a random post from a subsample.

The new parameter count lets you limit the pool of posts to the most recent (count has positive number) or oldest (count has negative number) posts.


Here we redirect to a random post among the most recent 20 posts.

The value can also be negative, which means that we count from the opposite side, starting from the oldest posts.

The parameter count can be used together with offset so that you omit some of the posts at the beginning or the end.

Now we omit the oldest 5 posts and pick a random item from the next 10 oldest posts.

Other Changes

  • I changed the default duration of the cache to 60 seconds. Many users don’t seem to be aware of the existence of caching, so it made sense to turn it on by default. You can still override it with “cache=0”.
  • Random posts are now always determined by PHP, not through the database query. This simplified parts of the code and also shifted the burden from the database to the PHP engine.

Install the plugin from the administration of your site or download it from

Photo by keepitsurreal´╗┐

Check Out My Plugins:

Organize your tags in coherent groups and tidy up your tag cloud! Display your tags under tabs or in an accordion.

You will never want to go back to the times when your tags were all over the place.


Supercharge your tags! Tag your posts on two levels with tag groups. Filter your posts on the frontend. Let your visitors search in real time by tags and groups.

Go directly to your first, latest or a random post just by adding some magic words to your site's URL. Search posts by author, or category, or something else. Or combine a time frame with search parameters.


One thought on “Redirect URL to Post, Version 0.10: Random From a Subsample

Leave a Reply

Your email address will not be published. Required fields are marked *