How to Fix a WordPress 404 Error
If you receive a 404 error when trying to access a webpage, it could mean that the requested URL cannot be found on the server. There are several reasons why this could happen, such as broken permalinks or issues with the .htaccess file. Learn how to fix a WordPress 404 error with this guide.
Some examples of 404 errors include:
- 404 Not Found
- Error 404
- HTTP Error 404
- Not Found
- Page Not Found
- The requested URL is not found on the server
In this article, we will discuss:
Quick Fixes
Learn how to fix a 404 error in WordPress by trying some quick fixes:
- Restart your browser by closing the current window and opening a new one.
- Clear your cache.
- Check the URL and make sure you have entered the correct website address in your search bar.
- Try using another device or browser. If it works, clear the cache of the device you previously used.
- Use private browsing mode or incognito to display a renewed website page version.
If you're still having trouble, continue with the WordPress 404 error troubleshooting guide below.
Common Issues Causing 404 Errors
Important: Always back up your site before making any changes or following the troubleshooting steps below.
Below are solutions to common underlying issues causing a 404 error.
- Fixing Broken Permalinks
- Updating Incorrect Custom URLs
- Renaming the .htaccess File
- Updating Incorrect Information within WordPress Files
Fixing Broken Permalinks
If you've made edits to your website that affect the URL, you might run into some issues with broken permalinks that lead to 404 errors. A permanent link refers to the full URL used for a specific page, content, or post on your WordPress website. It includes your domain and a part of the URL that comes after your domain name, which is called a Slug.
To resolve a 404 error caused by broken permalinks, follow these steps:
- Log in to your WordPress dashboard and look for Settings on the left menu.
- If you need instructions on how to access your WordPress dashboard, check out How to Log in to Your WordPress Dashboard.
- From there, select Permalinks.
- Once you're on the Permalinks Settings page, resave your permalinks by clicking the Save Changes button at the bottom left.
- After that, go back to your website and refresh it, or open it using private browsing mode.
- Test all of your broken navigation menu links to see if they are already working as intended.
Updating Incorrect Custom URLs
Another possible reason for seeing a 404 page on your website could be that incorrect custom URLs were set for Menus.
To fix this, please follow the steps below:
- Log in to your WordPress dashboard.
- If you need instructions on how to access your WordPress dashboard, check out How to Log in to Your WordPress Dashboard.
- Click Pages on the left menu.
- Go to the Published tab and hover over a page you want to update. Click on Edit.
- You will be taken to your Site Editor. Click on the horizontal ellipses.
- In the List View, look for the Navigation block and its menu items.
- Select an existing menu item. Then, check if there is a Custom Link and what it was set to.
- Go back to your dashboard and click Pages on the left menu.
- Find the page for which you need to check the URL, then click Quick Edit.
- In our example below, the Slug is home. Note that the Slug is the end portion of the permalink.
- Go back to the Custom Link you have accessed in the previous steps and update the URL using the correct slug. For example, if the slug for the custom link in your menu is myhome, it should be updated to home to match it with the slug within the Pages section of your WordPress dashboard.
- Once the Slug is updated, look for the Save Menu at the bottom-right corner of the page to save your changes.
- Recheck your website and refresh it, or open it using private browsing mode to see if the issue has been resolved.
Following these steps should resolve the issue with your navigation menu. If it doesn't, please try the other troubleshooting steps.
Renaming the .htaccess File
If you're encountering a 404 error on your WordPress website, it might be due to your .htaccess file. To fix a WordPress error due to the .htaccess file, follow these steps:
- Log in to your FTP application using your login credentials.
- Find the folder that contains your WordPress website in the Remote site section.
- Look for the existing .htaccess file.
- Right-click on the .htaccess file and select Rename.
- Rename your .htaccess file to set it back to default.
- Refresh your website or check it using private browsing mode.
If the error goes away, it means there was some problematic coding within the file causing the error. If these steps don't help, please try the other troubleshooting steps.
Updating Incorrect Information within WordPress Files
There may be some images or links on your WordPress website that lead to a 404 error. This could be due to misspellings or missing information within your WordPress files. To fix this, you can go to your WordPress files and double-check the file path for each image or link. If you hover over the image, you will see the file path it is trying to access at the bottom left corner. Please see the example below:
Follow the steps below to troubleshoot:
- Open the link in a new tab and check out the URL. This will tell you where the website is trying to find the image within the directory. In the example below, it is trying to find the GIF within the wp-content folder > uploads > 2022 > 09 > then the file name (giphy-5.gif).
- Next, head to your WordPress files and follow the path mentioned in step 1 to see if the data is missing or misspelled. Look for the following folders:
wp-content:
uploads > 2022 > 09:
- Check the file name to see if it matches the URL in our example above. In the example below, the file it is trying to access shows a capital G instead of a lowercase G. Note that URLs are case and character-sensitive.
- Once you've located the file, you can right-click and rename it to match what the URL is looking for.
- If the image still isn't working, try refreshing the page or opening it in private browsing mode.
These steps should help you fix any broken links or buttons on your website, not just for images but also for PDFs, custom pages, and more.
Review
Diagnose and fix WordPress 404 errors. A 404 error may indicate that a webpage is not found on a server, possibly due to issues with permalinks or with the .htaccess file. You can fix these errors by repairing broken links, updating incorrect custom URLs, renaming your .htaccess file, or correcting information within your WordPress files. Use this guide to restore your website's functionality.