Redirect URL to Post

Redirect URL to Post | Chatty Mango


Redirect your visitors to

  • a random post
  • your last (latest) post
  • your first (oldest) post
  • the previous or next post
  • or a combination of conditions, for example a random post among your last 10 posts, or the latest post from at least 3 months ago, or the latest post of a specific author.

Features | Examples | Documentation | Latest Development Blog Post

A magic URL takes you to the right post

This plugin provides a URL (link) that takes you directly to a post in single-post view. This post is determined by the query parameter ?redirect_to= and optional others.

While the URL remains the same, its target changes depending on the available posts at the time when somebody enters it. That means you can use the same static URL in a menu, with a button or in a newsletter and the plugin finds out the correct target.

Simply enter the URL of your WordPress site into your browser and add ?redirect_to=… to the end.

Possible values for redirect_to are:

  • last or latest – The URL will redirect to the last (latest) post.
  • first or oldest – The URL will redirect to the first (oldest) post.
  • random – The URL will redirect to a random post.
  • prev or previous – The URL will redirect to the previous post (by date).
  • next – The URL will redirect to the next post (by date).
  • custom – The post will be determined according to the mandatory parameter orderby and the optional parameter order.

You can also limit the scope of considered posts by additional filter parameters, such as &s=searchaword or &cat=2, or use an offset to go to the second latest or to the post before the previous. The parameter random combined with count and bias lets you pick the latest (or oldest) posts with a different probability than the rest.


The plugin offers caching of database results.

Settings and Parameters

There is no settings page in the backend. You configure the plugin entirely through the query parameters in the URL.

Please find more information about parameters and troubleshooting on the plugin website.

Examples for URLs

Note: Replace “” with your own website location. Spaces are written as “%20”. – redirects to the latest post – redirects to a random post and tracks the visit – redirects to the previous post – redirects to a random post, avoiding duplicates, and then starts over again – redirects to the post before the previous post – redirects to a random post among the 10 latest posts – redirects to a random post. The plugin picks one from the latest 10 with a probability of 80% and from the rest with a probability of 20% – redirects to a random post among the 10 posts that come after the latest – redirects to a random post among the posts that are not older than 1 month,7 – redirects to the latest post, excluding the posts with the IDs 4 and 7 – redirects to the second latest post – redirects to the post with the most comments – redirects to the latest post that contains the word ‘iaido’ or, if nothing can be found, to the page or post with the ID 12; use a cache with a 200 second lifetime


The plugin also provides a shortcode [redirect_to_post_button] to create a simple button. Some parameters are available.

A button that links to a random post is a great way to increase your visitors’ on-site engagement and therefore your SEO ranking!

(video by WPBeginner)

If you find this plugin useful, please give it a 5-star rating. Thank you!

Follow us on Facebook or Twitter.

Check out my other plugins


  1. Find the plugin in the list at the admin backend and click to install it. Or, upload the ZIP file through the admin backend. Or, upload the unzipped redirect-url-to-post folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.

After the first activation you will find a screen with some examples of URLs for your blog.

Plugin author

Chatty Mango

Plugin official website address
If you encounter problems in using the Redirect URL to Post plugin, you can comment below, and I will try my best to help you solve the problem

Leave a Comment

Your email address will not be published.