Table of Contents
A 404 error appears when a web server cannot find the resource requested at a particular URL. Visitors may see “404 Not Found”, “Page Not Found” or a custom error page. It can happen because a page was removed, a link contains a typo, a URL changed, or the website is routing requests incorrectly.
Not every 404 response is a problem that needs fixing. If a page has genuinely been removed and there is no suitable replacement, returning a proper 404 is usually the correct response. The important task is to identify broken links, valuable pages that have moved, and unexpected 404s affecting content that should still be available.
This guide explains how to find 404 errors, identify their causes and choose the right fix for WordPress and other websites.
What Is an HTTP 404 Error?
HTTP 404 Not Found is a client error status code. It tells the browser and search engine that the server could not find the requested resource. The server may be working normally; the requested URL may simply not correspond to an available page or file.
A 404 response is different from other common HTTP errors:
- 404 Not Found: The requested resource cannot be found at that URL.
- 403 Forbidden: The server understood the request but refuses access.
- 500 Internal Server Error: The server encountered an unexpected condition while processing the request.
- 502 Bad Gateway: A gateway or proxy received an invalid response from an upstream server.
- 503 Service Unavailable: The server is temporarily unable to handle the request.
For a deeper look at server-side errors, see our guide on how to fix a 500 Internal Server Error.
Why Do 404 Errors Occur?
1. A page has been deleted or moved
If you remove a page or change its URL without updating links or creating a redirect, visitors using the old address will receive a 404. This often happens during website redesigns, content clean-ups and migrations.
2. The URL has been typed incorrectly
A misspelt address, incorrect capitalisation on a case-sensitive server, extra character or outdated bookmark can point to a URL that does not exist.
3. Internal or external links are broken
Your website may contain links to pages that have since moved or been deleted. Another website may also link to an old version of one of your URLs. Internal broken links are usually within your control; external links may need a redirect on your site or a correction by the linking website.
4. WordPress permalink or rewrite rules are not working
When WordPress pages exist but their pretty permalink URLs return 404, the issue may involve rewrite rules, the web server configuration or the .htaccess file on Apache. A plugin, theme change or migration can also affect routing.
5. Files are missing or stored in the wrong location
An image, PDF, stylesheet or other resource may return 404 if it was deleted, renamed, moved or uploaded to a different directory. Check the exact file path and filename, including letter case.
6. A domain or hosting configuration has changed
Document-root changes, migration mistakes, virtual-host configuration or incorrect routing can make valid content appear unavailable. If many unrelated URLs suddenly return 404, investigate the server and hosting configuration rather than creating redirects for every URL.
Do 404 Errors Affect SEO?
A genuine 404 response does not automatically harm a website’s rankings. Google explains that many 404s are normal and can be ignored when the URLs should not exist. A page that has been permanently removed and has no relevant replacement should generally return a 404 or 410 response.
However, investigate 404s when:
- A page you want indexed is returning 404.
- An important page was moved but its old URL has no redirect.
- Your own navigation or content links to missing pages.
- A page with valuable external links was removed and has a genuinely equivalent replacement.
- A large group of valid pages began returning 404 after a migration or configuration change.
Do not redirect every missing URL to the homepage. Redirect only when there is a relevant replacement. Sending unrelated URLs to a generic page can create a soft 404, which is confusing for visitors and search engines.
Read Google’s guidance on 404 errors and search performance and its explanation of crawling errors and soft 404s.
How to Find 404 Errors on Your Website
1. Use Google Search Console
Open the Page indexing report in Google Search Console and review URLs reported as “Not found (404)”. Check whether each URL should exist, whether it was submitted in a sitemap, and whether it has internal or external links. Use the URL Inspection tool to inspect an individual address and test its live availability.
Search Console reports help you prioritise issues, but they do not mean every reported 404 needs a redirect. Google’s URL Inspection documentation explains how to check Google’s indexed information and test a live URL.
2. Crawl your website
Use a website crawler such as Screaming Frog or another link-audit tool to find internal links that return 404. Review the source page and anchor text for each broken link, then update the link or decide whether the destination needs a redirect.
3. Review hosting access and error logs
Server logs can reveal which paths are requested, when the requests occur and whether the missing resources are being requested repeatedly. In cPanel, review the available raw access and error logs. Our guide explains how to use error logs in cPanel to troubleshoot website issues.
4. Test the affected URL directly
Open the exact URL in a private browser window or use an HTTP status checker. Confirm the returned status code and check whether the issue affects one URL, a directory, or the whole site. A browser error message alone does not always reveal the actual HTTP response.
How to Fix 404 Errors on Your Website
1. Restore a page that should still exist
If the page was deleted accidentally, restore it from your content management system’s trash or a verified backup. Confirm that the page is published, that its URL is correct and that it loads successfully before changing links elsewhere.
2. Add a 301 redirect when a page has moved
If a page has a new permanent URL, redirect the old address to the closest relevant replacement. A 301 redirect tells browsers and search engines that the resource has moved permanently. Avoid redirect chains and do not send unrelated missing URLs to the homepage.
On an Apache server, a simple redirect can be added to the appropriate .htaccess file, for example:
Redirect 301 /old-page/ https://example.com/new-page/
Replace the example paths with your real old and new URLs. Back up the existing file before editing it, and take care not to overwrite rules used by WordPress or other applications. See our explanation of what an .htaccess file does.
3. Correct broken internal links
Update menus, buttons, navigation, blog posts and other pages so they point directly to the correct destination. Fixing the source link is better than relying on a redirect for a link you control.
4. Check WordPress permalinks
If WordPress content exists but its pretty permalink URLs return 404, sign in to the WordPress dashboard and open Settings → Permalinks. Check that the intended permalink structure is selected. Saving the settings can refresh WordPress rewrite rules. Do not change the URL structure unnecessarily, and take a backup before making server configuration changes.
If the problem continues, check whether Apache’s mod_rewrite is enabled and whether the WordPress rewrite rules are present in .htaccess. On Nginx, review the relevant server block and WordPress routing configuration instead; Nginx does not use .htaccess. WordPress provides further advice in its common errors documentation.
5. Check missing files and directory permissions
Confirm that the requested file exists in the expected directory and that its filename matches the URL exactly. If it is missing, restore or upload the correct file. Check directory and file permissions without making them more permissive than necessary.
6. Ask your hosting provider to investigate
Contact your host if many valid URLs return 404, the issue began after a migration, or server routing appears incorrect. Provide example URLs, the time the issue started, the affected paths and any relevant log entries. Ask the support team to check the document root, virtual host, rewrite configuration and web server logs.
When Should You Leave a 404 Error Alone?
Leave a genuine 404 in place when the URL never existed, the page was intentionally removed and has no equivalent replacement, or the address is an irrelevant malformed request. You do not need to invent replacement content simply to eliminate a 404 report.
Use a 301 redirect when the content has moved permanently to a clearly equivalent page. Restore the original page when it was removed by mistake and is still needed. The right response depends on what happened to the content, not just on the desire to make the error report disappear.
How to Create a Helpful Custom 404 Page
A custom 404 page cannot make a missing URL exist, but it can help visitors recover from the mistake. Make sure the page:
- Clearly explains that the requested page could not be found.
- Uses the same branding and navigation as the rest of the website.
- Provides a link to the homepage and useful popular sections.
- Includes a search option where appropriate.
- Offers a way to report a broken link.
- Returns an actual HTTP 404 status rather than a 200 success response.
Test the custom page with a URL that does not exist. A page that displays “not found” but returns HTTP 200 may be treated as a soft 404.
How to Prevent 404 Errors in the Future
- Plan URL changes and create relevant redirects before moving or removing pages.
- Update internal links whenever a destination changes.
- Run periodic website crawls to identify broken links.
- Keep a record of important URLs during redesigns and migrations.
- Check that XML sitemaps contain only canonical URLs intended for indexing.
- Monitor Search Console’s Page indexing report and investigate unexpected changes.
- Keep reliable backups so accidentally deleted pages and files can be restored.
- Test important navigation, forms, downloads and page routes after updates.
Frequently Asked Questions
Is a 404 error bad for SEO?
Not by itself. A genuine 404 for a page that should no longer exist is normal. Fix it when a valuable page should still be available, an important URL has moved, or your website links to a missing destination.
Should I redirect every 404 URL?
No. Redirect an old URL only when there is a relevant replacement. If there is no equivalent content, keep the genuine 404 or use 410 for content that has been permanently removed.
What is the difference between a 404 and a soft 404?
A 404 is an HTTP response stating that a resource was not found. A soft 404 is a page that appears to be missing or empty but returns a success response, commonly HTTP 200.
Why do my WordPress pages show 404 when they exist?
This can happen when permalink rewrite rules are missing or incorrect, or when server routing is misconfigured. Check Settings → Permalinks and the relevant Apache or Nginx configuration.
Can a hosting provider fix 404 errors?
Yes, when the cause is related to server routing, document roots, rewrite modules, virtual hosts or missing server-side configuration. Broken content links and deleted pages usually need to be corrected in the website itself.
How often should I check for broken links?
For an actively updated website, include link checks in your regular maintenance routine and run an additional crawl after redesigns, migrations or major content changes.
Final Thoughts
Fixing 404 errors starts with identifying why the requested URL cannot be found. Restore content that should exist, redirect pages that have moved to a relevant replacement, correct broken links you control, and leave genuine missing URLs returning the proper 404 response.
Regular website crawls, Search Console checks, reliable backups and careful migration planning make it easier to catch problems before they frustrate visitors. If the issue affects many valid pages or appears to involve server configuration, your hosting provider can help investigate the underlying cause.















