WordPress 7.2 Adds a /random/ URL to Every Site. We Tested What It Does

Featured card: WordPress 7.2 adds a /random/ URL

Tested on WordPress 7.2 Beta 4 on 6 November 2026. This is beta code, so details could still change before the final release on 8 December. We’ll update this post if they do.

WordPress 7.2 adds a new address to every site: example.com/random/. Visit it and you’re sent to a randomly chosen published post. It’s on by default, so if you update in December, your site gets it whether you asked or not. Short verdict: for most blogs it’s a harmless little toy with sensible defaults. If you run a big site (tens of thousands of posts), it’s worth a second look, because every hit runs a database query that can’t be cached.

The official announcement explains what the feature does. It doesn’t say what status code it sends, how it plays with caches, what Google sees, what happens if you already have a page called “random”, or what it costs your database. So we tested all of that.

What the /random/ URL does

It’s built on the same plumbing as the rest of WordPress (rewrite rules, WP and WP_Query), tracked in Trac ticket #64498. Besides the plain version, you get narrower ones:

URL Sends you to
/random/ Any random published post
/random/category/{slug}/ A random post in that category
/random/tag/{slug}/ A random post with that tag (other public taxonomies work too)
/random/author/{username}/ A random post by that author
/random/{post-type-slug}/ A random item of that post type

A few details from the announcement:

  • The word “random” is translatable and you can change it under Settings > Permalinks (it’s stored in the wp_random_base option). On a non-English site the URL may not be /random/ at all, so check that screen.
  • Post types get a new randomable argument in register_post_type(). It defaults to true when the type is publicly queryable and has an archive. Normal posts are in. Pages and attachments are out.
  • Developers can adjust the query with wp_is_random_content_query( $query ) inside pre_get_posts.

It’s one of the smaller items in 7.2. For the rest of the release, see our WordPress 7.2 overview.

What we saw when we hit it

Our test site: 7.2 Beta 4, PHP 8.4, MySQL 8.0, Twenty Twenty-Five, pretty permalinks set to /%postname%/. Here’s what came back.

Request Response Notes
/random/ 302 Found To a random post. Three hits in a row gave three different posts
/random/category/uncategorized/ 302 Found To a random post in that category
/?random=1 (pretty permalinks) 302 Found Works because random is a public query var
/random/ (plain permalinks) 200, home page The pretty URL does nothing without pretty permalinks
/?random=1 (plain permalinks) 302 Found To a ?p=N URL. Adding &category_name=uncategorized works too
/random/page/, /random/nope/ 404 With no-cache headers
Archive with no eligible post 404

And the headers on the redirect itself:

  • Cache-Control: no-cache, must-revalidate, max-age=0, no-store, private
  • Expires: Wed, 11 Jan 1984 05:00:00 GMT (that’s WordPress’ usual nocache_headers())
  • X-Robots-Tag: noindex, follow

Those are good defaults. A 302 is a temporary redirect, which is honest: the destination changes every time. no-store means a page cache or CDN shouldn’t keep a copy (if it did, everyone would get the same “random” post until the cache expired). And noindex, follow tells search engines not to index /random/ itself, while still letting them follow through to the post.

Core doesn’t touch robots.txt (the virtual one has no /random/ line), and /random/ isn’t in wp-sitemap.xml.

Which posts can it pick? Only published ones without a password. We created a private post and it never came up. Sticky posts get no special treatment either.

Slug clashes: what if you already have /random/?

Some sites already have a page at /random/. Maybe it’s a “random thoughts” page, maybe an old random-post plugin. We published a page called “Random” (slug random) to see who wins.

Your page wins. /random/ served our page with a 200. But /random/category/uncategorized/ and /random/author/<user>/ still redirected. So /random/ itself stays yours, but the deeper random URLs still go live under it.

Core does the same for a published post at that address when your permalink structure is /%postname%/. It also flushes rewrite rules on its own when such a page or post is published, renamed, moved or deleted, so you don’t have to.

Performance: what ORDER BY RAND() costs

This is the part we cared about most. The random pick is a plain ORDER BY RAND() LIMIT 1. MySQL’s EXPLAIN shows it uses the type_status_date index, then “Using temporary; Using filesort” across every matching row. In other words, to pick one post it shuffles all of them.

