A WordPress 404 error stops visitors from reaching your content and signals broken pages to search engines. Every unresolved 404 costs you traffic, rankings, and potential backlinks without you realizing it.
Most 404 errors are fixed in under a minute. This guide covers every cause, every fix method in order of simplicity, and how to prevent 404 errors from returning, so your site stays accessible, and your rankings stay intact.
The fastest way to fix a 404 error in WordPress is to go to Settings then Permalinks in your WordPress dashboard and click Save Changes without changing anything.
This refreshes your URL rewrite rules and resolves most 404 errors in under a minute. If that does not work, check your .htaccess file, deactivate plugins one by one, or use a redirect plugin to send the broken URL to a working page.
What is a 404 Error?
A 404 error is an HTTP response code that appears when a webpage cannot be found on the server. It usually happens because of broken links, deleted pages, incorrect URLs, or moved content.
Common variations include “404 Page Not Found,” “HTTP 404 Not Found,” and “The Requested URL Was Not Found on This Server.” Some websites also use custom 404 pages to improve user experience and help visitors navigate back to active pages.
Fixing 404 errors is important because they affect website navigation, user experience, crawl efficiency, and SEO performance.
What Causes 404 Errors in WordPress?
Understanding the cause is the fastest way to find the right fix. These are the most common reasons 404 errors appear on WordPress sites.
- Broken Permalink Settings: WordPress uses permalink rules to map URLs to content. If these rules get reset or saved incorrectly, every page on your site can return a 404 error.
- Corrupted or Missing .htaccess File: The .htaccess file tells your server how to handle URL requests. If it is missing, corrupted, or has incorrect rules, pages stop loading correctly.
- Plugin or Theme Conflicts: Some plugins and themes change how WordPress handles URLs. A bad update or two conflicting plugins can break your permalink structure entirely.
- Changed URLs Without Redirects: If you change a page slug, delete a page, or rename a post without setting up a redirect, the old URL returns a 404 error permanently.
- Site Migration Issues: Moving your site to a new host or domain often leaves URLs pointing to the wrong location. Your database, .htaccess file, and media paths all need to match the new server.
- Wrong WordPress URL in Database: If your WordPress site URL or home URL is set incorrectly in the database, all pages including your admin panel can show 404 errors.
Struggling with 404 Error on Your WordPress Website? Don’t Worry!
Don’t waste time trying to fix it yourself. Seek professional WordPress help and support for a quick and effective solution.
Take a Backup Before Troubleshooting 404 Errors
Before tackling 404 errors in WordPress, ensure you have a backup in place to safeguard your website’s data. Utilize tools like the BlogVault plugin, known for its user-friendly interface and one-click restoration options. Alternatively, consider managed WordPress hosting plans from providers like DreamHost. DreamHost offers quick backup and restore features directly through its control panel.
Furthermore, regularly schedule backups, store them in multiple locations for redundancy, and verify their integrity to ensure a seamless recovery process in case of troubleshooting complications.
How to Fix or Redirect a 404 Error in WordPress?
Below, we will look at the different methods for tackling these errors.
Step 1: Enable Debugging to Find the Cause
When encountering 404 errors in WordPress, start by enabling debugging to identify the root cause. Edit your wp-config.php file, setting define(‘WP_DEBUG’, true). This activates the debugging mode and displays error messages on your site. Inspect the messages to pinpoint issues with themes, plugins, or misconfigurations causing the 404 errors.
Step 2: Clear Browser Cache and Cookies
Cached files and cookies may lead to outdated or incorrect page information. Clear your browser cache and cookies to ensure you’re loading the latest version of your site. This simple step can often resolve 404 errors caused by browsers serving cached content.
Step 3: Reset WordPress Permalinks (Try This First)
Incorrect permalink settings are a common culprit for 404 errors. In your WordPress dashboard, navigate to “Settings” ⟶ “Permalinks” and choose a different permalink structure. Save changes to reset permalinks. If this resolves the issue, you can switch back to your preferred structure.
Step 4: Restore or Regenerate the .htaccess File
Restoring the .htaccess file in WordPress is crucial to resolving 404 errors caused by misconfigurations. Here are the steps to restore the .htaccess file:
- Access Your Site Files: Use an FTP client (such as FileZilla) or your hosting provider’s file manager to connect to your website’s server.
- Locate the .htaccess File: Navigate to the root directory of your WordPress installation. Look for the .htaccess file. Check your FTP client’s settings to display hidden files if it’s not visible.
- Backup the Current .htaccess File: Before making any changes, backup the existing .htaccess file. Download it to your local computer. This ensures you can revert to the previous state if needed.
- Delete or Rename the Current .htaccess File: Sometimes, the .htaccess file might be corrupted. You can either delete it or rename it to something like “.htaccess_backup”. This prompts WordPress to generate a new .htaccess file.
- Regenerate .htaccess in WordPress Dashboard: Log in to your WordPress admin dashboard. Go to “Settings” and select “Permalinks.” Without making any changes, click on the “Save Changes” button. This action triggers WordPress to regenerate the .htaccess file.
- Verify .htaccess Content: Open the newly generated .htaccess file and confirm that it contains the correct configurations. If you have specific settings needed for your site (such as redirects or custom rules), add them back to the file.
Check different pages on your website to ensure that the 404 errors are resolved. Restoring the .htaccess file should resolve issues caused by incorrect configuration.
Step 5: Deactivate Plugins and Switch to a Default Theme
Deactivate plugins and switch to a default WordPress theme (like Twenty Twenty-One). Reactivate each plugin and theme one by one, checking if the 404 error recurs. This helps identify the specific plugin or theme causing the issue. Once identified, update or seek alternatives for problematic plugins or themes.
Step 6: Update the WordPress URL in Your Database
If you’re experiencing 404 errors due to incorrect URL configurations, then here are the steps to update the WordPress URL in the database:
- Access Database via phpMyAdmin: Log in to your hosting account and find the phpMyAdmin tool. Select your WordPress database from the left sidebar.
- Open the wp_options table: Locate and click on the wp_options table in the database.
- Locate site URL and home Rows: Look for rows with the option_name ‘siteurl’ and ‘home.’ These typically represent your WordPress site’s URL settings.
- Edit Values: Click on the pencil or “Edit” icon next to the ‘siteurl’ and ‘home’ rows. Update the ‘option_value’ field with the correct URL.
- Save Changes: After updating the values, click the “Go” or “Save” button to save the changes.
Lastly, clear your browser’s cache to ensure it loads the updated URL. Next, check your WordPress site to confirm that the 404 errors are resolved.
Step 7: Fix 404 Errors on Local Server Environments
If your local server environment differs from your live server, it could lead to 404 errors. Discrepancies in PHP version, MySQL settings, file structures, and database configurations can also contribute to this issue. Here are the steps to resolve this issue:
- Check Local Server Configuration: Ensure your local server environment (e.g., XAMPP, MAMP) matches the configurations of your live server. Verify PHP version, MySQL settings, and other server parameters.
- Confirm File and Folder Structures: Ensure your local server’s file and folder structures match those on your live server. Inconsistencies can lead to 404 errors.
- Verify Database Settings: Confirm that the local database settings match those in your live database. Pay attention to the database name, username, and password.
- Update Local WordPress URL: Access the local WordPress database using phpMyAdmin or a similar tool. In the wp_options table, locate the ‘siteurl’ and ‘home’ rows and update them with the correct local URL.
- Check .htaccess and Permalinks: Confirm that the .htaccess file on your local server is correctly configured. If it’s missing or corrupted, recreate it or copy it from your live server.
Verify and reset permalinks by going to the WordPress dashboard ⟶ Settings ⟶ Permalinks, then clicking “Save Changes.” Restart your local server to apply the changes. Now, check your local WordPress site to see if the 404 errors are resolved.
Step 8: Redirect 404 Pages to the Homepage Using Code
Using this method, you can create 301 redirects for all 404 pages to your homepage. To do so, log in to your server and navigate to the Public HTML folder or the folder containing your website files. You may also retrieve your website files using an FTP file application such as FileZilla. Logging onto the WordPress dashboard and going to Appearance ⟶ Theme Editor is another option.
Regardless of the technique you use, look for a file named 404.php, or build one if 404.php already does not exist, and add the following code to it:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>
Save the changes when you’re finished. When a 404 error occurs, website visitors will now be routed to the homepage.
Step 9: Use a Plugin to Redirect 404 Error Pages
This is the most effective technique for redirecting or fixing a 404 error page, as you won’t have to write a single line of code for the homepage, and there are multiple options for managing redirects. It is recommended that you use a plugin to help prevent costly mistakes when developing code.
You may use a variety of plugins, including the following:
Redirection

