Manage Redirects and 404s
Manage 301, 302, 307, and 308 redirects with hit tracking, CSV import, and a bounded 404 log.
Overview
The Redirect Manager provides a simple interface for managing 301 and 302 redirects without bloating your database. All redirects are stored in a single JSON file.
Architecture
wp-content/
└── functionalities/
└── redirects.json # All redirects stored here
Features
| Feature | Description |
|---|---|
| Hit Tracking | Real-time counter for each redirect usage |
| File-Based Storage | High-performance JSON file (cached with transients) |
| Wildcard Support | Use * suffix for path prefix matching |
| Multiple Types | Supports 301, 302, 307, and 308 redirects |
| Enable/Disable | Temporarily disable without deleting |
Redirect Types
| Code | Type | Use Case |
|---|---|---|
| 301 | Permanent | Page permanently moved (passes SEO value) |
| 302 | Temporary | Temporary redirect |
| 307 | Temporary Redirect | Preserves request method (POST stays POST) |
| 308 | Permanent Redirect | Permanent version of 307 |
Wildcard Matching
Append * to match all URLs starting with a prefix:
| From Pattern | Matches |
|---|---|
/old-blog/* | /old-blog/post-1, /old-blog/category/tech, etc. |
/docs/v1/* | /docs/v1/api, /docs/v1/guide/intro, etc. |
Performance
| Optimization | Implementation |
|---|---|
| Early Hook | template_redirect at priority 1 |
| Admin Skip | No processing in admin area |
| Fast Lookup | Exact match check before wildcard iteration |
| Transient Cache | 12-hour cache for redirect data |
For a step-by-step walkthrough, see How to Manage Redirects and Fix 404s Without Another Plugin.