Key Takeaways
- Most WordPress 404 errors are caused by broken permalinks, a damaged .htaccess file, or plugin conflicts after an update or site migration.
- You can fix the majority of 404 errors by resetting permalinks, restoring the .htaccess file, or deactivating plugins through your dashboard or FTP.
- Cloudways prevents most 404 errors before they happen with free site migrations, one-click staging environments, and built-in server log monitoring.
You open your WordPress site and instead of your content, you see a “404 Not Found” page. Maybe it is happening on one post. Maybe it is happening on every page. Either way, you need it fixed and you need it fixed now.
WordPress 404 errors are common, but they are also one of the easier WordPress errors to fix. Most of the time, the problem comes down to a few usual suspects: permalinks, .htaccess, or a plugin acting up.
In this guide, we will show you what causes WordPress 404 errors, how to find them, and how to fix every common version of them.
- What Is a WordPress 404 Error?
- How to Find 404 Errors on Your WordPress Site
- Method 1: Google Search Console
- Method 2: A Redirection Plugin
- Method 3: Check Server Logs Via Cloudways Dashboard
- Method 4: Use AI to Find WordPress 404 Errors
- Methods to Fix WordPress 404 Errors
- Reset Your WordPress Permalinks
- Restore Your WordPress .htaccess File
- Clear Your Browser Cache and Cookies
- Set Up a 301 Redirect
- Disable Your Plugins and Theme
- Fix WordPress wp-admin or Dashboard 404 Error
- Fix WordPress 404 After Migration
- Fix a Sitewide 404 Error in WordPress
- Fix WordPress Page Exists but Shows 404
- Fix WordPress 404 on Local Servers
- Create a Custom 404 Page in WordPress
- Variations of the 404 Error Message
- How to Prevent 404 Errors in the Future
- Wrapping Up
What Is a WordPress 404 Error?
A WordPress 404 error means your server got a request for a page but could not find anything to send back. The visitor sees a “404 Not Found” message instead of your content.
This is a standard HTTP status code. You will find 404 errors on every website, not just WordPress sites.
What makes WordPress 404s different is that they are usually fixable from inside your dashboard. You don’t need to be a developer to fix most of them.
What causes a 404 error in WordPress?
Most 404 errors come from one of these five issues.
- Broken permalinks. WordPress uses a setting called permalinks to build your URL structure. If this setting gets reset or saved incorrectly, your pages stop loading.
- A damaged .htaccess file. This file tells your server how to handle URL requests. If it is missing rules or has the wrong syntax, every page on your site can start showing a 404 error.
- A plugin or theme conflict. Some plugins change how WordPress handles URLs. A bad update or two WordPress plugins fighting over the same setting can break your whole site.
- A recent migration. Moving your site to a new host or domain often leaves URLs pointing to the wrong place. Your database, .htaccess file, and media paths all need to match the new location.
- A deleted or moved page. If you delete a page or change its slug without setting up a redirect, the old URL will return a 404.
The fix depends on which of these is happening. Use the table of contents above to jump to the right section based on what you are seeing on your site.
A Lot of 404 Errors Start With a Bad Migration. Ours Don’t.
When experts handle your WordPress migration to Cloudways, your permalinks, redirects, and URLs move over cleanly with zero downtime. No broken pages, no lost traffic, no troubleshooting guides needed.
How to Find 404 Errors on Your WordPress Site
Before you fix a 404 error, you need to know which pages are broken. Sometimes it is just one old blog post. Other times, your whole site is throwing 404s and you don’t even know it.
There are four reliable ways to find 404 errors on a WordPress site. Most site owners only need the first one.
Method 1: Google Search Console
Search Console is free and accurate. It shows you the 404s that matter most, the ones Google has actually tried to crawl. If a page is throwing a 404 to Googlebot, your rankings are at risk.
Here is how to find your 404 errors in Search Console.
First, log in to your Search Console account and select your property. Click on Pages in the left sidebar under the “Indexing” section. Scroll down to the table that says “Why pages aren’t indexed.”
Look for the row labeled Not found (404) and click on it.

You will see every URL Google has tried to crawl that returned a 404 error.

You can click any URL to see the date Google first found the issue. Use the export button at the top right to download the full list as a CSV or Google Sheet.
If a URL on this list should not be returning a 404, the fix is usually in your permalinks or a missing redirect. We will cover both later in this guide. If a URL on this list should be a 404 because you deleted that page on purpose, you can leave it alone or set up a redirect to a relevant page.
Method 2: A Redirection Plugin
If you don’t have Search Console set up yet, you can use a plugin to find your 404 errors.
The free Redirection plugin logs every 404 the moment it happens. It also lets you set up redirects from the same screen.
Install and activate Redirection from your WordPress plugins directory.

