A random post — with a choice within an archive
With the default permalink structure, /random/ leads to a randomly selected published post. If an archive path is specified after the base, WordPress will select content from the corresponding group. For example, /random/category/release/ is intended to select a random post from the release category, while /random/author/jorbin/ selects a post by the specified author. Similar rules are created for publicly accessible taxonomies associated with eligible post types: /random/tag/dev-note/ is given as an example. This means the route can work both across the site and in the context of a specific archive.
Customizable base and supported post types
The word random in the URL is not a required, unchangeable part of the route. The default base is translatable and configurable in a new field on the Permalinks page in the WordPress admin panel. For custom post types, random selection availability will be determined by the randomable argument of the register_post_type() function. If the parameter is not set, it is enabled for types that are available for public queries and have an archive. Of the built-in types, regular posts are eligible for random selection; pages and attachments are not. For taxonomies, the rules apply when they are available for public queries and associated with an eligible post type.
How WordPress selects a post
The random result is generated by the main WordPress query. During this query, the system limits the selection to eligible posts, sets the sort order using RAND(), and returns one result row. This uses query handlers that are attached temporarily. Because selection goes through the main query, existing pre_get_posts handlers that modify archives will also affect random redirects. Developers have provided the wp_is_random_content_query() function, which can be used to identify such a query and configure selection separately for /random/ routes.
The feature can be disabled entirely
For sites that do not need random redirects, the wp_enable_random_content_redirect filter is available. Setting it to false prevents WordPress from creating random route rules, removes the base setting field from the Permalinks page, and causes the random query variable to be ignored. The developers’ post gives an example of using the filter in a site’s must-use plugin. This disables the feature site-wide rather than merely changing the result for a specific post type or archive.
The default-on setting sparks debate
The decision to enable the feature by default immediately drew objections from participants in the discussion. Their concerns include the possibility that content from custom post types that site owners did not intend to expose through this route could become accessible at random. This concern was raised in comments and was not presented as a confirmed vulnerability. The discussion also raises the question of load on large sites: RAND() sorting can be costly, and, in commenters’ view, frequent requests to /random/ from bots could create additional load. The discussion mentions work on optimization, but the post provides no specific performance figures.
Developers explain the decision by pointing to interest in content
Some participants believe the feature should have been released as a separate plugin or disabled by default. In response, the developers note that they do not add a separate toggle for every feature: too many settings would make the admin panel more complicated. They also believe that many site owners want readers to discover their published content. At the same time, those for whom the feature is unsuitable can still disable it entirely using the filter. The debate concerns not only the technical implementation, but also whether random navigation should be part of WordPress Core and enabled without additional configuration.