WordPress 7.2 ships on 8 December, and it adds a public address most site owners never asked for: /random/. Visit it and WordPress sends the visitor to a randomly selected published post with a 302 redirect. The feature is on by default, and there is no checkbox anywhere in the dashboard to turn it off.
On a normal blog that is harmless, even pleasant. On a small business site it can surface content you built for layout rather than reading. On any site behind a page cache it can return a 404 for a while after the update. Turning it off takes one small file, but only if you decide before the release lands.
The short version
/random/redirects to a random post. So do/random/category/{slug}/,/random/tag/{slug}/,/random/author/{slug}/and/random/{post-type}/.- Posts are eligible. Pages and attachments are not.
- A custom post type is eligible when it is publicly queryable and has an archive, unless it was registered with
'randomable' => false. A shop archive makes WooCommerce products eligible. - The redirect is a 302 with
X-Robots-Tag: noindex, followand no-cache headers, so the redirect address itself should stay out of search results. - There is no settings toggle. The only supported off switch is a filter called
wp_enable_random_content_redirect.
What the endpoint actually does
The implementation is small. WordPress registers a rewrite rule, runs the main query for whatever archive you asked for, swaps the sort for ORDER BY RAND(), limits the result to one row, and redirects to that permalink. If the query matches nothing — an empty category, a misspelled tag — you get a 404.
The base is not fixed. A new field on Settings → Permalinks lets you rename random, and the code also answers a ?random query variable on the home page and archives — handy for testing without touching rewrite rules.
Two edge cases: if you already publish a page with the slug random, that page wins and the feature does nothing; and a search URL carrying the parameter now redirects to the same search without it.
Where it can bite a small site
Custom post types built for layout. Testimonials, client logos, staff bios and case studies are often registered as public post types with an archive because that is the easiest way to get a template and a query. Most owners then leave them out of the navigation. From 8 December, those entries become reachable through /random/testimonial/ and its variants, and an SEO plugin’s noindex setting on that post type does not make the endpoint forget it exists. The developer-note comments raised exactly this case.
The cache after the upgrade. New rewrite rules have to be flushed before /random/ resolves. Core does that on the first wp-admin request after the upgrade, per site on multisite. On a host with a page cache or CDN, a cached 404 can outlive the flush until you purge. The hosting team’s own note says to purge the page cache after that first admin visit. Skip those two steps and you will spend an evening debugging a feature you did not want.
A ten-minute check you can run today
Put 7.2 on a staging copy, or run these three checks the morning you update.
- Request
/random/and read the response headers. You want a 302,x-robots-tag: noindex, follow, and no-cache headers. A 404 means rewrite rules have not been flushed or a cached 404 is still being served. - Request one archive version, for example
/random/category/news/, and confirm it lands on a post inside that category. - List the post types that qualify. This snippet prints every publicly queryable type with an archive; run it with
wp eval-file types.phpon staging.
<?php
foreach ( get_post_types( array( 'publicly_queryable' => true ), 'objects' ) as $type ) {
if ( ! empty( $type->has_archive ) ) {
echo $type->name . PHP_EOL;
}
}
Compare that list against what you want a stranger to land on. If it includes product, you have a decision about the shop; if a testimonial or staff type appears, a decision about that too.
Turning it off properly
The off switch is a filter, and the safest place for it is an mu-plugin, which loads before regular plugins and cannot be deactivated by accident. Create wp-content/mu-plugins/disable-random-redirect.php — the folder may not exist yet — and put this inside:
<?php
/*
Plugin Name: Disable Random Redirect
Description: Turns off the WordPress 7.2 random content redirects.
*/
add_filter( 'wp_enable_random_content_redirect', '__return_false' );
Then flush rewrite rules once. Open Settings → Permalinks and click Save Changes, or run wp rewrite flush. The filter hides the base field on the Permalinks screen, stops the rewrite rules from being generated, and makes WordPress ignore the query variable.
One trap: the WordPress Developer Blog’s November roundup prints the filter as wp_enable_random_content_direct, missing the “re”. That name appears nowhere in the code, so copying it from the roundup produces a file that does nothing and no error either. Use the spelling from the developer note: wp_enable_random_content_redirect.
If you would rather not touch code, a small plugin called Disable Random Content does the same thing through that filter and refreshes rewrite rules on activation, including on multisite.
Keeping it, but narrowing it
If you own the register_post_type() call for a testimonial or portfolio type, add 'randomable' => false to its arguments and that type drops out while posts stay random. If the type comes from a plugin you do not maintain, you cannot add that argument from your theme — in that case the whole-site switch is the honest choice, or check whether the plugin has shipped its own setting by December.
Changing the base is the other middle path: /shuffle/ is less likely to collide with an existing page or be probed by a bot that guesses common paths.
The decision, in one table
| Check | Good result | What to do instead |
|---|---|---|
/random/ header |
302 plus noindex header | Visit wp-admin once, then purge cache |
| Public post types | Only post and product | Add 'randomable' => false or disable the feature |
Page slug random |
No such page | Decide which one you want to keep |
| Filter name | wp_enable_random_content_redirect |
Do not copy the roundup spelling |
| Cache and CDN | Purged after the first admin visit | Purge again and retest the header |
What it means for search and speed
The SEO worry is smaller than it sounds, as long as the headers behave. The redirect response is marked noindex, and the destination is a normal post URL that was already indexable, so you are not creating a second indexable copy of anything.
The speed cost is more concrete. Every /random/ hit is a cache miss by design, because the response carries no-cache headers and runs a random-order query. On a ten-post blog that is nothing; on a store with thousands of products, a crawler that finds the endpoint can generate real database work. If you keep the feature, tell your host.
On a handful of posts, /random/ costs nothing and gives visitors a discovery path you did not have to build. On a brochure site with five pages and one blog, it is noise. Neither answer is wrong; leaving it undecided is the only mistake.
What I would do before 8 December
Test 7.2 on a copy this week, run the three checks, and write the mu-plugin now. An unused mu-plugin on 7.1 does no harm and means the upgrade cannot surprise you. On release day, update during a quiet hour, load wp-admin once, purge the cache, and request /random/ to confirm the header. If you run a store, check whether products should be in the random pool before a customer finds them there first.
This is a small change with a public URL — the kind that ages badly when nobody owns the decision. Ten minutes now, or a support thread on 9 December. The schedule is on the 7.2 development page.
If you are still working through the core update itself, the sequence in how to update WordPress core without opening an attack window applies here too. And if the upgrade lands in the middle of the November core update, keep the two changes separate in your notes — the search-side picture is noisy enough without mixing in a rewrite change.









