Fix 404 Errors in WordPress
Find the cause, repair useful links and keep genuine missing pages honest.
Find the cause, repair useful links and keep genuine missing pages honest.
404 errors mean a requested address could not be found. In WordPress, that can be a broken link, a deleted page or a problem routing an otherwise valid URL. Start by finding which situation applies, rather than redirecting every missing address to the homepage.

Copy a failing address and note where you found it: a menu, search result, internal link or monitoring report. Open the homepage, an existing post and a made-up URL. If only one page fails, investigate that page before changing site-wide settings.
Record when the problem started and any recent migration, permalink, plugin or server changes. This gives you a useful starting point and makes it easier to undo the right change.
Find the expected page in WordPress and confirm it is published, publicly accessible and using the intended slug. Check whether it is in the trash or has a different parent page. Copy its current permalink rather than rebuilding the address from memory.
Repair links in menus, buttons, posts and templates that still point to an old address. For broken image or download links, confirm that the file exists and that the filename matches, including capital letters.
Open Settings → Permalinks, record the current setting and click Save Changes while keeping that structure. WordPress can then refresh its rewrite rules. Test a known post in a separate browser tab.
Do not change every URL to a different format merely to clear 404 errors. That creates an additional migration problem. If you deliberately change the structure, map old URLs to their corresponding replacements first.
Back up .htaccess before editing it on an Apache-compatible server. Preserve security rules, redirects and hosting directives. A copied root-site rewrite block may be wrong for a subdirectory or multisite installation.
Nginx does not use .htaccess. Ask your administrator to inspect the relevant virtual host and request-routing configuration instead. If saving permalinks cannot update the server rules, contact support with a working homepage URL and a failing post URL.
When a page has moved permanently, set a 301 redirect to its closest equivalent, then update internal links to the destination. Avoid redirect chains and check that the destination loads successfully.
If content is gone with no suitable replacement, a genuine 404 or 410 response is appropriate. Sending unrelated missing URLs to the homepage can create soft 404s and confuse visitors. See Google’s HTTP status guidance.
After fixing the cause, clear the relevant page, server and CDN cache. Test while logged out so that an administrator-only bypass does not hide a cached error. Compare the same URL directly after the change.
A useful error page should explain the problem and offer search or navigation while retaining the correct response status. Our custom error pages guide explains the visitor-facing part of that work.
Retest your affected URLs and check their response codes in browser developer tools or an HTTP inspection tool. A page showing an error message with status 200 is still a problem even if it looks polished.
Use Search Console to inspect important repaired URLs and review reports after recrawling. Reports can lag behind live changes. Random requests for URLs that never existed do not require endless redirects; prioritise useful pages and links visitors actually follow.
No. Missing pages are a normal part of the web. Focus on accidentally broken important URLs, links you control and relevant replacements. Google explains this distinction in its 404 help guide.
Check document roots, file transfer completeness and the new server’s rewrite configuration. Our migration guide includes the broader checks.
For help with 404 errors, contact DigitalBerg with the affected domain, the step you tried and a redacted error message. Never include passwords, private keys or complete configuration files containing secrets.
Install WordPress Manually: 7 Easy, Essential Steps