We filled the test site with posts and timed the SQL alone (median of 9 runs, 12-core dev machine, MySQL 8.0.42), next to a normal “latest post” query:

Published posts Random pick “Latest post” query
23,774 25.0 ms 0.4 ms
48,142 47.6 ms 0.5 ms
96,284 90.9 ms 0.4 ms

Roughly linear: about 1 ms per 1,000 posts on that box. The full HTTP round trip at 96k posts was 108 ms for /random/ against 77 ms for a single post page. That was PHP’s built-in dev server, so treat the absolute numbers as a rough guide only.

For a blog with a few hundred posts, nobody will ever notice. The catch is the no-store header we praised a minute ago. Because the redirect can’t be cached, every single hit runs that query. On a big site, a bot hitting /random/ over and over is a cheap way to make your database sweat. Bots already crawl more than most people think (we looked at AI bots on WordPress sites here). If you have tens of thousands of posts, we’d consider rate-limiting /random/ at your CDN or firewall, or just turning it off.

How to turn it off properly

Core suggests a one-line filter in a must-use plugin. Create wp-content/mu-plugins/disable-random-url.php:

<?php
/**
 * Plugin Name: Disable /random/ URL
 */
add_filter( 'wp_enable_random_content_redirect', '__return_false' );

With that in place, WordPress adds no random rewrite rules, hides the base field on the Permalinks screen and ignores the query var.

Now the gotcha we walked straight into. You have to flush rewrite rules afterwards. Go to Settings > Permalinks and click Save without changing anything, or run:

wp rewrite flush

Before we flushed, /random/ served the home page with a 200. The old rule still matched, but the query var was now ignored, so WordPress fell back to the front page. That’s a soft duplicate of your home page sitting at a new URL. After the flush, /random/ and /random/category/... both returned 404, which is what you want.

One leftover: /?random=1 then just shows the home page with a 200, because the var is ignored. Nothing links there, so we wouldn’t lose sleep over it.

Our SEO take (opinion)

This section is our opinion, not something we measured.

  • Mostly harmless. 302 plus noindex plus no-store is about as safe as a redirect URL gets. Google will see /random/ if anything links to it, and the noindex keeps it out of results.
  • It’s not an SEO feature. Don’t put it in your menu expecting a ranking boost. It’s a discovery toy for humans. A crawler following it lands on some arbitrary post each time, which tells it nothing useful.
  • Probably don’t block it in robots.txt. If a URL is blocked there, search engines don’t fetch it, so they never see the noindex header. Leaving it crawlable lets the header do its job.
  • Watch for doubles. If a plugin already gives you a “random post” link, you may now have two.

Should you keep it?

Small or mid-size blog, and you like the idea? Keep it. Maybe link it from your footer as “surprise me”. That’s what it’s for.

Large site, tight hosting, or you just don’t want surprise URLs? Turn it off with the snippet above, and remember the flush.

Either way, chance isn’t a strategy for getting old posts read. /random/ is discovery by luck. Links inside your content are discovery on purpose: readers and crawlers reach older posts because you pointed them there. If that’s new to you, here’s how automatic links between posts work.

Quick checklist before 8 December

  1. Visit /random/ on a staging copy running the beta. Note what happens.
  2. Check Settings > Permalinks for the random base, especially on a non-English site.
  3. Look for an existing page or post with the slug random. It wins, but /random/category/... still goes live.
  4. Count your published posts. Tens of thousands? Think about rate-limiting or disabling.
  5. If you disable it, flush rewrite rules, then confirm /random/ returns 404.
  6. Check whether a plugin already offers random-post links.

Frequently asked questions

Is the /random/ URL on by default in WordPress 7.2?

Yes. Every site gets it after updating to 7.2, unless something turns it off with the wp_enable_random_content_redirect filter. The final release is due on 8 December.

Is /random/ bad for SEO?

In our opinion, no. It sends a 302 temporary redirect with no-store cache headers and an X-Robots-Tag of noindex, follow, so search engines are told not to index it. It just won’t help your rankings either.

I added the filter but /random/ still loads my home page. Why?

The old rewrite rule is still stored. Go to Settings > Permalinks and click Save, or run wp rewrite flush. After the flush, /random/ returns a 404.