How to Fix 404,403,402 Error in WordPress?

Error

Have you ever clicked a WordPress website link and seen a **“404 Error – Page Not Found”** message? A 404 error is one of the most common problems WordPress website owners encounter. It usually means that the requested page or URL cannot be found on the server.

The good news is that a **404 error in WordPress is usually easy to fix**. In this guide, you’ll learn what causes WordPress 404 errors and several effective methods to fix them.

What Is a 404 Error in WordPress?

A **404 error** occurs when a visitor tries to access a URL that does not exist or cannot be found by the server.

A typical WordPress 404 page may display messages such as:

* 404 Error
* Page Not Found
* The requested page could not be found
* Sorry, we couldn’t find that page
* This page doesn’t exist

For example, if your website has:

`yourwebsite.com/about-us`

but someone visits:

`yourwebsite.com/about`

WordPress may return a **404 Page Not Found error** because the requested URL doesn’t exist.

What Causes a 404 Error in WordPress?

There are several possible reasons why a WordPress website displays a 404 error.

Common causes include:

1. Incorrect permalink settings
2. A changed or deleted URL
3. Broken internal links
4. Incorrect `.htaccess` rules
5. Plugin conflicts
6. Theme-related problems
7. Incorrect server configuration
8. Domain or DNS changes
9. Missing WordPress files
10. Cached or outdated URLs

Let’s look at the most effective ways to fix the problem.

How to Fix 404 Error in WordPress

### 1. Refresh the Permalink Settings

One of the easiest ways to fix a **WordPress 404 error** is to refresh your permalink settings.

You don’t necessarily need to change anything.

Go to:

**WordPress Dashboard → Settings → Permalinks**

Then simply click:

**Save Changes**

You can leave your current permalink structure unchanged.

WordPress will regenerate its rewrite rules, which can often resolve 404 errors.

After saving, open the page that previously showed the 404 error and check whether it works.

2. Check Your WordPress URL

Sometimes WordPress 404 errors are caused by incorrect website URLs.

Go to:

**Settings → General**

Check these two fields:

* WordPress Address (URL)
* Site Address (URL)

Make sure both URLs are correct and use the correct protocol:

`https://`

if your website has an SSL certificate installed.

Also check that there are no unnecessary spaces, characters, or incorrect domain names.

3. Check Whether the Page Still Exists

If only one particular page is showing a 404 error, check whether that page still exists.

Go to:

**Dashboard → Pages → All Pages**

Search for the page.

If the page was deleted, you can either restore it from the Trash or create a new page with the appropriate URL.

If the page exists, edit it and check its permalink.

4. Check the Page URL or Slug

A page’s URL may have changed.

For example, your original URL might have been:

`example.com/wordpress-development`

but you changed the slug to:

`example.com/wordpress-web-development`

Visitors or search engines accessing the old URL may receive a 404 error.

To check the slug:

**Pages → Edit Page → Permalink**

Make sure the URL is correct.

If the old URL has already been indexed by Google or shared elsewhere, consider creating a **301 redirect** from the old URL to the new URL.

5. Clear Your Website Cache

Caching can sometimes cause outdated URLs or pages to continue appearing.

If you’re using a caching plugin such as:

* WP Rocket
* LiteSpeed Cache
* W3 Total Cache
* WP Super Cache

clear the website cache.

You should also clear your browser cache and, if applicable, your CDN cache.

Then test the URL again in an incognito/private browser window.

6. Check Your `.htaccess` File

The `.htaccess` file controls important rewrite rules on many WordPress hosting environments.

If the file becomes corrupted or contains incorrect rules, WordPress pages may start returning 404 errors.

Before editing `.htaccess`, create a backup.

For a standard WordPress installation, the file commonly contains rules similar to:

“`text
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
“`

However, `.htaccess` rules can vary depending on your hosting environment and website configuration. Avoid replacing the file blindly if you have custom rules.

An easier approach is often to go to:

**Settings → Permalinks → Save Changes**

WordPress may automatically regenerate the required rewrite rules.

7. Temporarily Disable Plugins

A plugin conflict can sometimes cause WordPress URLs to return 404 errors.

To test this:

1. Go to **Plugins → Installed Plugins**
2. Deactivate your plugins temporarily
3. Check the affected URL
4. If the 404 disappears, reactivate the plugins one by one
5. Test the website after activating each plugin

When the 404 returns, you’ve likely identified the conflicting plugin.

Pay particular attention to plugins that modify:

* URLs
* Redirects
* SEO
* Custom post types
* Security
* Caching
* Membership functionality

8. Check Your WordPress Theme

Your theme can also cause routing or template-related problems.

To test whether the theme is responsible, temporarily switch to a default WordPress theme.

For example, you can activate a current default theme such as Twenty Twenty-Five or another available WordPress default theme.

Then test the affected page.

If the 404 disappears, the problem may be related to your previous theme or its custom code.

9. Check Custom Post Types

If you’re using custom post types, a 404 error can occur when their rewrite rules are not properly registered or refreshed.

This is common with websites using:

* Elementor
* Custom Post Type UI
* ACF
* WooCommerce
* Membership plugins
* Directory plugins

After making changes to custom post types, try refreshing your permalink settings:

**Settings → Permalinks → Save Changes**

If the problem continues, check the custom post type’s rewrite configuration.

10. Check Your Server Configuration

If WordPress pages continue returning 404 errors after checking the settings above, the problem may be related to your hosting server.

Depending on your hosting environment, WordPress may use:

* Apache
* Nginx
* LiteSpeed
* Another web server configuration

Server rewrite rules must be configured correctly for WordPress pretty permalinks to work.

If you’re not comfortable changing server configuration, contact your hosting provider or a WordPress developer.

## How to Fix 404 Errors After Changing WordPress URLs

Changing URLs can create a large number of 404 errors.

For example:

Old URL:

`example.com/services`

New URL:

`example.com/wordpress-services`

If visitors and search engines still access the old URL, they’ll receive a 404 response unless you create a redirect.

The recommended solution is usually a **301 redirect** from the old URL to the relevant new URL.

This helps visitors reach the correct page and can also help preserve SEO signals associated with the old URL.

How to Fix 404 Errors on WordPress After Migration

A website migration can cause multiple 404 errors.

This can happen when:

* The domain changes
* URLs change
* Permalink structures change
* Files are not migrated correctly
* Database URLs are incorrect
* `.htaccess` rules are missing
* Rewrite rules aren’t working correctly

After migration, check your:

1. WordPress URL
2. Site URL
3. Permalink structure
4. `.htaccess`
5. Internal links
6. Redirects
7. Images and media URLs
8. Cache/CDN settings

Then crawl your website to identify broken URLs.

How to Find 404 Errors on Your WordPress Website

Finding 404 errors is important for both user experience and SEO.

You can monitor broken URLs using tools such as Google Search Console and website crawling tools.

Look for URLs that return a **404 HTTP status code** and determine whether each URL should:

* Remain a 404
* Be restored
* Be redirected
* Be removed from internal links

Not every 404 needs a redirect. If a page was intentionally deleted and has no relevant replacement, returning a proper 404 can be appropriate.

## How to Prevent WordPress 404 Errors

You can reduce future 404 errors by following a few best practices.

### Keep Your URLs Consistent

Avoid changing URLs unnecessarily.

### Use 301 Redirects

Whenever you permanently move an important page, redirect the old URL to the most relevant new URL.

### Check Internal Links

Regularly check your website for broken internal links.

### Monitor Google Search Console

Review indexing and page-related issues regularly.

### Backup Before Major Changes

Always create a backup before changing your site’s:

* Permalinks
* Theme
* Plugins
* `.htaccess`
* Domain
* Website structure

## Is a 404 Error Bad for SEO?

A 404 error is not automatically bad for SEO.

A 404 status can be completely normal when a page genuinely doesn’t exist.

The bigger problem occurs when important pages unexpectedly return 404 errors. For example, if an important service page, product page, or blog post suddenly becomes unavailable, users and search engines cannot access that content.

Therefore, regularly monitoring important URLs is a good SEO practice.

## Frequently Asked Questions About WordPress 404 Errors

### Why is my WordPress homepage working but other pages show 404?

This is often related to permalink or rewrite rules. Go to **Settings → Permalinks** and click **Save Changes** without changing your permalink structure.

### Why does WordPress show a 404 error after changing the permalink?

Changing a permalink changes the page URL. The old URL may no longer exist. Consider adding a 301 redirect from the old URL to the new one.

### Can a plugin cause a WordPress 404 error?

Yes. Plugins that modify URLs, redirects, custom post types, caching, or security rules can sometimes cause conflicts.

### Can clearing the cache fix a 404 error?

It can help when cached content or outdated rewrite information is involved, but clearing the cache does not fix every type of 404 error.

### Should I redirect every 404 page?

No. You should not automatically redirect every 404 URL. Redirect a URL when there is a genuinely relevant replacement page. Otherwise, allowing an intentionally removed page to return 404 may be appropriate.

Fix Your Website Error