Then go to Tools » Redirection in your dashboard. Click on the 404s tab at the top.

Every 404 error on your site will show up here with the URL, the referrer, and the timestamp. You can sort by frequency to find the worst ones first.
A quick warning: do not run two redirect plugins at the same time. They will fight over your .htaccess file and create the exact problem you are trying to fix.
Method 3: Check Server Logs Via Cloudways Dashboard
Google Search Console is great, but it misses things. Missing images and broken CSS files rarely show up there. Your raw server logs catch all of them.
If you use Cloudways, you can find these logs right inside your dashboard. Go to Applications and pick your WordPress site. Then navigate to Monitoring » Logs » Access Logs using the left panel.

Find the filter icon near the top right and choose 404 from the status code dropdown. The screen will instantly populate with your broken URLs, timestamps, and IP addresses.
You will see the last 1,000 entries here. If you need older data, just connect via SSH or SFTP and pull the archived log files.
Method 4: Use AI to Find WordPress 404 Errors
If you have hundreds of 404 errors, going through them one by one takes hours. You can use AI to scan your full list, group the errors by their likely cause, and tell you what is breaking your site in minutes.
We will use Gemini inside Google Sheets for this. You can also use Claude. The prompts work exactly the same way.
Step 1: Export your 404 errors to Google Sheets
Open your 404 export from Google Search Console. If you exported a CSV file, just upload it to Google Drive and open it as a Google Sheet.

Step 2: Open Gemini in the side panel
Click the Gemini icon in the top right corner of Google Sheets. The side panel will open up and Gemini will read your active sheet automatically.

If you prefer Claude, copy the URLs from your sheet and paste them right into the Claude chat.
Step 3: Cluster errors by cause
Paste this prompt:
“I have a list of 404 URLs from my WordPress site’s Google Search Console. Group these URLs into categories based on the most likely cause of each 404. Look for patterns like deleted blog posts, removed product pages, broken AMP URLs, missing media files, or URL structure changes. For each group, tell me what’s likely causing the 404 and what fix to apply.”

Gemini will scan your URLs and group them into categories.

For each group, Gemini will explain the likely cause of every 404 on your site and how to fix.
Methods to Fix WordPress 404 Errors
Now that you’ve found the broken links on your site, we can actually fix them. We ordered these solutions by their success rate, so try the top method first. Move down the list if your page still throws a 404.
Reset Your WordPress Permalinks
This one fix cures most WordPress 404 errors instantly. Permalinks dictate your URL structure. Sometimes the core file managing them breaks. When this happens, visitors hit a 404 page even if your actual blog post sits safely in your database.
Fixing it takes zero code and about 30 seconds.
Step 1: Go to your permalinks page
Log in to your WordPress dashboard. Navigate to Settings » Permalinks in the left sidebar.

Step 2: Save your settings without making changes
Scroll all the way down to the bottom of the page. Do not alter any radio buttons or text fields. Just hit the Save Changes button.
WordPress immediately rebuilds your hidden .htaccess file. It dumps the corrupted rules and writes fresh code in the background. Open a new browser tab and check your broken link. It usually loads perfectly now.
Step 3: Do a hard reset if you still see the error
Sometimes a quick save fails. You will need a hard reset to clear out stubborn code.
Stay on the Settings » Permalinks page. Pick the Plain option and click Save Changes.

Wait a couple of seconds, then choose your original setting again. Most sites use the Post name structure. Hit Save Changes one more time.
This completely deletes the old routing structure and rebuilds it from scratch. Still staring at a 404 page? Check the next method.
Restore Your WordPress .htaccess File
Your .htaccess file is the next logical target. This hidden file sits in your main WordPress folder.

It handles all server traffic routing. Bad plugins corrupt it. Sometimes security scanners delete it by accident. Your URLs break immediately when this happens.
Step 1: Connect to your site via FTP
Open an FTP client like FileZilla. Connect to your server. Open the root WordPress folder. You know you are in the right place when you see the wp-content and wp-admin directories.
Cannot find the .htaccess file? Your FTP software probably hides it by default. Turn on “show hidden files” in your settings.

