# 404 Not Found in WordPress

> Fix a WordPress 404 Not Found: re-save permalinks, restore the default .htaccess block, enable mod_rewrite, add nginx try_files and rule out plugin conflicts.

Canonical: https://scaplet.com/errors/http/404/wordpress

Guide Error · HTTP status codes

Fix a WordPress 404 Not Found: re-save permalinks, restore the default .htaccess block, enable mod_rewrite, add nginx try_files and rule out plugin conflicts.

4 min

read

8

sources

Oct 21, 2026

updated

Scaplet Editorial Team

author

404 4xx · Client error

The short answer

A WordPress 404 Not Found on pages that exist usually means the rewrite rules that send pretty URLs to `index.php` are missing or not running. Re-save Settings > Permalinks, restore the default `.htaccess` block on Apache, make sure `mod_rewrite` and `AllowOverride` allow it, or add `try_files $uri $uri/ /index.php?$args;` on nginx. Then rule out a plugin.

1. [Two kinds of WordPress 404](#two-kinds-of-wordpress-404)
2. [Fix pretty permalinks that return 404](#fix-pretty-permalinks-that-return-404)
3. [If permalinks are fine: plugins, themes and moved sites](#if-permalinks-are-fine-plugins-themes-and-moved-sites)
4. [Verify the fix](#verify-the-fix)

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F404%2Fwordpress%20(%22404%20Not%20Found%20in%20WordPress%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F404%2Fwordpress%20(%22404%20Not%20Found%20in%20WordPress%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F404%2Fwordpress%20(%22404%20Not%20Found%20in%20WordPress%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F404%2Fwordpress%20(%22404%20Not%20Found%20in%20WordPress%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

_01_Which 404 do you have?

## Two kinds of WordPress 404

A 404 means the server did not find a current representation for the URL, as RFC 9110 puts it. In WordPress there are two different cases, and they need different fixes. The general meaning of 404 is on [404 Not Found](/errors/http/404).

Symptom

### Every post or page returns 404 except the home page and `/wp-admin/`

Likely cause

Rewrite rules not working

Go to

The permalink and server sections below

Symptom

### Only new custom post types or one section returns 404

Likely cause

Rewrite rules not refreshed

Go to

Re-save permalinks

Symptom

### One URL returns 404 and the page was deleted, moved or its [slug](/glossary/url-slug) changed

Likely cause

The page is really gone

Go to

Restore it, or redirect the old URL

Symptom

### The 404 page is a bare web server page, not your theme's 404 page

Likely cause

The request never reached WordPress

Go to

Server rewrite fix

When the request does reach WordPress and nothing matches, WordPress picks a template for it. Its template hierarchy documents the 404 template files and calls them in order, starting with `404.php`. So a themed "page not found" screen means WordPress ran and found nothing; a plain server page means the rewrite never handed the request over.

_02_How it works

## Fix pretty permalinks that return 404

1. 1

### Re-save permalinks

In the dashboard, go to Settings > Permalinks and save, even without changes. WordPress's Common Errors guide says to reset permalinks this way for pretty permalink 404s. For custom post type 404s it says to select the default permalinks, save, then reselect your structure; that flushes the rewrite rules.
2. 2

### Check the .htaccess file (Apache)

Pretty permalinks work through the rewrite block that WordPress writes to `.htaccess`. If the file is missing or corrupted, rename it to `.htaccess_old`, load the site, then re-save permalinks so WordPress writes a fresh one.
3. 3

### Check that Apache runs it

WordPress's troubleshooting guide says pretty permalink 404s can mean `mod_rewrite` is not activated, and tells you to look for the line `# LoadModule rewrite_module modules/mod_rewrite.so` in `httpd.conf`. A commented line means the module is off.
4. 4

### Check that .htaccess is allowed

In the Apache config, `AllowOverride` must permit the directives in `.htaccess`. Apache's default is `None`, which means `.htaccess` files are ignored.
5. 5

### Add the rewrite for nginx

nginx has no `.htaccess`, so WordPress cannot write the rules for you. Add the `try_files` line to the main location block, as in the nginx [snippet](/glossary/snippet) below.

Default WordPress rewrite block for .htaccess (from the WordPress handbook)

```
# BEGIN WordPress RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
```

nginx location for pretty permalinks

```
location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass php; }
```

The nginx guide in the WordPress handbook explains that, without server changes, nginx adds `index.php` to your permalinks. Its `try_files` line includes the `?$args` part so that non-default permalinks that use a [query string](/glossary/url-parameters) keep working. For the nginx side of a missing file, see [404 Not Found in nginx](/errors/http/404/nginx); for Apache, see [404 Not Found in Apache](/errors/http/404/apache).

_03_Good to know

## If permalinks are fine: plugins, themes and moved sites

Reset to a known state. Deactivate all plugins; if you cannot reach the dashboard, rename `wp-content/plugins` to `plugins.hold` using FTP or your host's file manager, log in, rename it back, and reactivate plugins one at a time. The same guide's steps for other errors also include switching to a default theme to rule out theme code. After a migration or server move, the permalink and rewrite settings are the first place to look.

A themed 404 must still send a 404 status

If a plugin or custom theme shows a "not found" design with a 200 status, search engines see a [soft 404](/glossary/soft-404). Check the status with `curl -sI https://example.com/missing-page`. See [soft 404 errors](/seo-issues/soft-404-errors) and, for real 404s, [4xx errors](/seo-issues/4xx-errors).

_04_How it works

## Verify the fix

1. 01

### Test a post and a page

Open a post URL and a page URL in a private window.
2. 02

### Check the status line

`curl -sI` the URLs and confirm 200, not 404.
3. 03

### Test a URL that should 404

A made-up path should return 404 with your theme's `404.php` design.

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ How do I fix a 404 error in WordPress?

Go to Settings > Permalinks and save. If that fails, restore the default `.htaccess` rewrite block (Apache), confirm `mod_rewrite` and `AllowOverride` are on, or add `try_files $uri $uri/ /index.php?$args;` for nginx. Then deactivate plugins to rule out a conflict.

_02_ Why do my WordPress pages show 404 but the home page works?

The home page can load without a rewrite, while posts and pages with pretty permalinks need the rewrite rules. They are missing, not refreshed, or not running on your server.

_03_ How do I fix 404 errors on custom post types in WordPress?

WordPress's Common Errors guide gives two steps. Make sure no custom post type and single page share the same name, renaming the page and its slug if they do. Then go to Settings > Permalinks, select the default permalinks, save, and reselect your preferred structure to flush the rewrite rules.

_04_ What does 404 mean?

The server did not find a current representation for the requested URL, or is not willing to disclose that one exists. RFC 9110 does not say whether the condition is temporary or permanent.

Sources · 8

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- rfc-editor.org
- wordpress.org
- apache.org
- google.com

1. 01 [RFC 9110: HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110.html) rfc-editor.org · checked 2026-10-25
2. 02 [WordPress.org Documentation: FAQ Troubleshooting](https://wordpress.org/documentation/article/faq-troubleshooting/) wordpress.org · checked 2026-10-25
3. 03 [WordPress Advanced Administration: Common WordPress errors](https://developer.wordpress.org/advanced-administration/wordpress/common-errors/) developer.wordpress.org · checked 2026-10-25
4. 04 [WordPress Advanced Administration: Apache HTTPD / .htaccess](https://developer.wordpress.org/advanced-administration/server/web-server/httpd/) developer.wordpress.org · checked 2026-10-25
5. 05 [WordPress Advanced Administration: Nginx](https://developer.wordpress.org/advanced-administration/server/web-server/nginx/) developer.wordpress.org · checked 2026-10-25
6. 06 [WordPress Theme Handbook: Template Hierarchy](https://developer.wordpress.org/themes/classic-themes/basics/template-hierarchy/) developer.wordpress.org · checked 2026-10-25
7. 07 [Apache HTTP Server 2.4: core features (AllowOverride)](https://httpd.apache.org/docs/2.4/mod/core.html) httpd.apache.org · checked 2026-10-25
8. 08 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-10-25

## Keep learning

[All errors](/errors)

[Learn 404 Not Found HTTP status codes](/errors/http/404) [Related 4xx errors Status codes and links](/seo-issues/4xx-errors) [Read next 403 Forbidden in WordPress HTTP status codes](/errors/http/403/wordpress) [Do Run a free site audit Free, about two minutes](/site-audit)

Other 404 errors
[404 Not Found in Django](/errors/http/404/django) [404 Not Found in Flask](/errors/http/404/flask) [404 Not Found in IIS](/errors/http/404/iis) [404 Not Found on Apache](/errors/http/404/apache) [404 Not Found on nginx](/errors/http/404/nginx)

Nearby in errors
[HTTP 405 Method Not Allowed](/errors/http/405) [405 Method Not Allowed in Apache](/errors/http/405/apache)

More in 404 Not Found
[404 Not Found caused by .htaccess](/errors/http/404/htaccess) [404 Not Found in Django](/errors/http/404/django) [404 Not Found in Flask](/errors/http/404/flask) [404 Not Found in IIS](/errors/http/404/iis) [404 Not Found in WordPress](/errors/http/404/wordpress) [404 Not Found on Apache](/errors/http/404/apache) [404 Not Found on nginx](/errors/http/404/nginx)

Terms on this page
[URL slug](/glossary/url-slug) [Search snippet](/glossary/snippet) [URL parameters](/glossary/url-parameters) [Soft 404](/glossary/soft-404)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
