Overview
The 404 Monitor tracks broken links on your site by logging 404 (Page Not Found) errors with detailed information including URLs, referrers, IP addresses, and timestamps.Identifying and fixing 404 errors improves user experience, SEO rankings, and helps discover opportunities for redirects.
Features
Automatic Logging
Captures 404 errors as they occur in real-time
Referrer Tracking
See where broken links are coming from
Retention Controls
Automatically delete old logs after specified days
Privacy-Focused
Opt-in logging with configurable data retention
Configuration
Implementation Details
404 Logging Class
includes/class-geoai-404.php
Logging Function
includes/class-geoai-404.php
IP Detection
includes/class-geoai-404.php
Auto-Cleanup
includes/class-geoai-404.php
Database Schema
The 404 log uses a dedicated database table:id: Unique identifier for each log entryurl: The requested URL that returned 404referrer: The page that linked to the broken URLip: IP address of the visitortimestamp: When the 404 occurred
Viewing 404 Logs
Recent errors appear at the bottom of the Redirects & 404 settings page:includes/class-geoai-admin.php
Log Display Example
| URL | Referrer | IP | Date |
|---|---|---|---|
/old-product | https://google.com/ | 192.168.1.1 | 2025-03-04 15:30:22 |
/blog/missing-post | https://example.com/blog/ | 192.168.1.2 | 2025-03-04 14:15:10 |
/contact-old | - | 192.168.1.3 | 2025-03-04 12:45:00 |
Common 404 Patterns
Internal Broken Links
Internal Broken Links
Indicators:
- Referrer is from your own domain
- Multiple hits from the same URL
- Find and update the broken link in your content
- Or create a redirect if the old URL was intentional
External Backlinks
External Backlinks
Indicators:
- Referrer is from external domain
- Consistent pattern of hits
- Create 301 redirect to preserve link equity
- Contact site owner to update link (if possible)
Search Engine Crawlers
Search Engine Crawlers
Indicators:
- No referrer or search engine referrer
- Old URLs that used to exist
- Create redirects to relevant current content
- Use Google Search Console to see which URLs Google expects
Typos & Guessing
Typos & Guessing
Indicators:
- URLs with obvious typos
- Random URLs not related to your content
- Usually safe to ignore
- Consider creating redirect only if pattern is frequent
Malicious Scanning
Malicious Scanning
Indicators:
- Requests for
/wp-admin,/xmlrpc.php,.env, etc. - Many requests from same IP
- Safe to ignore (security plugin should handle)
- Consider IP blocking if excessive
Analyzing 404 Data
Most Common 404s
Query the database to find frequently broken URLs:404s by Referrer
Find which pages are linking to broken URLs:Creating Redirects from 404s
Enter Details
- From: Copy the 404 URL (e.g.,
/old-product) - To: Enter destination (e.g.,
/products/new-product) - Type: Select 301 Permanent
Retention & Privacy
Data Retention
Retention Period
Default: 30 daysAutomatically deletes logs older than specified days
Max Entries
Default: 1,000 entriesPrevents database bloat on high-traffic sites
Privacy Considerations
Best practices:- Enable logging only when needed
- Set conservative retention periods (7-30 days)
- Disclose logging in your privacy policy
- Don’t store logs longer than necessary
- Consider anonymizing or hashing IPs
IP Anonymization
Anonymize IP addresses for better privacy:Performance Impact
Low Overhead
Single database INSERT per 404 (typically less than 5ms)
Minimal Queries
No queries on successful page loads, only on 404s
Auto-Cleanup
Old logs deleted automatically to prevent bloat
Optional Feature
Can be disabled completely if not needed
Export 404 Data
Export logs for analysis in external tools:Best Practices
Review Regularly
Check 404 logs weekly to catch new broken links quickly.
Fix Internal Links
Update broken internal links in your content rather than relying on redirects.
Redirect High-Value Pages
Create 301 redirects for URLs with backlinks or traffic.
Ignore Bot Scans
Don’t create redirects for obvious scanning attempts (.php, .env, etc.).
Set Conservative Retention
Keep logs for 7-30 days max to comply with privacy regulations.
Monitor After Migrations
Enable logging during site restructures to catch missed redirects.
Troubleshooting
404s not being logged
404s not being logged
Check:
- Logging is enabled in Settings → Redirects & 404
- Database table exists (check during plugin activation)
- You’re viewing actual 404 pages (not redirects)
- No caching plugin preventing 404 detection
Table doesn't exist
Table doesn't exist
Solution:
- Deactivate and reactivate GEO AI plugin
- Or run table creation manually:
Too many logs
Too many logs
Solution:
- Lower retention period (e.g., 7 days)
- Lower max entries (e.g., 500)
- Manually delete old logs:
Performance issues
Performance issues
Cause: Very high 404 rate (bot attacks, missing files)Solution:
- Disable logging temporarily
- Add database index on url column
- Increase auto-cleanup frequency
- Block malicious IPs at server level
Advanced Usage
Custom 404 Page
Show most common 404s on your custom 404 page:404.php
Related Features
Redirects
Create redirects for broken URLs
Sitemaps
Help search engines find valid URLs
Canonical URLs
Prevent duplicate content issues