Step 2: Back up the existing file
Right-click the .htaccess file. Download a copy straight to your desktop.
Never edit server files without a backup. You can upload this original file to restore your site if things go wrong.
Step 3: Replace the code with default rules
Open the .htaccess file with a plain text editor. Delete every line of code inside. Paste in these default WordPress rewrite rules:
# 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
Save the file. Upload it back to your server to overwrite the old one. Refresh your site and test the broken link.
Step 4: Create a new file (if yours is missing)
Sometimes the .htaccess file vanishes entirely after migrations. You can force WordPress to generate a new one.
Go to Settings » Permalinks in your dashboard. Click Save Changes.
If WordPress displays a warning saying it cannot write the file, your folder permissions are too strict. To fix:
- Open your FTP client.
- Right-click the WordPress root folder.
- Change the file permissions to 755.
- Return to your dashboard and click save again.

Clear Your Browser Cache and Cookies
Sometimes your 404 error has nothing to do with WordPress at all. Your browser might just be holding onto an old, broken version of the page.
This happens when a page used to be live, then got moved or renamed. Your browser cached the old URL. So even though the new version is working perfectly, you keep seeing the 404 error every time you visit.
The fix takes about a minute.
Step 1: Try an incognito window first
Before you go nuking your browser data, open an incognito or private window. Visit the broken URL there.
If the page loads normally in incognito, you have just confirmed the problem is on your end, not your site. Move to Step 2.
If you still see the 404 in incognito, your browser is not the issue. Skip ahead to the next method.
Step 2: Clear your browser cache
The exact steps depend on which browser you use, but the option is in roughly the same place across all of them.
- In Chrome, click the three-dot menu in the top right.
- Go to Settings » Privacy and security » Delete browsing data.
- Pick a time range (last hour usually works) and check both “Cookies and other site data” and “Cached images and files.”
- Click Delete data.


In Firefox, you will find this under Settings » Privacy & Security » Cookies and Site Data.
In Safari, go to Safari » Settings » Privacy » Manage Website Data.
Once your cache is clear, restart your browser. Visit the broken URL one more time.
Step 3: Test from a different device
Still seeing the 404? Try opening the same URL on your phone or another computer.
If the page loads on the other device, your original browser is the problem. A specific extension or stored cookie might be interfering.
Disable your extensions one at a time to find the culprit.

If the page is broken on every device you test, the problem is on your WordPress site. Move on to the next method below.
Set Up a 301 Redirect
If you’ve deleted an old blog post, changed a URL slug, or moved content to a different section of your site, the old URL is no longer valid, but people may still be clicking on it from Google, social media, or other sites.
Instead of showing them a 404, send them somewhere useful. A 301 redirect tells the browser (and Google) that the page has permanently moved to a new URL.

Visitors get sent to the new page automatically. You keep the SEO value of the old URL.
The easiest way to set this up is with a free plugin called Redirection.
Step 1: Install the Redirection plugin
In your WordPress dashboard, go to Plugins » Add New Plugin. Search for “Redirection” by John Godley.
Click Install Now, then Activate.
Step 2: Add a new redirect
Once activated, go to Tools » Redirection. The plugin will run a quick setup wizard the first time. Just accept the default settings.
After setup, click the Add New tab at the top. You will see two text fields.
In the Source URL field, paste the old URL that is throwing the 404 (without your domain name). For example, if your broken URL is yoursite.com/old-blog-post/, just type /old-blog-post/.
In the Target URL field, paste the new destination. This can be a related post, a category page, or your homepage.
Click Add Redirect.
Step 3: Test the redirect
Open an incognito browser window. Paste the old broken URL into the address bar and hit enter.
Your browser should immediately load the new destination page. If it does not, double-check that you typed both URLs correctly and that there is no typo in the slug.
Step 4: Pick the right destination for SEO
Where you redirect a broken URL matters for your search rankings. The best choice is a page on the same topic.
Google passes most of the SEO value from the old URL to the new one.
If there is no related page, redirect to a category or topic hub. Use the homepage only as a last resort, since mass-redirecting deleted content there can hurt your rankings.
A quick warning: never set up two redirects pointing at each other. This creates a redirect loop, and your site will throw a different error (ERR_TOO_MANY_REDIRECTS) instead of the 404.

