A WordPress 404 response means the requested URL did not resolve to a public resource. Sometimes that is correct: a mistyped address or permanently removed page may have no replacement. The repair depends on why the URL is missing, not merely on the fact that a visitor saw a 404 template.
Start with one failing URL, its exact HTTP response, and the link or request that produced it. Avoid redirecting every missing address to the homepage; that hides the source and can create confusing soft-404 behavior.
Real 404 versus soft 404
A real missing URL should return HTTP 404 Not Found (or sometimes 410 Gone when removal is deliberate and permanent). A soft 404 displays an error-like page while returning 200 OK, or redirects an unrelated missing URL to a generic destination.
Check the response with browser developer tools, curl -I, or an HTTP checker. The visual page alone is not enough.
Trace where the bad URL comes from
- Copy the complete URL, including capitalization, query string, and trailing slash.
- Search current posts, pages, menus, templates, widgets, and structured data for that address.
- Check analytics, Search Console, and server access logs for referrers.
- Determine whether the URL ever represented real content.
- Compare it with the current canonical destination, if one exists.
An internal link under your control should usually be corrected at its source even when a redirect is also appropriate.
Deleted, moved, and renamed content
If a page moved and has a close replacement serving the same intent, use a direct permanent redirect and update internal links. If the content was removed with no suitable equivalent, keep an informative 404 or 410 response.
Do not redirect an expired job, discontinued event, or unrelated article to a category or homepage solely to avoid a 404. A useful custom 404 can offer search, navigation, and popular sections without pretending the missing resource exists.
When many valid posts suddenly return 404
Widespread 404s after migration, server changes, or permalink edits often point to rewrite configuration rather than deleted content. In WordPress, visit Settings → Permalinks, confirm the intended structure, and save it once to refresh rewrite rules.
Do not repeatedly flush rewrite rules on every request. If saving permalinks does not help, inspect server configuration and ask the host whether the required Apache or Nginx rules are active. WordPress documents pretty-permalink 404 troubleshooting.
Check custom post types and taxonomies
A custom post type can fail when its rewrite slug conflicts with a page, taxonomy, or another route. Confirm that the post type is registered, public queries are enabled as intended, and its archive and rewrite settings match the desired URLs.
After changing registration code, flush rewrite rules once through an activation routine or by saving permalinks. Preserve existing public URLs unless a planned migration includes redirect mapping.
Use logs to separate application and server problems
Access logs show the requested path, status, user agent, and often the referrer. WordPress debug logs may reveal plugin or theme errors, but enable logging carefully and do not expose debug output publicly.
If WordPress never receives the request, investigate CDN, proxy, web-server, or DNS rules. If WordPress receives it but cannot match content, inspect post status, slug, rewrite rules, language paths, and plugin routing.
Build a useful 404 page
A 404 template should state clearly that the page could not be found, keep normal navigation, provide search where useful, and offer a route back to relevant sections. It must still return a 404 status.
Do not automatically redirect visitors after a countdown. Let them choose where to go, and keep the message concise on mobile.
Troubleshooting checklist
- Confirm the exact response status and redirect chain.
- Find and repair current internal links to the URL.
- Determine whether a genuine one-to-one replacement exists.
- Check post status, slug, trash, and visibility.
- Refresh rewrite rules once if valid routes fail broadly.
- Inspect server, CDN, and WordPress logs.
- Test logged-out and cached responses.
- Verify the custom 404 returns 404, not 200.
The WordPress dashboard guide can help beginners locate posts, pages, and settings safely.
Frequently asked questions
Should every 404 be redirected?
No. Redirect only when a clear equivalent exists or a URL was intentionally moved.
Is 410 always better for deleted content?
No. Both 404 and 410 communicate that content is unavailable. Use 410 only when the permanent removal is deliberate and your implementation supports it correctly.
Why does the editor show a post that returns 404?
It may be draft/private, have a conflicting route, use stale rewrite rules, or be affected by caching or access controls.
Conclusion
A 404 is a symptom, not a diagnosis. Verify the status, locate the source, repair internal links, and redirect only to a true replacement. Correct missing URLs can remain 404s; broken site routing requires a targeted fix.
