# WordPress Permalinks Not Working? How to Fix 404 Errors on Posts and Pages

> Source: https://mykavo.app/blog/wordpress-permalinks-not-working  
> Author: Dakshesh  
> Published: 2026-11-15  
> Updated: 2026-11-14  
> Publisher: MyKavo (https://mykavo.app)  

## Summary

When your home page loads but every post and page returns a 404 error, WordPress permalinks are broken. Re-save the permalink settings first, then check .htaccess on Apache or the try_files rule on Nginx, and look for slug conflicts and plugins that changed the rewrite rules.

## Key takeaways

- If the home page works but posts return 404, the permalinks or server rewrite rules are broken, not the content.
- Re-saving Settings > Permalinks without changes rebuilds the rewrite rules and fixes most cases.
- Apache needs the WordPress block in .htaccess; Nginx needs try_files $uri $uri/ /index.php?$args.
- Migrations, slug conflicts and plugins that add custom post types are the usual triggers.
- Monitor individual posts, because broken permalinks leave the home page and uptime checks looking fine.

Your home page loads fine, but every post, page or category link shows "404 Not Found". Nothing is deleted: the content is still in wp-admin. WordPress simply cannot match the address to the post anymore.

This is a permalink problem, and it is one of the most common issues after a migration, a server change or a plugin update. Here is how to fix it, step by step.

## What permalinks are and why they break

Permalinks are the readable addresses of your posts, such as example.com/blog/my-post instead of example.com/?p=123. Behind the scenes, two things make them work:

1. **The web server** sends every request that is not a real file to WordPress's index.php. On Apache this is done by rules in the .htaccess file. On Nginx it is done by a try_files line in the server configuration.
2. **WordPress's rewrite rules** then match the address to a post, page, category or custom post type.

If either step fails, the server or WordPress cannot find the post and returns a 404 error.

## 1. Re-save your permalink settings

This fixes most cases and takes ten seconds:

1. Go to **Settings > Permalinks** in wp-admin.
2. Do not change anything. Click **Save Changes**.

Saving flushes and rebuilds WordPress's rewrite rules and, on Apache, rewrites .htaccess if WordPress is allowed to. Test a post again. If it works, you are done.

## 2. Check the .htaccess file (Apache and LiteSpeed)

If saving did not help, open .htaccess in the site's root folder with your host's file manager or SFTP. It is a hidden file, so enable "show hidden files" if you cannot see it. A standard WordPress site needs this block:

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

If WordPress is installed in a subfolder, RewriteBase and the last rule use that folder, for example /blog/ and /blog/index.php.

Common problems:

- **The file is missing**, often after a migration that skipped hidden files. Create it with the block above.
- **WordPress cannot write to it.** The permalink screen then shows a message asking you to update .htaccess yourself. Copy the rules from there.
- **Another plugin or a security rule broke it.** Rename the file to .htaccess-old, re-save permalinks to create a clean one, then add back only the rules you need.

If editing .htaccess causes a 500 error, the file has a syntax mistake. Our [500 internal server error guide](https://mykavo.app/blog/500-internal-server-error) explains how to find it.

## 3. Check mod_rewrite and AllowOverride

On your own server or VPS running Apache, .htaccess rules only work if the rewrite module is enabled and the site's configuration allows overrides. Make sure mod_rewrite is enabled and that the site's directory has AllowOverride All. On managed hosting this is already set; ask support if you are unsure.

## 4. Check the Nginx configuration

Nginx ignores .htaccess completely. If your host runs Nginx, the server block needs a location rule that passes requests to WordPress:

location / { try_files $uri $uri/ /index.php?$args; }

If you moved from an Apache host to an Nginx one, this rule is often the missing piece. On managed hosting, ask support to confirm it is in place.

## 5. Look for slug conflicts

If only some addresses return 404, two things may be competing for the same slug:

- A page and a category or custom post type with the same name.
- A post in the trash still holding the slug.
- A permalink structure that starts with %postname% and clashes with a page.

Rename one of them, empty the trash, and re-save permalinks.

## 6. Check plugins and custom post types

Plugins that add custom post types (products, events, portfolios) register their own rewrite rules. After installing, updating or switching such a plugin, its pages may return 404 until the rules are flushed. Re-save permalinks after any such change. If 404s started right after an update, see our guide to [WordPress plugin conflicts](https://mykavo.app/blog/wordpress-plugin-conflict).

## 7. After a migration: check the site address

When a site moves to a new domain or from http to https, check **Settings > General**. A WordPress Address or Site Address that still points at the old domain sends links to the wrong place. Our [website migration guide](https://mykavo.app/blog/website-migration) has a full checklist.

## Why broken permalinks hurt SEO

A post that returns 404 drops out of Google over time, and the links pointing to it stop passing value. When every post breaks at once, a site can lose most of its search traffic within days. Read more about [404 errors and SEO](https://mykavo.app/blog/404-error) and how to check [why a page is not indexed](https://mykavo.app/blog/page-not-indexed-by-google).

## How to prevent it

- **Re-save permalinks after migrations, server changes and plugin changes** that add new content types.
- **Copy hidden files** such as .htaccess when you move a site.
- **Do not change the permalink structure** on an established site without 301 redirects from the old addresses.
- **Monitor your key posts and pages**, not just the home page, because broken permalinks leave the home page working.

## Catch broken permalinks the same day

Broken permalinks are sneaky: the home page loads, so a simple uptime check reports that everything is fine while every post returns 404. [MyKavo](https://mykavo.app/) checks the pages you choose, including posts and product pages, and alerts you when one starts returning a 404 or another error. The free MyKavo WordPress plugin also records plugin, theme and core changes, so you can see what changed right before the 404s started.

## Frequently asked questions

### Why do my WordPress posts show 404 but the home page works?

The permalinks are broken. The server is not passing post addresses to WordPress, or WordPress's rewrite rules are outdated. Re-save Settings > Permalinks, then check .htaccess on Apache or the try_files rule on Nginx.

### How do I fix WordPress permalinks?

Go to Settings > Permalinks and click Save Changes without changing anything. This rebuilds the rewrite rules. If that does not work, restore the default WordPress block in .htaccess or add try_files $uri $uri/ /index.php?$args; to the Nginx configuration.

### Where is the .htaccess file in WordPress?

In the root folder of the site, next to wp-config.php. It is a hidden file, so turn on hidden files in your file manager or SFTP client to see it.

### Why did my permalinks break after a migration?

Migrations often skip hidden files such as .htaccess, move the site to a server with a different configuration such as Nginx, or leave the old domain in Settings > General.

### Does changing the permalink structure hurt SEO?

It can. Every old address becomes a 404 unless you add 301 redirects from the old addresses to the new ones. Change the structure only when needed, and redirect every old URL.

### How can I find out when my posts start returning 404?

Use a monitoring tool that checks individual posts and pages, not just the home page. MyKavo checks the pages you choose and alerts you when one returns a 404 or another error.