For bulk redirects, use AI
Setting up hundreds of redirects by hand takes forever. You can use the AI workflow from Method 4 we covered earlier to speed this process up.
Once Gemini groups your 404 errors, ask it to suggest new URL destinations.
Tell the AI to format the exact output as Redirect 301 /old-path/ /new-path/.
Copy that generated list. Paste the rules directly into your .htaccess file right above the # BEGIN WordPress line.
Always test a few random links in an incognito window first.
AI cannot see your live website. If you are not careful, it might accidentally redirect traffic to another dead page.
Disable Your Plugins and Theme
If you have already tried resetting permalinks, restoring .htaccess, and clearing your cache, the next likely culprit is a plugin or your active theme.
Plugins and themes can change how WordPress handles URLs.
A bad update, a poorly coded plugin, or two plugins fighting over the same setting can break your URL routing and trigger 404 errors across your site.
The fix is to figure out which plugin or theme is causing the problem by deactivating them in a controlled way.
Step 1: Deactivate all your plugins at once
If you can still access your WordPress dashboard, this part is easy.
- Go to Plugins » Installed Plugins.
- Tick the checkbox at the top of the list to select every plugin.
- From the Bulk Actions dropdown, choose Deactivate. Click Apply.

Now visit your broken URL. If the page loads, you have confirmed that one of your plugins is the cause.
If you cannot access your dashboard, you will need to deactivate plugins through FTP.
- Connect to your site.
- Navigate to the wp-content folder.
- Rename the folder called plugins to disabled_plugins.

WordPress will automatically deactivate every plugin because it can no longer find the folder.
Once you can log in again, rename the folder back to plugins. None of your plugins will be active, but they will all still be installed and ready to turn back on.
Step 2: Reactivate your plugins one by one
Now you need to find which plugin is the troublemaker.
Go back to Plugins » Installed Plugins. Activate the first plugin in the list. Visit your broken URL.
If the page still loads, that plugin is fine. Move to the next one. Activate it. Test your URL.
Keep going until your 404 error comes back. The last plugin you activated is the one causing the problem.
This sounds tedious, and honestly, it can be. But it is the only reliable way to identify a plugin conflict.
Most sites have somewhere between 10 and 30 plugins, so the whole process usually takes 15 to 30 minutes.
Step 3: Decide what to do with the bad plugin
Once you know which plugin is causing the 404 error, check if there’s an update available first. Sometimes a quick update fixes the bug.
Go to Plugins » Installed Plugins, find the plugin, and click Update Now if a new version is listed.

If the plugin is already up to date, look for known issues on the plugin’s support forum at WordPress.org. Other users may have reported the same problem and posted a workaround.
If neither helps, find a replacement from the WordPress plugin directory or contact the plugin developer through their support page.
Step 4: Test your active theme
If deactivating your plugins did not fix the 404 error, your theme might be the problem.
To test this, you need to switch to a default WordPress theme like Twenty Twenty-Five.
Go to Appearance » Themes. Hover over a default theme and click Activate.


Visit your broken URL again. If it loads on the default theme, your original theme is the source of the problem.
You have two options from here. Reach out to your theme developer with the details of the issue. Or switch to a different theme altogether if the developer is unresponsive.
A quick warning before you switch themes on a live site: changes to your theme can affect your design, your homepage layout, and your customizations.
If you have a staging environment (Cloudways gives you free staging on every site), test the theme switch there first.
Fix WordPress wp-admin or Dashboard 404 Error
A 404 error on your wp-admin login page is one of the most stressful WordPress problems. You cannot log in to fix anything because the login page itself is broken.
The good news: this is almost always fixable. The cause is usually a plugin conflict, a corrupted .htaccess file, or wrong URL settings in your database. We will work through all three below.
Since you cannot access your dashboard, every fix in this section uses FTP or your hosting file manager.
Step 1: Deactivate all your plugins through FTP
A misbehaving plugin is the most common cause of a wp-admin 404 error. The fastest way to test this is to deactivate every plugin at once.
Connect to your site using FTP or your Cloudways file manager. Navigate to the wp-content folder. You will see a folder called plugins.
And just like we showed you earlier, rename the folder to something like disabled_plugins.

