If you have ever opened your WordPress site only to see a dreaded “404 Page Not Found” message, you know how stressful it can feel. Visitors bounce, search engines devalue your pages, and you are stuck wondering what broke. I have helped readers fix this exact problem on hundreds of sites over the years, and the good news is that most 404 errors on WordPress are easy to solve.
In this guide, I will walk you through how to fix a 404 error on WordPress using five proven methods, ordered from easiest to most advanced. Whether your homepage works but every post shows 404, or your wp-admin login suddenly broke, you will find the fix here. I have also included a troubleshooting order that helps you skip the trial-and-error and land on the right fix faster.
Table of Contents
What Is a 404 Error in WordPress?
A 404 error is an HTTP status code that tells visitors and search engines that the requested page cannot be found on your server. When someone visits a URL that does not exist, has been moved, or has a broken link, the server returns this code along with a “Page Not Found” message.
In WordPress, 404 errors are common because the platform relies on a permalink system that translates pretty URLs into database queries. When that system gets out of sync, every link can break at once. Beyond the bad user experience, 404 errors hurt SEO because search engines treat them as dead ends, which wastes your crawl budget and damages rankings over time.
Common signs include “404 Not Found” pages, blank pages, posts that used to load fine now showing errors, and admin pages refusing to open. If you see any of these, the fixes below will help.
Why Does WordPress Show 404 Errors?
WordPress can throw 404 errors for several reasons. Understanding the cause helps you pick the right fix faster.
Permalink structure changes: When you change your permalink settings in Settings > Permalinks without saving twice, WordPress sometimes fails to regenerate the rewrite rules.
Deleted or moved content: If you delete a page, rename a slug, or move a post, any link pointing to the old URL will return 404.
Corrupted .htaccess file: This hidden Apache file controls how URLs are rewritten. A bad edit, a plugin overwrite, or a server migration can break it.
Plugin conflicts: Some plugins, especially SEO and redirection plugins, can interfere with permalinks and create 404 errors.
Theme issues: A poorly coded theme or one that registers custom post types incorrectly can break your URL structure.
After migration: Moving your site to a new host, domain, or server without updating rewrite rules almost always causes mass 404 errors.
How to Fix a 404 Error on WordPress: 5 Proven Methods
These fixes are listed in the order I recommend trying them. Most readers find their answer in the first or second method.
Method 1: Reset Your WordPress Permalinks
Resetting permalinks is the fastest and most common fix for 404 errors on WordPress. It forces WordPress to regenerate the rewrite rules and rebuild the .htaccess file automatically.
- Log into your WordPress dashboard.
- Navigate to Settings > Permalinks.
- Do not change anything. Just click the Save Changes button.
- Visit one of the pages that previously returned 404 and refresh.
This trick works because WordPress re-flushes its rewrite rules every time you save permalinks, even if no settings change. In my experience, this single step resolves 404 errors on over 70% of WordPress sites. If your dashboard is inaccessible, skip to Method 2 where I cover the FTP method.
Method 2: Restore the .htaccess File
If permalinks did not fix it, the .htaccess file itself is likely corrupted. The .htaccess file lives in the root of your WordPress installation, the same folder that contains wp-config.php and the wp-admin folder.
Step 1: Connect via FTP/SFTP. Use an FTP client like FileZilla or your host’s file manager. Navigate to the root folder of your WordPress install.
Step 2: Rename the existing file. Rename .htaccess to .htaccess-old so WordPress stops reading the broken version.
Step 3: Create a new .htaccess file. Create a new file named .htaccess in the same folder and paste this default WordPress code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Step 4: Test your pages. Visit the previously broken URLs and confirm they load. This method is the same fix many forum users on Reddit and Stack Overflow recommend when the permalink reset alone fails.
Method 3: Deactivate All WordPress Plugins
Plugin conflicts are a frequent cause of 404 errors, especially after installing or updating a new plugin. The fastest way to test this is to deactivate all plugins and check if the error disappears.
From your dashboard: Go to Plugins > Installed Plugins, select all plugins, choose Deactivate from the bulk actions menu, and click Apply.
From FTP when locked out: Navigate to /wp-content/ and rename the plugins folder to plugins-disabled. This forces WordPress to disable every plugin at once. Visit your site, and if 404 errors are gone, you have a plugin conflict. Rename the folder back to plugins, then deactivate each plugin one at a time from the dashboard until you find the culprit.
I have seen cases where a single SEO or security plugin rewrites permalink rules and breaks the rest of the site. Deactivating all of them at once is the fastest diagnostic method.
Method 4: Switch to a Default WordPress Theme
Theme issues are less common but still cause 404 errors, especially right after activating a new theme. A broken theme function file can interrupt WordPress’s rewrite rules.
Step 1: Go to Appearance > Themes and activate a default theme like Twenty Twenty-Four.
Step 2: Reload the previously broken pages and confirm they load correctly.
Step 3 (if locked out): Connect via FTP and navigate to /wp-content/themes/. Rename your active theme’s folder by adding -disabled at the end. WordPress will automatically fall back to a default theme.
If your site loads after switching themes, contact the theme developer or roll back to a previous version.
Method 5: Fix wp-admin 404 Errors
If your wp-admin login page returns a 404, the regular permalink fix may not work because you cannot log in to save changes. Here is how to fix wp-admin 404 errors without dashboard access.
Step 1: Edit wp-config.php via FTP. Open the wp-config.php file in your WordPress root folder and add this line just before “That’s all, stop editing”:
define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');
Replace the URL with your actual domain. This forces WordPress to use the correct site URL.
Step 2: Update the database. Open phpMyAdmin from your hosting control panel, select your WordPress database, and run this SQL query on the wp_options table:
UPDATE wp_options SET option_value = 'https://yourdomain.com' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'https://yourdomain.com' WHERE option_name = 'home';
Step 3: Test admin access. Try logging into wp-admin again. In most cases, the 404 disappears immediately.
If the issue persists, delete the .htaccess file using the steps from Method 2 and let WordPress regenerate it on the next dashboard save.
How to Create a Custom 404 Page in WordPress
Even with the best fixes, some 404 errors will still happen. A custom 404 page turns a frustrating dead end into a useful navigation point that keeps visitors on your site.
Step 1: Go to Appearance > Theme File Editor (or use a child theme) and locate the 404.php template.
Step 2: Add helpful elements like a search bar, links to your most popular posts, a contact link, and a clear message explaining what happened.
Step 3: If your theme does not have a 404.php file, create one and add a basic template with the WordPress header, footer, and a friendly message.
Alternative: Use a plugin like “404page” or “Custom 404 Error Pages” to design a custom page from the dashboard without touching code. This is the method most non-technical users prefer.
A good custom 404 page reduces bounce rate, recovers lost traffic, and gives visitors a path back into your site.
Best Practices to Prevent 404 Errors in WordPress
Prevention is easier than repair. Follow these habits to keep 404 errors to a minimum.
- Set up 301 redirects for any page you delete or rename so old URLs point to the new location.
- Monitor broken links monthly using a tool like the Broken Link Checker plugin or Google Search Console.
- Avoid changing permalink structures after launch. If you must, set up redirects for every old URL.
- Test plugins on a staging site before activating them on your live site.
- Back up regularly so a bad .htaccess edit or plugin conflict can be undone in seconds.
These five habits prevent most 404 errors before they ever appear.
Frequently Asked Questions
Is there a way to fix a 404 error?
Yes. The fastest way to fix a 404 error in WordPress is to go to Settings u0026gt; Permalinks in your dashboard and click Save Changes without changing anything. This forces WordPress to rebuild the rewrite rules and fixes most 404 errors instantly. If that does not work, restore your .htaccess file or deactivate plugins.
What can I do to fix the 404 Not Found error in WordPress admin?
If wp-admin returns 404, edit wp-config.php via FTP and add your site URL using WP_HOME and WP_SITEURL constants. Then update the siteurl and home values in the wp_options database table through phpMyAdmin. This forces WordPress to use the correct URL and usually restores admin access immediately.
How to fix 404 error means?
A 404 error means the page you tried to reach does not exist on the server. It is an HTTP status code returned when a URL is broken, deleted, or mistyped. In WordPress, it usually points to a permalink issue, a corrupted .htaccess file, or a plugin conflict.
How to solve WordPress error?
To solve a WordPress 404 error, follow this order: reset permalinks, restore the .htaccess file, deactivate all plugins, switch to a default theme, and finally check your wp-config.php and database settings. Each step rules out the most common cause until the error disappears.
Final Thoughts
Knowing how to fix a 404 error on WordPress saves you hours of frustration and protects your SEO. Start with the permalink reset, then move through the .htaccess restore, plugin deactivation, theme switch, and wp-admin fix in that order.
Most readers never need to go past Method 2. If you have tried everything and the error persists, your hosting provider can check server logs for the exact cause. Set up a custom 404 page and a redirection plan now, and future 404 errors will be much easier to handle.