{"id":737,"date":"2025-06-20T07:54:04","date_gmt":"2025-06-19T23:54:04","guid":{"rendered":"http:\/\/www.zhake.net\/?p=737"},"modified":"2025-06-20T07:54:04","modified_gmt":"2025-06-19T23:54:04","slug":"random-post-plugin-redirect-url-to-post","status":"publish","type":"post","link":"http:\/\/www.zhake.net\/?p=737","title":{"rendered":"Random Post Plugin \u2013 Redirect URL to Post"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Redirect your visitors to<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a random post<\/li>\n\n\n\n<li>your last (latest) post<\/li>\n\n\n\n<li>your first (oldest) post<\/li>\n\n\n\n<li>the previous or next post<\/li>\n\n\n\n<li>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.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/chattymango.com\/redirect-url-to-post\/?pk_campaign=rutp&amp;pk_kwd=readme\">Features<\/a>&nbsp;|&nbsp;<a href=\"https:\/\/documentation.chattymango.com\/documentation\/redirect-url-to-post\/getting-started-redirect-url-to-post\/examples-wordpress-redirects-to-posts\/?pk_campaign=rutp&amp;pk_kwd=readme\">Examples<\/a>&nbsp;|&nbsp;<a href=\"https:\/\/documentation.chattymango.com\/documentation\/redirect-url-to-post\/?pk_campaign=rutp&amp;pk_kwd=readme\">Documentation<\/a>&nbsp;|&nbsp;<a href=\"https:\/\/chattymango.com\/?redirect_to=latest&amp;cat=9&amp;pk_campaign=rutp&amp;pk_kwd=readme\">Latest Development Blog Post<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"KSny-1750377237129\"><strong>A magic URL takes you to the right post<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This plugin provides a URL (link) that takes you directly to a post in&nbsp;<strong>single-post view<\/strong>. This post is determined by the query parameter&nbsp;<strong>?redirect_to=<\/strong>&nbsp;and optional others.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Simply enter the URL of your WordPress site into your browser and add&nbsp;<strong>?redirect_to=\u2026<\/strong>&nbsp;to the end.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Possible values for&nbsp;<strong>redirect_to<\/strong>&nbsp;are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>last\u00a0or\u00a0<strong>latest<\/strong>\u00a0\u2013 The URL will redirect to the last (latest) post.<\/li>\n\n\n\n<li>first\u00a0or\u00a0<strong>oldest<\/strong>\u00a0\u2013 The URL will redirect to the first (oldest) post.<\/li>\n\n\n\n<li>random\u00a0\u2013 The URL will redirect to a random post.<\/li>\n\n\n\n<li>prev\u00a0or\u00a0<strong>previous<\/strong>\u00a0\u2013 The URL will redirect to the previous post (by date).<\/li>\n\n\n\n<li>next\u00a0\u2013 The URL will redirect to the next post (by date).<\/li>\n\n\n\n<li>custom\u00a0\u2013 The post will be determined according to the mandatory parameter orderby and the optional parameter order.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You can also limit the scope of considered posts by additional filter parameters, such as&nbsp;<strong>&amp;s=searchaword<\/strong>&nbsp;or&nbsp;<strong>&amp;cat=2<\/strong>, or use an&nbsp;<strong>offset<\/strong>&nbsp;to go to the second latest or to the post before the previous. The parameter&nbsp;<strong>random<\/strong>&nbsp;combined with&nbsp;<strong>count<\/strong>&nbsp;and&nbsp;<strong>bias<\/strong>&nbsp;lets you pick the latest (or oldest) posts with a different probability than the rest.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"5Sty-1750377237153\"><strong>Caching<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The plugin offers&nbsp;<a href=\"https:\/\/documentation.chattymango.com\/documentation\/redirect-url-to-post\/getting-started-redirect-url-to-post\/other-parameters\/?pk_campaign=rutp&amp;pk_kwd=readme#Caching\">caching of database results<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"p4He-1750377237160\"><strong>Settings and Parameters<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">There is no settings page in the backend. You configure the plugin entirely through the query parameters in the URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please find more information about parameters and troubleshooting&nbsp;<a href=\"https:\/\/documentation.chattymango.com\/documentation\/redirect-url-to-post\/?pk_campaign=rutp&amp;pk_kwd=readme\">on the plugin website<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"TGdY-1750377237169\"><strong>Examples for URLs<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Note: Replace \u201c<a href=\"http:\/\/www.example.com\/\">http:\/\/www.example.com\/<\/a>\u201d with your own website location. Spaces are written as \u201c%20\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=latest\">http:\/\/www.example.com\/?redirect_to=latest<\/a> \u2013&nbsp;<strong>redirects to the latest post<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=random&amp;pk_campaign=random\">http:\/\/www.example.com\/?redirect_to=random&amp;pk_campaign=random<\/a> \u2013&nbsp;<strong>redirects to a random post and tracks the visit<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=prev\">http:\/\/www.example.com\/?redirect_to=prev<\/a> \u2013&nbsp;<strong>redirects to the previous post<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=random&amp;each_once=rewind\">http:\/\/www.example.com\/?redirect_to=random&amp;each_once=rewind<\/a> \u2013&nbsp;<strong>redirects to a random post, avoiding duplicates, and then starts over again<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=prev&amp;offset=1\">http:\/\/www.example.com\/?redirect_to=prev&amp;offset=1<\/a> \u2013&nbsp;<strong>redirects to the post before the previous post<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=random&amp;count=10\">http:\/\/www.example.com\/?redirect_to=random&amp;count=10<\/a> \u2013&nbsp;<strong>redirects to a random post among the 10 latest posts<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=random&amp;count=10&amp;bias=80\">http:\/\/www.example.com\/?redirect_to=random&amp;count=10&amp;bias=80<\/a> \u2013&nbsp;<strong>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%<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=random&amp;count=10&amp;offset=1\">http:\/\/www.example.com\/?redirect_to=random&amp;count=10&amp;offset=1<\/a> \u2013&nbsp;<strong>redirects to a random post among the 10 posts that come after the latest<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=random&amp;after=1%20month%20ago\">http:\/\/www.example.com\/?redirect_to=random&amp;after=1%20month%20ago<\/a> \u2013&nbsp;<strong>redirects to a random post among the posts that are not older than 1 month<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=latest&amp;exclude=4,7\">http:\/\/www.example.com\/?redirect_to=latest&amp;exclude=4,7<\/a> \u2013&nbsp;<strong>redirects to the latest post, excluding the posts with the IDs 4 and 7<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=latest&amp;offset=1\">http:\/\/www.example.com\/?redirect_to=latest&amp;offset=1<\/a> \u2013&nbsp;<strong>redirects to the second latest post<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=custom&amp;orderby=comment_count&amp;order=DESC\">http:\/\/www.example.com\/?redirect_to=custom&amp;orderby=comment_count&amp;order=DESC<\/a> \u2013&nbsp;<strong>redirects to the post with the most comments<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.example.com\/?redirect_to=latest&amp;s=iaido&amp;default_redirect_to=12&amp;cache=200\">http:\/\/www.example.com\/?redirect_to=latest&amp;s=iaido&amp;default_redirect_to=12&amp;cache=200<\/a> \u2013&nbsp;<strong>redirects to the latest post that contains the word \u2018iaido\u2019 or, if nothing can be found, to the page or post with the ID 12; use a cache with a 200 second lifetime<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2lCi-1750377237242\"><strong>Button<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The plugin also provides a shortcode [redirect_to_post_button] to create a simple button. Some&nbsp;<a href=\"https:\/\/documentation.chattymango.com\/documentation\/redirect-url-to-post\/getting-started-redirect-url-to-post\/redirect-button\/?pk_campaign=rutp&amp;pk_kwd=readme#Shortcode_to_create_button\">parameters<\/a>&nbsp;are available.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A button that links to a random post is a great way to increase your visitors\u2019 on-site engagement and therefore your&nbsp;<strong>SEO ranking<\/strong>!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(video by WPBeginner)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>If you find this plugin useful, please give it a&nbsp;<\/strong><strong>5-star rating<\/strong><strong>. Thank you!<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Follow us on&nbsp;<a href=\"https:\/\/www.facebook.com\/chattymango\/\">Facebook<\/a>&nbsp;or&nbsp;<a href=\"https:\/\/twitter.com\/ChattyMango\">Twitter<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"aE7F-1750377237266\"><strong>Check out my other plugins<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tag Groups<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">via: <a href=\"https:\/\/cn.wordpress.org\/plugins\/redirect-url-to-post\/\">https:\/\/cn.wordpress.org\/plugins\/redirect-url-to-post\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2024\u5e741\u670829\u65e520:34:41<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Redirect your visitors to Features&nbsp;|&nbsp;Examples [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-737","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"http:\/\/www.zhake.net\/index.php?rest_route=\/wp\/v2\/posts\/737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zhake.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zhake.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zhake.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zhake.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=737"}],"version-history":[{"count":1,"href":"http:\/\/www.zhake.net\/index.php?rest_route=\/wp\/v2\/posts\/737\/revisions"}],"predecessor-version":[{"id":738,"href":"http:\/\/www.zhake.net\/index.php?rest_route=\/wp\/v2\/posts\/737\/revisions\/738"}],"wp:attachment":[{"href":"http:\/\/www.zhake.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zhake.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=737"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zhake.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}