Now try to log in to your wp-admin page. If the login screen loads, you have confirmed a plugin was the cause.
Rename the folder back to plugins.
Then log in to your dashboard, go to Plugins » Installed Plugins, and activate each plugin one at a time.
Test your wp-admin login after each one. The plugin that brings the 404 error back is the one you need to remove or replace.
Step 2: Replace your .htaccess file
If deactivating your plugins did not fix the wp-admin 404, your .htaccess file is the next thing to check. A bad rule in this file can block access to specific URLs, including your login page.
Connect to your site using FTP. Open your WordPress root folder (the one that contains wp-content, wp-admin, and wp-includes).
Find the .htaccess file and download a copy of it to your computer as a backup.
Then open the file in a text editor and replace its contents with the default WordPress rules:
# 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
Save the file and upload it back to your server. Try your wp-admin URL again.
Step 3: Update your WordPress site URL
If your wp-admin is still showing a 404, your site URL settings might be wrong.
This often happens after a domain change, a migration, or an SSL update where the URLs in your database did not get updated properly.
You can fix this by adding two lines to your wp-config.php file.
Connect to your site via FTP and open your WordPress root folder. Find the wp-config.php file. Download a backup to your computer.

Open the file in a text editor. Look for the line that says “That’s all, stop editing”.
Paste these two lines just above it:
define('WP_HOME','https://yoursite.com');
define('WP_SITEURL','https://yoursite.com');
Replace the dummy URL with your actual website address. Make sure the protocol and www version match your live site exactly.
Save the file and upload it. Try your wp-admin URL again.
Step 4: Switch to a default theme
Your active theme might be the problem. Some themes include custom rewrite rules that break the login URL.
Connect to your server via FTP. Open the wp-content/themes folder.
Find your active theme folder. Rename it to something like your-theme-old.

WordPress will detect the missing theme. It automatically falls back to a default theme like Twenty Twenty-Five.
Test your wp-admin URL. If it loads, your original theme caused the conflict.
Step 5: Reset file permissions
Wrong file permissions also trigger a login 404. Your server simply refuses to read the login files.
Cloudways users can fix this in one click.
Log in to your dashboard and select your application. Go to Application Settings and click Reset under the permissions section.

Other hosts require manual FTP fixes. Standard folder permissions are 755. Standard file permissions are 644.
Right-click your folders in FTP and select File Permissions to change them.
Try logging in again. Update your themes and plugins once you regain access.
Fix WordPress 404 After Migration
Moving servers breaks links. WordPress hardcodes old URLs into your database. You must update them manually.
(Note: Cloudways handles migrations for free for WordPress and WooCommerce to prevent this issue).
Step 1: Update your WordPress site URL
Check your core URL settings. Go to Settings » General.
Check the WordPress Address and Site Address boxes. Both URLs must match your new domain. Click Save Changes.

Cannot access the dashboard? Connect via FTP. Open wp-config.php. Paste these lines above the “That’s all” comment:
define('WP_HOME','https://yournewsite.com');
define('WP_SITEURL','https://yournewsite.com');
Save and upload the file.
Step 2: Run a search-and-replace on your database
Old URLs get trapped inside post content. Install the free Better Search Replace plugin to swap them.

Go to Tools » Better Search Replace. Put your old domain in the “Search” box. Put the new domain in “Replace“.
Select all database tables. Check the “Run as dry run” box to preview changes. Click Run Search/Replace.
Review the preview. Uncheck the box and run the tool again to apply the changes.

Step 3: Reset your permalinks
Your .htaccess file holds old routing rules. Go to Settings » Permalinks.
Click Save Changes without editing anything. WordPress will write fresh rules automatically.
Step 4: Check your .htaccess file for old redirect rules
Custom redirects from an old host cause instant 404 errors. Connect via FTP and open your .htaccess file.
Search for Redirect 301 lines containing your old domain. Delete those specific lines. Save and upload.

Step 5: Clear your cache (everywhere)
Cached data hides your recent updates. Clear out your WordPress caching plugin.
Purge the Cloudflare CDN cache.


Empty your browser cache or test the site in an incognito window.
Step 6: Set up redirects for changed URLs
Did your URL structure change during migration?
Any new link paths will need 301 redirects so visitors and search engines land on the right page.
You can use the AI workflow from Method 4 we showed you earlier to build a bulk redirect map quickly.
You can skip this step if your link structure stays exactly the same.
Get Started with Managed WordPress Hosting
Experience hassle-free performance with Cloudways’ Managed WordPress Hosting. Start now and see how easy it is to run your website!
Fix a Sitewide 404 Error in WordPress
Sitewide 404 errors break every page on your domain. This happens due to broken permalinks, a bad .htaccess file, or mismatched URL settings.
Step 1: Identify exactly what is broken
Type your base domain into a browser. If the homepage loads but subpages fail, your permalinks are corrupted.
If the homepage crashes too, you have a .htaccess or URL configuration problem.
Step 2: Work through the fixes in this order
Test these fixes in order. Stop once the site works.
- Reset permalinks: Fixes 90% of sitewide crashes.
- Restore the .htaccess file: The second most common cause.
- Verify site URLs: Check this after any migration.
- Deactivate all plugins: Eliminates software conflicts.
Step 3: Check for server-level issues
Still broken? The cause lives on your server. Expired SSL certificates or DNS updates block traffic.
Cloudways users should review Server Management » Settings & Packages to verify NGINX and PHP setups.


