404 monitor and redirects
How the monitor works
OSeo_404_Monitor::maybe_log() runs on template_redirect for any 404 response. Each unique URL gets one row in the log table; subsequent hits increment a counter. The log records first hit, last hit, hit count, referrer, and user agent.
Filters:
oseo_404_monitor_enabledoption (default1) toggles the engineoseo_filter_botsoption (default0) drops requests where the user agent matches a bot patternoseo_spike_thresholdoption (default50) triggers an admin notice when one URL is hit that many times in 24 hours
Weekly cleanup is oseo_prune_404s - registered on activation, runs through the WP cron at the weekly schedule.
Promoting a 404 to a redirect
On the 404 Monitor screen, click Promote next to any row. The action oseo_promote_404 opens the redirect form with the source URL pre-filled.
Other row actions:
- Ignore - sets a flag so the URL never logs again (
oseo_ignore_404) - Delete - removes the row
- Export CSV -
OSeo_404_Monitor::stream_csv_export()streams the whole log
Redirects
Managed under Redirects. Each entry has:
source- request URL or regexdestination- target URLtype- 301, 302, 307, or 308 (default 301)enabledflag
CSV import
source,destination,type
/old-page,/new-page,301
/blog/old,/journal/new,302OSeo_Redirects::import_csv( $csv_content ) parses the file, validates each row, and returns counts of imported, skipped, and failed rows.
Loop protection
OSeo_Redirects::check_loop( $source, $destination ) walks the redirect chain before saving so you cannot create a self-referencing loop.

