WordPress 7.2 adds a /random/ route that opens a random post
Visiting example.com/random/ will send users to a randomly chosen published post. The feature is on by default and built on the rewrite, WP and WP_Query APIs, so check it does not clash with existing pages or custom routes using that URL.