Redirects & 404 Monitoring
Manage URL redirects, monitor 404 errors, smart redirect suggestions, and automatic hit tracking to maintain SEO equity.
Redirect Manager
The redirect module () allows you to create URL redirects that execute at the template_redirect hook β before WordPress renders any template.
Creating a Redirect
Navigate to Redirects
Go to Serpelo β Content & Links β Redirects (slug: serpelo-redirects).
Enter Source & Target
Enter the Source URL (the old URL) and Target URL (where visitors should go). Select the redirect type.
Save
Click Add Redirect. The redirect is immediately active.
Redirect Types
| Code | Type | When to Use |
|---|---|---|
| 301 | Permanent | Content has permanently moved. Passes ~90% of link equity. Use for most SEO redirects. |
| 302 | Temporary | Content is temporarily at a different URL. Does not pass link equity permanently. |
| 307 | Temp (HTTP/1.1) | Like 302 but strictly preserves the HTTP method (POST stays POST). |
Redirect Features
- Hit Tracking: Each redirect counts visits in the
hitscolumn. View popular redirects at a glance. - Active/Inactive: Toggle redirects on/off without deleting them (
is_activeflag). - Timestamps:
created_atandupdated_atfor audit trails.
404 Monitor
The 404 Monitor () automatically logs every 404 error on your site, capturing the URL, referrer, user agent, IP address, and hit count.
404 Log Data
| Column | Description |
|---|---|
url | The 404 URL that was requested |
referrer | Where the visitor came from |
user_agent | Browser/bot identification string |
ip_address | Visitor IP (IPv4/IPv6, up to 45 chars) |
hits | Number of times this 404 was hit (auto-incremented for same URLs) |
last_hit | Timestamp of the most recent hit |
is_resolved | Whether a redirect has been created for this URL |
redirect_id | FK to the redirect if resolved |
Actions
- Resolve: Creates a redirect for the 404 URL and marks it resolved. AJAX:
- Delete: Removes the 404 entry from the log. AJAX:
Smart 404 Redirect Suggestions
The Smart 404 module () uses multi-signal scoring to suggest the best redirect target for broken URLs. Pro
How It Works
When a 404 is detected, the smart matcher:
- Extracts slug segments from the broken URL
- Searches published content titles, slugs, and excerpts
- Scores matches using word overlap, Levenshtein distance, and content relevance
- Returns the top suggestion with a confidence score
Database Tables
wp_serpelo_redirects
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY
source_url VARCHAR(500) NOT NULL
target_url VARCHAR(500) NOT NULL
redirect_type INT DEFAULT 301
hits INT DEFAULT 0
is_active TINYINT(1) DEFAULT 1
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE
INDEX idx_source (source_url(191))
INDEX idx_active (is_active)
wp_serpelo_404_log
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY
url VARCHAR(500) NOT NULL
referrer VARCHAR(500) DEFAULT ''
user_agent VARCHAR(500) DEFAULT ''
ip_address VARCHAR(45) DEFAULT ''
hits INT DEFAULT 1
last_hit DATETIME DEFAULT CURRENT_TIMESTAMP
is_resolved TINYINT(1) DEFAULT 0
redirect_id BIGINT UNSIGNED DEFAULT NULL
INDEX idx_url (url(191))
INDEX idx_hits (hits)
INDEX idx_resolved (is_resolved)