Otherwise, contact your hosting support team.
Fix WordPress Page Exists but Shows 404
Sometimes a page exists in your dashboard but visitors see a 404 error. The post is published. The slug is correct. The URL just refuses to load.
This happens due to slug conflicts, cached permalinks, or trashed posts blocking the URL.
Step 1: Confirm the page is actually published
Open your WordPress dashboard. Go to Posts » All Posts.
Find the exact page. Check its status. It must say “Published,” not “Draft” or “Pending Review.”
If the status is wrong, click Edit. Change it to Published. Click Update. Visit the URL again.

Step 2: Check for slug conflicts
A slug conflict happens when two items share the exact same URL path. The second item always gets a 404.
Conflicts happen when a page matches a category slug, or a media file matches a post slug.
Search your dashboard for the exact slug. Check Posts, Pages, and Categories.
If two items share the slug, edit one of them. Change the slug slightly to make it unique. Click Update.
Step 3: Reset your permalinks
WordPress caches old permalink rules. The old rules block your new URL even after you fix a slug conflict.
Go to Settings » Permalinks. Click Save Changes. Do not edit any fields. Visit your URL again.
Step 4: Check the trash
A trashed post locks its old slug. WordPress shows a 404 on that URL until you empty the trash.
Go to Posts » All Posts. Click the Trash link. Look for any item with your broken slug.
Click “Delete Permanently” to remove it. Do the same for Pages.

Step 5: Update the post and check the URL
Sometimes the fix is just resaving the post.
Edit the broken page. Click Update without changing anything. WordPress will refresh the URL in its database.
Visit the URL one more time. The page should load.
If you still see a 404 after all five steps, the cause is probably elsewhere. Check the Disable Your Plugins and Theme section for plugin conflicts. A redirect plugin or SEO plugin sometimes overrides individual URLs.
Fix WordPress 404 on Local Servers
Running WordPress locally on your computer comes with its own set of 404 problems. The fix is rarely about your content. It is almost always about how your local server is configured.
The most common cause is a missing or misconfigured rewrite module. WordPress needs URL rewriting to make pretty permalinks work, and most local server tools have this turned off by default.
Step 1: Enable the rewrite module
The fix depends on which local server you use.
If you are running Local by Flywheel, rewrite is enabled by default. If you are still seeing 404s, just restart your site from the Local app. That clears most issues.
If you are using XAMPP, open your Apache configuration file. The file is usually at xampp/apache/conf/httpd.conf.

Search for the line that says #LoadModule rewrite_module modules/mod_rewrite.so and remove the # at the beginning. Save the file. Restart Apache from the XAMPP control panel.
If you are using MAMP, the rewrite module is on by default. If you still see 404s, the issue is usually in your .htaccess file. Move to Step 2.
If you are using Docker-based setups, rewrite is usually handled at the container level. Check your container logs for routing errors before changing anything.
Step 2: Check your .htaccess file
Local 404 errors often come from the same .htaccess problems that hit live sites. Connect to your local site folder and look at the .htaccess file in your WordPress root directory.
If the file is missing, log in to your local WordPress dashboard and go to Settings » Permalinks. Click Save Changes. WordPress will create a new file.
If the file exists but contains broken rules, replace its contents with the default WordPress rewrite rules. The full rules are in the Restore Your WordPress .htaccess File section earlier in this guide.
Step 3: Restart your local server
After any configuration change, restart your local server. Stop the service. Wait a few seconds. Start it again. Visit your local URL and test the 404.
If the error is still there, the cause is probably a plugin or theme conflict. Disable your plugins one by one to find the conflict, just like you would on a live site.
Create a Custom 404 Page in WordPress
Even after you fix every 404 error on your site, some visitors will still land on broken URLs.
- They click an old link from social media.
- They mistype a URL.
- They follow a stale bookmark from years ago.
A custom 404 page turns that dead end into a useful experience. Instead of a generic “Page Not Found” message, you can show visitors your search bar, your most popular posts, or a link back to your homepage.

