Loading...

Knowledge Base
Save 25% on a custom website!

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:

  1. Restart your browser by closing the current window and opening a new one.
  2. Clear your cache.
  3. Check the URL and make sure you have entered the correct website address in your search bar.
  4. Try using another device or browser. If it works, clear the cache of the device you previously used.
  5. 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

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:

  1. Log in to your WordPress dashboard and look for Settings on the left menu.
  2. From there, select Permalinks.
    Settings icon and Permalinks option

     
  3. Once you're on the Permalinks Settings page, resave your permalinks by clicking the Save Changes button at the bottom left.
    Save Changes button within Permalink Settings

     
  4. After that, go back to your website and refresh it, or open it using private browsing mode.
  5. 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:

  1. Log in to your WordPress dashboard.
  2. Click Pages on the left menu.
    Pages option

     
  3. Go to the Published tab and hover over a page you want to update. Click on Edit.
  4. You will be taken to your Site Editor. Click on the horizontal ellipses. 
    Horizontal ellipses
     
  5. In the List View, look for the Navigation block and its menu items.
    Navigation block

     
  6. Select an existing menu item. Then, check if there is a Custom Link and what it was set to.
    Custom URL

     
  7. Go back to your dashboard and click Pages on the left menu.
  8. Find the page for which you need to check the URL, then click Quick Edit.
    Quick Edit link

     
  9. In our example below, the Slug is home. Note that the Slug is the end portion of the permalink.
    Slug example

     
  10. 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. 
    Custom URL
     
  11. Once the Slug is updated, look for the Save Menu at the bottom-right corner of the page to save your changes.
  12. 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:

  1. Log in to your FTP application using your login credentials.
  2. Find the folder that contains your WordPress website in the Remote site section.
  3. Look for the existing .htaccess file.
    .htaccess file and Rename option

     
  4. Right-click on the .htaccess file and select Rename.
  5. Rename your .htaccess file to set it back to default.
  6. 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:


Website Homepage with an image not working and link to image at bottom left

Follow the steps below to troubleshoot:

  1. 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).
    File path on web search bar

     
  2. 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:
    File path on web search bar

    uploads > 2022 > 09:

    uploads folder 2022 folder09 folder

     
  3. 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.
    File name which is Giphy-5.gif

     
  4. Once you've located the file, you can right-click and rename it to match what the URL is looking for.
  5. 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.

Did you find this article helpful?

 
* Your feedback is too short

Loading...