With over one million active installs, Redirection is by far the most popular 404-page redirection plugin. It’s simple to use and includes several other features that we found to be quite appealing. For example, you may send visitors who use a specific web browser to a particular page. Login status, Referrer, Cookies, HTTP headers, IP address, Server, and Page type, redirect if the current page is a 404 page, are among the various conditional redirects.
All 404 Redirect to Homepage

With over 200,000 downloads, All 404 Redirect to Homepage is one of the most famous 404 redirection plugins. It’s also the easiest to use because it automatically redirects all 404 pages to the homepage, unlike most other plugins that need you to set redirects for specific URLs.
301 Redirects – Easy Redirect Manager

Another plugin that makes it simple to generate 404-page redirects. It has many features that make it one of the most incredible plugins. Install it from here. Installing and activating the Plugin is the first step. Let’s take the “All 404 redirect to homepage” plugin as an example.
Steps to Create Redirects for 404 Error Pages in WordPress
To begin, the All 404 Redirect to Homepage plugin will be installed initially. You may do so either by downloading it from WordPress.org or by going to Plugins ⟶ Add New in your WordPress admin panel and searching for the plugin. After you’ve finished installing the plugin, be sure to activate it.
- Adding Customizations to the Plugin: After installing and enabling it, you’ll need to configure the plugin and define the redirection rules. To do so, navigate to the Settings area of your WordPress website’s admin panel and click on All 404 Redirect to Homepage.
- This will bring you to the plugin’s Settings page. Here, select 404 Redirection Status from the dropdown menu, then choose Enabled to enable the plugin.
- After that, you’ll be prompted to input your website’s homepage URL in the “Redirect all 404 pages to” area. Your homepage URL will be stored in the plugin. This area may be used to add any other custom URL.
- Once you’ve finished making your adjustments, click the Update Options button.
In this instance, all 404 pages will now redirect to the homepage. Test the modifications to ensure that everything is working correctly. You may do so by visiting your website and entering a nonexistent URL.
Monitor Your WordPress Site for 404 Error Pages
Monitoring your website for 404 errors is essential for maintaining a positive user experience and ensuring that visitors can access the content they seek. Using the following tools, here’s how to monitor your site for 404 errors.
- Google Search Console: Google Search Console (GSC) provides a comprehensive report on crawl errors, including 404s. Add your site to Google Search Console and regularly check the ‘Coverage’ section for error details.
- Google Analytics: Monitor user behavior. Check the ‘Behavior’ ⟶ ‘Site Content’ ⟶ ‘All Pages’ section for pages generating 404 errors.
- Website Monitoring Tools: Use third-party tools such as Pingdom, UptimeRobot, or GTmetrix. These tools can send alerts when they detect 404 errors during routine site checks.
- Broken Link Checkers: Employ online broken link checkers such as Seahawk’s Broken Link Checker. This tool scans your entire website for broken links, including 404 errors.
- Screaming Frog: Use Screaming Frog by SEO professionals. Here, you can tailor crawls to focus on 404 error detection and resolution.
- Dead Link Checker: Dead Link Checker is a web-based tool designed to scan entire websites for broken links, including 404 errors. It provides detailed reports for efficient error resolution.
404 Redirected Plugin (WordPress Plugin)
Introduction: 404 Redirected Plugin for WordPress automatically redirects visitors from error pages to relevant content, minimizing 404 errors. Key functionalities include:
- Automatic Redirection: Seamless redirection of visitors to relevant pages.
- Custom Redirects: Tailored redirection setup for specific error pages.
- Error Logging: Logging of encountered 404 errors for insights and analysis.
LinkMiner (Chrome Extension)
LinkMiner, a Chrome extension, facilitates on-the-fly link checking for broken links, including 404 errors, on visited webpages. Here’s how it assists:
- On-Page Link Checking: Real-time identification of broken links during browsing.
- Internal and External Link Detection: Detection of both internal and external 404 errors.
- Effortless Integration: Seamless integration into Chrome for instant link checking.
Ahrefs
Ahrefs is a multifaceted SEO tool offering a Site Audit feature for comprehensive website analysis, including 404 error detection. Key functionalities include:
- Site Audit: Thorough analysis to identify crawl issues, including 404 errors.
- Detailed Reporting: In-depth reports on detected errors with actionable insights.
- Competitive Analysis: Benchmarking against competitors to improve error resolution strategies.
Pingdom
Pingdom is a website monitoring service providing real-time alerts for various issues, including 404 errors, to ensure optimal performance. Key functionalities include:
- Real-Time Monitoring: Instant detection and alerts for 404 errors as they occur.
- Performance Reports: Detailed insights into error rates and response times.
- Alerting System: Customizable email or SMS alerts for prompt error resolution.
How to Create Your Own “Error 404 Not Found” Page?
If you’re looking to personalize your website’s 404 error page, it’s a straightforward process. Here are two methods to accomplish this:
- Using the 404 Page Plugin: The plugin offers a user-friendly way to craft a custom error page. With its intuitive interface, you can quickly create and customize your 404 page to align with your website’s design and tone.
- Manual Setup: An option for those who prefer a hands-on approach. Simply add a single line of code to your .htaccess file to redirect the error to a specific page. Then create this designated page, ensuring it provides relevant information and helpful navigation options for visitors who encounter the 404 error.
How to Prevent 404 Errors in WordPress?
Preventing 404 errors is significantly easier than fixing them after the fact. These habits keep your site clean and your rankings protected long term.
- Set Up Redirects Before Changing URLs: Any time you change a page slug, delete a page, or restructure your site, set up a 301 redirect from the old URL to the new one before making the change. The Redirection plugin makes this a one-step process.
- Never Change URLs Without a Redirect: Every URL change without a redirect creates a permanent 404. Treat every existing URL as a live link someone may have bookmarked or another site may have linked to.
- Check Plugins Before Updating: Some plugin updates change how URLs are handled. Test updates on a staging environment before applying them to your live site.
- Audit Internal Links Regularly: Use the Broken Link Checker plugin to scan your site for internal broken links every few months. Catching them early prevents visitors and Googlebot from hitting dead ends.
- Monitor Google Search Console Weekly: Check the Pages report in Google Search Console once a week for new 404 errors. Google finds broken pages faster than most monitoring tools.
- Avoid Changing Permalink Structure: Changing your sitewide permalink structure after launch creates mass 404 errors across every existing URL. If you must change it, set up proper redirects for every affected URL before making the change live.
Conclusion
WordPress 404 errors are fixable at every level from a simple permalink reset to a full database URL update. Whether you manage a local business site, an ecommerce store, or client websites across the US, UK, Australia, or anywhere globally, the same methods apply across all hosting environments and server configurations.
Start with the simplest fix first, work down the list only if needed, set up monitoring through Google Search Console, and use a redirect plugin to catch any future broken URLs before they damage your rankings.
FAQs: WordPress Website 404 Error
How do I get rid of 404 error pages?
Go to Settings then Permalinks in your WordPress dashboard and click Save Changes. This fixes most 404 errors instantly. If the problem continues, restore your .htaccess file, deactivate plugins one by one, or use a redirect plugin to send broken URLs to working pages.
How do I change the 404 status in WordPress?
Replace with:
You cannot change a true 404 status because it means the page does not exist. The correct fix is to either recreate the missing page, restore a deleted page, or set up a 301 redirect from the broken URL to a working page using the Redirection plugin.
How do I get rid of soft 404 errors in WordPress?
A soft 404 error means Google found a page that looks empty or unhelpful and treated it as missing. Fix it by adding meaningful content to the flagged page, removing the page and setting up a redirect to a relevant URL, or submitting an updated sitemap through Google Search Console after making changes.
Why is my WordPress admin showing 404?
A 404 on your WordPress admin is usually caused by a corrupted .htaccess file or incorrect permalink settings. Go to your wp-config.php file and confirm the site URL is correct. Then use FTP to access your .htaccess file, delete it, and regenerate it by saving your permalinks from the WordPress dashboard.
How do I redirect 404 errors in WordPress?
Install the Redirection plugin from the WordPress repository. Go to Tools then Redirection, add the broken URL in the Source URL field, add the working destination URL, and click Add Redirect. The plugin handles the 301 redirect automatically for all future visitors hitting that broken URL.
Can plugins cause 404 errors in WordPress?
Yes. Plugins that modify URL structures, permalink settings, or rewrite rules can trigger 404 errors when they conflict with each other or with your theme. To identify the culprit, deactivate all plugins, check if the 404 errors disappear, then reactivate plugins one at a time until the error returns. Update or replace the plugin that triggers the problem.