Search by

peterwilsoncc / random-post-redirect

peterwilsoncc

Random Post Redirect.

Package info

github.com/peterwilsoncc/random-post-redirect

Type:wordpress-plugin

pkg:composer/peterwilsoncc/random-post-redirect

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-09-24 23:29 UTC

This package is auto-updated.

Last update: 2026-09-25 23:49:15 UTC


README

Plugin land proof of concept for WP #64498.

Implemented

  • ?random Query variable
  • Redirect requests use the main WP_Query
  • Redirects added using the wp_headers filter (with filters from wp_safe_redirect() etc)
  • Exits on the send_headers actions to avoid rendering the full page

Todo

  • Decide whether parse_request or pre_get_posts should be used for setting query variables
  • Proper rewrite rule, either /random/suffix or /prefix/random -- Jorbin has suggested the former -- for blog, term, post type archives
  • Decide if same is needed for date archives
  • Tests beyond just the plugin meta data tests.

Known issues

  • Currently accepts ?random on all URLS, including is_singular() which redirects to itself

Install

composer require peterwilsoncc/random-post-redirect

Yolo install

composer require peterwilsoncc/random-post-redirect:dev-main

Demo (Yolo install, auto updates from main twice weekly, 5 4 * * 1,4)