The 404 Error is a standard HTTP response code that indicates your browser was able to connect to the server, but the requested resource couldn’t be found. This error can be caused by various issues, such as DNS configuration errors or incorrect file permissions.
The 404 Error Not Found often happens when trying to access a page or asset that doesn’t exist, like a missing image file, CSS, or JavaScript. The 404 error does not specify whether this is a temporary or permanent issue; if it's permanent, a 410 Gone status code would be more appropriate.
Common causes of 404 Not Found error are:
- Page relocation or removal: The content may have been moved or deleted without updating the associated links.
- Incorrect URL: The URL might have been entered incorrectly in the browser, leading to a non-existent page.
- DNS configuration issues: The domain might still be propagating or it could be pointed to the wrong DNS settings.
- Cached version of the error: Your browser could be showing a cached version of the 404 error, even though the website is functioning properly for others.
- Missing files: Missing files such as images, stylesheets, or JavaScript could also result in a 404 error.
- Incorrectly configured or outdated permalinks: If the website’s permalink structure is not properly configured or is outdated, it can result in broken links and 404 errors.
Variations of the 404 error
Different browsers and servers might display the 404 error message in various ways. Common variations include:
- "Error 404"
- "404 Not Found"
- "HTTP Error 404"
- "Page Not Found"
- "The requested URL was not found on this server."
- "The page cannot be found."
- “We can’t find the page you’re looking for.”
- “The requested URL /~ was not found on this server.”
Impact of 404 Not Found errors on SEO and site performance
The 404 Error Not Found typically does not harm SEO on its own. However, if the error results from broken URLs or sitewide permalink issues, it can prevent Google from properly crawling your site, which could negatively impact SEO.
Important:
Fix 404 errors as soon as possible to ensure your site remains accessible to search engines and users.
Websites that generate many 404 errors can experience performance issues since these errors are not usually cached.
For example, a sudden surge in traffic to a 404 page can cause spikes in PHP and CPU usage. To mitigate this, cache 404 pages for a short duration (e.g., 15 minutes) and ensure that any new pages matching cached 404 URLs immediately purge the cache.
Fixing 404 Not Found error
Step 1: Reload the page
A 404 Not Found error is often temporary. Simply refreshing the page can usually fix the problem. On Windows, press F5 or CTRL + F5. On Mac, use CMD + R.
Step 2: Clear browser cache
Corrupted cookies and an outdated cache in your browser can sometimes cause the error. Before making any changes to your WordPress site, it's important to determine whether your browser is the source of the problem by clearing its data history.
To clear browser data in Chrome, follow these steps:
- Open Chrome on your computer.
- Click on the three dots at the top right corner, then select Delete browsing data.
- Choose a time range, like Last hour or All time.
- Select Cookies and other site data and Cached images and files.
- Click Delete data.
Note:
The steps to clear cache and cookies in other browsers, such as Safari, are generally similar, though the specific menus and options may vary slightly.
Step 3: Use incognito mode
You can try accessing the site in Incognito mode. If the 404 Not Found error doesn't occur, the issue may be local on your browser.
Step 4: Update your site's permalinks
For sitewide 404 errors, the most common cause is an issue with Permalinks. To fix this:
- Go to Settings → Permalinks in your WordPress dashboard.
- Click Save Changes without modifying any settings. This action refreshes your permalink structure.
- Clear your website cache and check again.
Step 5: Set up 301 redirects for moved or renamed content
If 404 errors occur on specific content, it's likely due to changing the content's URL slug or moving it without a proper redirect. Here’s how to fix this:
- Install the Redirection plugin.
- Go to Tools → Redirection.
- Enter the old URL in the Source URL box and the new URL in the Target URL box.
Important:
Setting up 301 redirects ensures that both users and search engines can locate the content at its new location, preserving SEO value.
Step 6: Check your domain pointing
Another frequent cause of a 404 Not Found error is DNS-related issues, such as incorrect IP addresses or unresponsive DNS servers.
In such cases, flushing your DNS cache might resolve the problem. Use this guide to flush the DNS cache. Also, if you recently pointed your domain, it might take up to 24 hours for DNS changes to propagate
Step 7: Restore backup
If all else fails and you are still encountering a 404 Not Found error, restoring your website from a previous backup might be the solution. This step is particularly useful if the error started appearing after recent changes, updates, or modifications to your site.
10Web offers automated backups that can be restored through your 10Web Dashboard. Always ensure you’re restoring from a recent backup to avoid losing valuable data.
Creating a custom 404 page
No matter how well you maintain your site, some 404 errors are unavoidable, especially due to user errors like mistyping URLs. You can create a custom 404 page with this guide to enhance the user experience by guiding them to relevant content. You can use the 404page plugin to create a custom 404 page that includes:
- A search box
- Important links
- Contact information
Note:
A 404 page should not be redirected to a physical URL (e.g., yoursite.com/404). It should always be dynamically generated on the requested page.
Monitoring 404 errors
Monitoring 404 errors helps you identify and resolve issues that could affect your site’s usability and SEO. Here are several methods to track these errors:
Option 1: Google Analytics
Set up a custom report in Google Analytics to track 404 errors from external links. You can find more details here.
Option 2: WordPress plugin
The Redirection plugin not only handles redirects but can also monitor 404 errors directly from your WordPress dashboard. You can find the plugin here.
Option 3: Audit tool
Tools like Ahrefs or Sitechecker can regularly scan your site for 404 errors and provide detailed reports.
Option 4: Google Search Console
Use Google Search Console to view 404 errors that Google’s crawlers encounter:
- Go to Crawl → Crawl Errors → Not found in your Google Search Console dashboard.
Important:
Regularly monitoring and fixing 404 errors will help maintain your site’s performance and user experience.
Conclusion
404 errors are a normal part of maintaining a website. However, by regularly monitoring and quickly addressing these errors, you can minimize their impact on user experience, SEO, and site performance. If you have any additional questions or need further assistance with managing 404 errors, feel free to reach out.