| 开发者 |
kaggdesign
ernest35 |
|---|---|
| 更新时间 | 2026年12月4日 02:04 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/random/ URL.
WooCommerce and Multisite. Keep a random link for a selected WooCommerce product category. On Multisite, each site has its own archive selection.
Choose the archives you want to allow under Settings > Disable Random Content. For example, selecting Blog enables its random URL, such as /random/category/blog/.
You can activate the plugin on WordPress 7.1 ahead of the upgrade, either for one site or across a Multisite network. It starts controlling random redirects when the site runs WordPress 7.2 or later.
Start the Live Preview and click Open demo homepage to try both links. The setup guide covers installation and Multisite.
If the demo opens on an earlier WordPress version, open Site Settings in the Playground toolbar, select WordPress 7.2 or later, and click Apply to this Playground.
slug:disable-random-content in the keyword search field.wp plugin install disable-random-content --activate for a single site or wp plugin install disable-random-content --activate-network for a Multisite network.Activate Disable Random Content. It turns off the default /random/ URL, random redirects on archive URLs, and redirects triggered by the random query parameter. It uses the wp_enable_random_content_redirect filter and supports a custom Random base set in Settings > Permalinks, such as /shuffle/.
No. Unrelated queries that explicitly request random ordering are unaffected.
/random/ after activation?WordPress serves a published page or post that has /random/ as its permalink. If no other route handles the address, WordPress usually returns a 404.
No. It does not edit content or menus. Published content remains available at its usual URLs.
No. The plugin refreshes permalink rules when activated or deactivated on an individual site. Changing the allowed archives or the plugin's network activation clears the affected sites' saved rules, and WordPress rebuilds them on the next request. If a page cache or CDN keeps serving an earlier response after a change, clear the cached response for the affected URL and test again.
Yes. Activate the plugin across the network to disable the built-in random redirects on all sites. For a rollout to selected sites, activate it individually on each site. Each site can allow random links for its own archives.
Yes. In Settings > Disable Random Content, select just the category you want to allow. For example, selecting Blog enables /random/category/blog/ and /category/blog/?random. The site-wide /random/ stays disabled.
WordPress can pick posts from subcategories when choosing from a parent category. To enable a subcategory's own random link, select that subcategory separately. You can also allow links for specific tags and other eligible archives.
On a WooCommerce site, select only the Blog category to keep its random link and stop /random/shop/ from choosing a product. Visitors can browse the store at its usual shop and product URLs.
To keep a random link for one product category, select it under Product categories and leave the Products post type archive unselected. The selected category can open a random product while the shop and other categories continue to open as usual.
For a custom post type, select its archive under Post type archives. For example, with the default random base, allowing an eligible Projects archive with the slug projects enables /random/projects/ and /projects/?random=1. A post type appears in the list when it is publicly queryable, has an archive, and supports random selection in WordPress.
If a code snippet or another plugin disables random redirects across the site, turn off that snippet or setting. In Admin Optimizer, turn off Disable Random Content Redirect under Content Controls. In Admin and Site Enhancements (ASE), clear the random content redirect checkbox under Disable Components > Disable Smaller Components. Try the selected archive's random URL again. If the redirect is still missing, go to Settings > Permalinks and click Save Changes to rebuild the rewrite rules.
Jetpack 16.4 and the legacy WordPress.com handler can redirect /?random=1 separately from WordPress core. Test both /random/ and /?random=1 on your site after activating Disable Random Content.
Jetpack's update to use the WordPress core handler also applies the jetpack_random_redirect_enabled filter to core redirects. If a custom snippet returns false for that filter, review it when upgrading Jetpack. It can switch off random links for your selected archives too.
Deactivate the plugin to restore the core behavior. Other code on your site may still disable the feature.
The plugin makes no external requests and adds no tracking. Archive selections are stored in a WordPress option for the current site. WordPress rebuilds the site's permalink rules after changes to the selections.
/random/ routes after updating an active plugin. Version 1.3.3 clears saved rewrite rules once per site so WordPress can rebuild them using the site's existing archive selections.