Note: This plugin is provided for free. Particularly if you use it to make money or in a profit-making context, however, I would appreciate if you could make a donation. Thank you!
- Redirect to a random post
- Redirect to the latest post in the category “Software”
- Redirects to the oldest post, excluding the posts with the IDs 4, 7 and 35
- Redirect to the post with the highest comment count
- Redirect to the oldest post that contains the word “nishio”
- Redirect to a random post and track the visit
- Shortcode to create button
- Tip Jar
This WordPress plugin provides an URL that takes you directly to a single post, as specified by the query parameters. These parameters define how posts are sorted, and the URL will redirect to the post that would appear on top of the sorted list. While the URL remains unchanged, the destination of the redirection depends on the current post inventory.
Possible applications are:
- Promote your latest post with one permanent link. Readers won’t have to go through a list – the link will take them directly to the full-page post.
- Add a menu item that links to a random post.
- Load the latest post that contains a certain phrase into a frame of another website.
- Link to the latest post that was published in any January or in a particular category.
- Increase page views by displaying a button or menu to call random posts.
The plugin does not offer any settings in the admin back end.
Add the query parameter redirect_to to the URL of your blog. Values can be:
- last or latest – The URL will redirect1 to the latest post.
- first or oldest – The URL will redirect to the first (oldest) post.
- random – The URL will redirect to a random post.
- custom – The post will be determined according to the mandatory parameter orderby and the optional parameter order. Possible values for orderby are listed here. By default, order is “DESC” (descending – starting from the highest value, the later time or the bottom position in alphabetic order). Alternatively you can set it to “ASC” (ascending).
Obviously, the parameter “custom” lets you achieve the same as “latest”, “first” and “random”. These shortcuts exist just for convenience and readability.
You can combine them with other standard queries in order to limit the considered posts to a certain group. Supported are (according to superficial testing):
The default value of post_type is “post”.
You can also add a parameter default_redirect_to where you can specify a default destination if the other criteria returns an empty result. It accepts as value the id of a post or page. If this parameter is omitted or if the post or page with this id cannot be found, then the default destination is the home page.
Since version 0.5, you can also add parameters for tracking redirects in your statistics. Supported are Google Analytics (utm_source, utm_campaign and utm_medium) and Piwik (pk_campaign and pk_kwd).
Redirect to a random post
Redirect to the latest post in the category “Software”
Redirects to the oldest post, excluding the posts with the IDs 4, 7 and 35
Redirect to the post with the highest comment count
Redirect to the oldest post that contains the word “nishio”
Redirect to a random post and track the visit
Since Version 0.5, you can create a button with a shortcode. The syntax is:
Possible parameters are:
div_class: Class name used for the enclosing div.
button_class: Class name used for the button.
text: Button text. Default: “Random Post”
redirect_to: Sets the query parameter. Default: “random”
params: Additional parameters. Formatted as: “key1=>value1,key2=>value2, …”
You can, of course, create your own button, link or menu and just manually set the URL.
At the WordPress plugin repository.
If you have any question or problem, please proceed to the WordPress Support Forum.
Yes, this plugin is free but it takes much effort to maintain it. Please donate to this charity or below to the author: