WordPress 404 Error? 8 Fixes for Pages and Permalinks

Seeing a WordPress 404 error on a page or post that definitely exists can be confusing.

Your homepage may work perfectly while individual posts, pages, categories, or custom URLs suddenly show 404 Not Found.

In many cases, the content has not disappeared. WordPress simply cannot match the requested URL to the correct page.

QUICK ANSWER

If WordPress pages return 404 errors but the homepage still works, start by going to Settings → Permalinks and clicking Save Changes without changing anything. If the problem remains, check your rewrite rules, .htaccess file, server configuration, cache, plugin conflicts, and recently changed URLs.

Why Does WordPress Show a 404 Error?

A 404 error means the requested URL cannot be matched to available content.

On WordPress, that can happen even when the page still exists in your dashboard.

Common causes include:

  • Broken or outdated permalink rules
  • A missing or incorrect .htaccess file
  • Apache or Nginx rewrite configuration problems
  • A changed post or page slug
  • A plugin or theme changing rewrite rules
  • Cached 404 responses
  • Problems after a site migration
  • Custom post type slug conflicts

The fastest fix depends on whether the error affects one URL or most of the site.

First: Check What Kind of 404 Error You Have

Before changing settings, test several URLs.

Ask these questions:

  • Does the homepage work?
  • Do all posts return 404?
  • Do only pages return 404?
  • Is only one specific URL broken?
  • Did the problem begin after a migration?
  • Did you recently change a permalink or slug?

If the homepage works but most internal pages fail, permalink or rewrite rules are a strong suspect.

If only one page fails, check that page’s URL, slug, publication status, and redirects first.

1. Re-Save Your WordPress Permalinks

This should usually be your first troubleshooting step.

Go to:

WordPress Dashboard → Settings → Permalinks

Do not change the current structure yet.

Simply scroll down and click:

Save Changes

This forces WordPress to refresh its rewrite rules.

After saving, open one of the broken pages again in a new browser tab.

TIP:

If the error disappears after saving Permalinks, do not keep changing settings. The problem was likely caused by stale or broken rewrite rules.

2. Check Your Permalink Structure

While you are in Settings → Permalinks, confirm that your URL structure is the one you actually want to use.

Common WordPress permalink options include:

  • Plain
  • Day and name
  • Month and name
  • Numeric
  • Post name
  • Custom structure

For many standard blogs and informational websites, Post name creates simple URLs such as:

https://example.com/my-post-name/

Be careful when changing permalink structures on an established site.

Existing links may change, which can create new 404 errors unless appropriate redirects are added.

3. Check the .htaccess File on Apache Servers

On Apache-based hosting, WordPress commonly uses the .htaccess file for pretty permalink rewrite rules.

If this file is missing, damaged, or contains incorrect rules, internal WordPress URLs may stop working.

The file is normally located in the main WordPress installation directory, near files such as:

  • wp-config.php
  • wp-login.php
  • index.php

Before editing .htaccess, make a backup.

If saving Permalinks does not regenerate the correct rules, your hosting provider may need to check file permissions or server configuration.

IMPORTANT:

Do not paste random .htaccess rules from an unrelated website. Incorrect rewrite rules can make more pages inaccessible.

4. Check Apache mod_rewrite or Nginx Configuration

If changing WordPress permalink settings does not fix the problem, the web server may not be processing rewrite rules correctly.

Apache typically relies on rewrite functionality for WordPress pretty permalinks.

Nginx does not use .htaccess in the same way. Its URL routing rules are configured at the server level.

If you are using managed hosting, the safest approach is usually to contact support and explain:

“My WordPress homepage works, but pretty permalink URLs return 404 errors.”

Ask them to verify the WordPress rewrite configuration for your server.

5. Clear WordPress, Server, CDN, and Browser Cache

Sometimes the underlying 404 problem is already fixed, but a cached error page continues to appear.

Clear the caches that apply to your site:

  • WordPress caching plugin
  • Hosting/server cache
  • CDN cache
  • Browser cache

If you use a caching plugin, look for a button such as:

  • Purge All
  • Clear Cache
  • Flush Cache

Then test the URL in a private or incognito browser window.

This helps you determine whether the 404 is still being generated or whether you were simply viewing an old cached response.

6. Check Plugins and Themes for Rewrite Conflicts

Plugins and themes can register custom URLs and rewrite rules.

A conflict may appear after:

  • Installing a plugin
  • Updating a plugin
  • Changing themes
  • Adding a custom post type
  • Changing e-commerce or membership settings

If the 404 problem began immediately after one of these changes, investigate that component first.

A common troubleshooting method is to temporarily disable suspected plugins one at a time.

After each change:

  1. Go to Settings → Permalinks
  2. Click Save Changes
  3. Test the broken URL again

If the page starts working after one plugin is disabled, you have likely identified the conflict.

7. Check the Page Slug and Old URL

If only one specific page returns a 404 error, open that page in WordPress.

Check the slug.

For example, the old URL may have been:

https://example.com/wordpress-email-fix/

but the current page slug may now be:

https://example.com/fix-wordpress-email/

The old URL can then return a 404.

If an existing page was intentionally moved to a new URL and the content is substantially the same, create a 301 redirect from the old URL to the new URL.

Do not redirect unrelated broken pages to the homepage just to eliminate 404 errors.

Redirect users to the closest relevant replacement.

8. Check Problems After a WordPress Migration

404 errors are common after moving a WordPress site to a new host, domain, or server.

Check the following:

  • WordPress Address URL
  • Site Address URL
  • Permalink settings
  • Server rewrite rules
  • .htaccess on Apache
  • Nginx configuration if applicable
  • Old-domain links stored in the database
  • Cache and CDN settings

Go to:

Settings → General

Confirm that:

  • WordPress Address (URL)
  • Site Address (URL)

both point to the correct live website.

Then re-save Permalinks and clear all caches.

Special Case: Custom Post Type 404 Errors

If normal posts and pages work but a custom post type returns 404 errors, check the custom post type slug.

A page and a custom post type should not accidentally compete for the same URL structure.

For example, a page using:

/products/

could conflict with a custom post type also configured to use:

/products/

After correcting a slug conflict, return to:

Settings → Permalinks → Save Changes

to refresh the rewrite rules.

A Fast Troubleshooting Order

If WordPress is showing 404 errors, follow this order:

  1. Check whether the homepage works
  2. Test several posts and pages
  3. Go to Settings → Permalinks
  4. Click Save Changes
  5. Clear WordPress and browser cache
  6. Check whether only one slug is broken
  7. Review recent plugin or theme changes
  8. Check .htaccess if using Apache
  9. Ask your host to verify server rewrite rules
  10. Review migration settings if the site was recently moved

This order starts with the safest and fastest fixes before moving to server-level troubleshooting.

Quick Checklist

  • Homepage loads normally
  • Permalinks have been re-saved
  • Correct permalink structure is selected
  • Cache has been cleared
  • Page slug is correct
  • No unnecessary slug conflict exists
  • Plugins have been checked
  • Apache rewrite rules or Nginx configuration are correct
  • Migration URLs are correct
  • Old URLs use relevant 301 redirects when appropriate

Frequently Asked Questions

Why does my WordPress homepage work but other pages show 404?

This often points to a permalink or rewrite-rule problem. Start by going to Settings → Permalinks and clicking Save Changes. If the issue remains, investigate server rewrite configuration.

Can a WordPress plugin cause 404 errors?

Yes. Plugins that create custom URLs, post types, redirects, security rules, or rewrite rules can sometimes conflict with WordPress routing. Test recent plugin changes if the problem appeared after an installation or update.

Does clearing cache fix a WordPress 404 error?

Cache does not fix broken rewrite rules, but it can continue showing an old 404 response after the underlying problem has already been fixed. Clearing cache is therefore an important verification step.

Should I change my permalink structure to fix a 404?

Usually, first try saving the existing permalink structure without changing it. Changing permalink structure on an established website can alter existing URLs and create additional redirect work.

Should I redirect every 404 page to my homepage?

No. If a page has a clear replacement, redirect it to the closest relevant URL. Unrelated 404 URLs should not automatically be sent to the homepage.

Final Thoughts

A WordPress 404 error does not always mean your content is gone.

In many cases, the problem is caused by the connection between the requested URL and WordPress’s rewrite rules.

Start with the simplest fix: re-save Permalinks.

Then move through cache, individual slugs, plugin conflicts, server rewrite rules, and migration settings in that order.

The goal is to identify which layer is failing instead of changing multiple settings at the same time.

Leave a Comment