Done well, it can keep readers on your site instead of sending them straight to Google.
There are three ways to create a custom 404 page. Pick the one that matches your skill level.
Method 1: Use your theme’s built-in 404 page
Most modern WordPress themes already include a custom 404 page. Some themes let you edit it directly from the WordPress Customizer.
Go to Appearance » Customize. Look for a section called “404 Page,” “Error Pages,” or something similar. The exact name depends on your theme.
If your theme has this option, you can edit the heading, the message, and sometimes add buttons or featured posts. Save your changes and visit a broken URL on your site to preview the result.
If your theme does not have this option, move to Method 2.
Method 2: Use a plugin
A free 404 page plugin is the easiest way to create a custom 404 page if your theme does not support it.

Install and activate the plugin from your WordPress plugins directory. Go to Appearance » 404 Error Page in your dashboard.
The plugin lets you select any page on your site as your custom 404 page. Most users create a new page first (Pages » Add New) with content like a search bar, popular posts, and a friendly message.
Then they select that page in the plugin settings.
Save your changes. Visit a broken URL on your site to test it.
Method 3: Edit your theme’s 404.php file
If you are comfortable with code, you can edit your theme’s 404.php file directly. This gives you the most control but requires basic PHP knowledge.
Connect to your site via FTP and navigate to wp-content/themes/your-theme-name/. Look for a file called 404.php. If it exists, download a backup before you make any changes.
Open the file in a code editor. The file controls exactly what your visitors see when they hit a broken URL. You can add a search bar, list your most popular posts, or include any custom HTML you want.
A quick warning: never edit your theme files directly on a parent theme. Theme updates will overwrite your changes. Always use a child theme for this kind of customization. If you do not have a child theme set up, the WordPress Codex has a guide on creating one.
What to include on your custom 404 page
A useful 404 page does more than apologize. It helps the visitor find what they were looking for.
Include a search bar so visitors can search your site directly. Add links to your most popular blog posts or product pages. Add a clear button back to your homepage. Keep the design simple and matching your site’s branding.
Some sites also include a contact form or chat widget, which works well if you regularly publish new content and want to capture lost traffic as leads.
Variations of the 404 Error Message
A 404 error is a single HTTP status code, but the message your visitors actually see can vary. Some come from WordPress. Some come from your server. Some come from your theme.
The exact wording matters because it tells you where the problem is. A visitor seeing “404 Not Found” is hitting your server directly. A visitor seeing “Sorry, that page does not exist” is being intercepted by your theme’s 404 template.
The table below covers the most common variations, what causes each one, and where to find the right fix in this guide.
Common 404 error messages and their causes
| Error Variation | What it means | Likely cause | Where to fix |
| 404 Not Found | Standard server-level 404 | Permalinks or .htaccess issue | Reset Your Permalinks section |
| The requested URL was not found on this server | Apache server response | Damaged .htaccess file or missing rewrite rules | Restore Your .htaccess File section |
| Sorry, the page you are looking for could not be found | Theme custom 404 message | Page is genuinely missing or moved | Set Up a 301 Redirect section |
| Oops! That page can’t be found | Default WordPress Twenty Twenty theme | Missing page or broken slug | Page Exists but Shows 404 section |
| It looks like nothing was found at this location | Default WordPress block themes | Missing page or permalink issue | Reset Your Permalinks section |
| Error 404: Page Not Found | Generic browser display | Server-level issue | Restore Your .htaccess File section |
| HTTP 404 | Browser-level error | Server cannot reach the page | Sitewide 404 section |
| This page does not exist | Custom theme 404 message | Page is genuinely missing | Set Up a 301 Redirect section |
| Page not found – 404 | Generic mixed format | Permalinks or routing issue | Reset Your Permalinks section |
| Nothing found for [URL] | Default WordPress search 404 | Search returning no results | Page Exists but Shows 404 section |
If your error message does not appear in the table, look for the closest match. The wording might be unique to your theme or plugin, but the underlying cause is almost always one of the patterns above.
Fix WordPress 404 Errors and Server Timeouts
Frequent 404-level and database errors mean your WordPress site needs more power. Upgrade to managed hosting and built-in monitoring to stop server crashes permanently.
How to Prevent 404 Errors in the Future
Fixing your existing 404 errors is only half the battle. The other half is making sure new ones do not pile up over time.
A few simple habits will keep your site clean and protect your SEO.
Always set up a redirect when you change a URL
Whenever you delete a post, change a slug, or move content to a new section of your site, set up a 301 redirect from the old URL to the new one. This protects your rankings and gives visitors a clean experience.
The Redirection plugin is the easiest way to do this. Set up the redirect at the same time you make the change, not weeks later when you notice the broken links.
Audit your site for 404s every month
Make checking for 404 errors part of your monthly site maintenance. Open Google Search Console, go to Pages, and review the Not found (404) report. Anything new on the list either needs a redirect or needs to be flagged as intentionally gone.
If your site is on Cloudways, you can also check your access logs for 404 status codes. This catches broken images and assets that Search Console misses.
Be careful with URL changes during redesigns
Site redesigns are the biggest single source of post-launch 404 errors. Before you push a new design live, map every old URL to its new destination and set up the redirects in advance. Use the AI workflow from Method 4 if you have hundreds of URLs to handle.
Keep your plugins and themes updated
Outdated plugins and themes are a common cause of 404 errors, especially after a WordPress core update. Check your dashboard for updates weekly. Update your plugins and themes regularly, but always run a quick site check after each update to catch any new errors before your visitors do.
Use a staging environment for big changes
Anything that touches your URL structure, .htaccess file, or core settings should be tested on staging first. Cloudways gives you free staging on every site. Push your changes to staging, click around to test for 404s, then push to live once you are sure nothing is broken.
Wrapping Up
A 404 error on your WordPress site looks scary. It is actually one of the easiest problems to fix.
A quick permalinks reset usually solves it in under a minute.
If that fails, your .htaccess file or a bad plugin is likely the cause. Old URLs from a recent site migration can also trigger these errors.
Work through the methods in this guide in order. Try the simple fixes first.
Set up a monthly check in Google Search Console once your site is back online. This helps you catch new 404 errors before they pile up.
As a Cloudways user, you can avoid many of these server-level headaches. We include automated backups and easy one-click staging environments.
Our team also handles your site migrations completely free of charge. This prevents the broken URLs that usually happen when moving hosts.
Now that you’ve learned how to fix 404 errors, here are detailed guides to help you troubleshoot other common WordPress errors
Q. How do I fix a 404 error in WordPress?
Go to Settings » Permalinks in your dashboard. Click the Save Changes button.
This forces WordPress to rebuild your .htaccess file. It fixes most 404 errors in seconds.
If your site stays broken, restore your .htaccess file manually via FTP. You can also deactivate your plugins to find a software conflict.
Q. What is error 404 in WordPress login?
This means your server cannot find your wp-admin URL.
The cause is usually a bad security plugin or wrong site URL settings. A corrupted .htaccess file can also block your login screen.
You must fix this using FTP since you cannot access the WordPress dashboard.
Q. How do I fix a 404 error?
Check the URL for typos first. Clear your browser cache and try loading the page in an incognito window.
If the page still fails to load, the website owner needs to step in. They must reset permalinks, restore the .htaccess file, or set up a 301 redirect.
Q. What is the 404 path in WordPress?
There is no single 404 path file in WordPress core.
The error page is generated by a template file called 404.php. This file lives inside your active theme folder at wp-content/themes/your-theme-name/404.php.
WordPress loads this template automatically whenever a visitor hits a missing URL.
Q. Why is my WordPress page showing 404 even though it exists?
Your page might have a slug conflict with another published post. It could also be sitting in the trash folder by accident.
Sometimes old permalink rules simply get stuck in your cache.
Check your post status and look for duplicate URL slugs. Empty your trash folder and reset your permalinks to fix it.
Q. How do I find 404 errors on my WordPress site?
Google Search Console is the best tool for this. Click Pages in the left sidebar and open the “Not found (404)” report.
You can also use the free Redirection plugin. It tracks live 404 errors directly inside your WordPress dashboard.
For a complete historical list, check your raw server access logs.
Q. Do 404 errors hurt SEO?
Individual 404 errors do not hurt your SEO directly. Google expects websites to remove old pages over time.
However, having too many broken links wastes your crawl budget. It also creates a bad user experience.
The real SEO damage happens when high-traffic URLs return a 404 instead of pointing to a working redirect.
Abdul Rehman
Abdul is a tech-savvy, coffee-fueled, and creatively driven marketer who loves keeping up with the latest software updates and tech gadgets. He's also a skilled technical writer who can explain complex concepts simply for a broad audience. Abdul enjoys sharing his knowledge of the Cloud industry through user manuals, documentation, and blog posts.