We'll create fresh WordPress site with Random Post Plugin – Redirect URL to Post installed. You have 20 minutes to test the plugin after that site we'll be deleted.
Redirect your visitors to
Features | Examples | Documentation | Latest Development Blog 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:
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.
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.
Note: Replace “http://www.example.com/” with your own website location. Spaces are written as “%20”.
http://www.example.com/?redirect_to=latest – redirects to the latest post
http://www.example.com/?redirect_to=random&pk_campaign=random – redirects to a random post and tracks the visit
http://www.example.com/?redirect_to=prev – redirects to the previous post
http://www.example.com/?redirect_to=random&each_once=rewind – redirects to a random post, avoiding duplicates, and then starts over again
http://www.example.com/?redirect_to=prev&offset=1 – redirects to the post before the previous post
http://www.example.com/?redirect_to=random&count=10 – redirects to a random post among the 10 latest posts
http://www.example.com/?redirect_to=random&count=10&bias=80 – 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%
http://www.example.com/?redirect_to=random&count=10&offset=1 – redirects to a random post among the 10 posts that come after the latest
http://www.example.com/?redirect_to=random&after=1%20month%20ago – redirects to a random post among the posts that are not older than 1 month
http://www.example.com/?redirect_to=latest&exclude=4,7 – redirects to the latest post, excluding the posts with the IDs 4 and 7
http://www.example.com/?redirect_to=latest&offset=1 – redirects to the second latest post
http://www.example.com/?redirect_to=custom&orderby=comment_count&order=DESC – redirects to the post with the most comments
http://www.example.com/?redirect_to=latest&s=iaido&default_redirect_to=12&cache=200 – 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!