Did you recently change your WordPress permalink settings, and now your posts or pages show a 404 error? You’re not alone.
This is one of the most common WordPress issues beginners encounter. Usually, the homepage continues to work, but individual posts, pages, categories, or products suddenly display:
- 404 Not Found
- Page Not Found
- The requested URL was not found on this server
The good news is that this problem is often easy to fix.
In this guide, you’ll learn why WordPress 404 errors happen after permalink changes and how to restore your website step by step.
What Causes a WordPress 404 Error After Changing Permalinks?
WordPress uses permalink settings to generate URLs for posts and pages. When you change permalink settings, WordPress updates its URL structure and rewrite rules. Sometimes those rewrite rules don’t update correctly.
As a result:
- Homepage works
- Admin area works
- Posts return 404 errors
- Pages return 404 errors
- Category archives break
- WooCommerce products disappear
Most cases are caused by:
- Corrupted .htaccess file
- Rewrite rules not updating
- Plugin conflicts
- Incorrect server configuration
- Migration issues
Let’s start with the easiest fixes first.
Before You Start
Before making any changes:
- Create a backup of your website.
- Write down your current permalink settings.
- Keep File Manager or FTP access available.
This allows you to restore changes if needed.
Solution 1: Resave Your Permalink Settings
This is the simplest and most effective fix.
Step 1: Log into WordPress
Navigate to:
yourdomain.com/wp-admin
Step 2: Open Permalink Settings
Go to:
Settings → Permalinks
Step 3: Save Changes
Without changing anything:
Click:
Save Changes
What Should Happen?
WordPress automatically rebuilds its rewrite rules. Now visit a post or page that previously showed a 404 error. If it loads correctly, the problem is solved. If not, continue to the next solution.
Solution 2: Regenerate the .htaccess File
A corrupted .htaccess file is one of the most common causes of permalink-related 404 errors.
Step 1: Open File Manager
Log into your hosting control panel or cPanel.
Open:
File Manager
Navigate to:
public_html
Step 2: Locate .htaccess
Find:
.htaccess
If you don’t see it:
Enable:
Show Hidden Files
Step 3: Rename the File
Rename:
.htaccess
to:
.htaccess-old
Step 4: Generate a New File
Return to:
Settings → Permalinks
Click:
Save Changes
What Should Happen?
WordPress creates a fresh .htaccess file and clears the permalink cache. Test your posts and pages again.
Solution 3: Verify Apache Rewrite Module Is Enabled
If you’re using Apache hosting, WordPress requires mod_rewrite.
Without it, permalink structures won’t work correctly.
How to Check
Ask your hosting provider:
Is mod_rewrite enabled on my hosting account?
Most hosts enable it by default.
What Should Happen?
If mod_rewrite was disabled, enabling it should immediately restore permalink functionality.
Solution 4: Disable Plugins
Some plugins modify permalink structures.
Examples include:
- Security plugins
- Redirect plugins
- SEO plugins
- Custom URL plugins
If You Can Access WordPress
- Go to Plugins.
- Deactivate all plugins.
- Test your pages.
If You Cannot Access WordPress
Using File Manager:
Navigate to:
wp-content/plugins
Rename:
plugins
to:
plugins-disabled
What Should Happen?
If the pages start working, a plugin is causing the problem. Reactivate plugins individually until the issue returns.
Solution 5: Check Custom Rewrite Rules
Developers sometimes add custom rewrite rules through:
- functions.php
- Custom plugins
- Child themes
If the problem started after adding custom code: Review recent changes carefully.
Look for:
add_rewrite_rule()
or
flush_rewrite_rules()
functions.
What Should Happen?
Removing the problematic code should restore normal URL behavior.
Solution 6: Check Website Migration Settings
Many 404 errors occur after:
- Moving to a new host
- Changing domains
- Restoring backups
Verify:
WordPress Address
Go to:
Settings → General
Check:
WordPress Address (URL)
Site Address
Verify:
Site Address (URL)
Both should match your current website.
What Should Happen?
Incorrect URLs can prevent WordPress from generating proper links. Correcting them may immediately fix broken pages.
Solution 7: Restore the Default .htaccess Rules
If WordPress cannot generate the correct .htaccess file automatically, create one manually.
Replace the contents of .htaccess with:
# 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.
What Should Happen?
Refresh your posts and pages.
Most permalink-related 404 errors disappear immediately after restoring the default rules.
Frequently Asked Questions
Why does my homepage work but posts show 404 errors?
This usually means WordPress rewrite rules are broken. Resaving permalinks often fixes the problem.
Will changing permalinks hurt SEO?
Changing permalink structures can affect rankings if redirects aren’t implemented properly. Always create redirects when changing existing URLs.
Can a plugin cause permalink issues?
Yes. Security, redirect, and SEO plugins are common causes.
Does WordPress need .htaccess for permalinks?
On Apache servers, yes. Without a properly configured .htaccess file, permalink URLs often fail.
Related WordPress Errors
WordPress permalink problems often appear alongside other issues. If you’re seeing additional symptoms, these guides may help.
WordPress 403 Forbidden Error
Incorrect .htaccess rules can trigger both 403 and 404 errors.
WordPress 500 Internal Server Error
Server configuration issues sometimes affect permalink processing.
WordPress Critical Error Fix
Plugin conflicts can cause both permalink failures and critical errors.
WordPress White Screen of Death
Fatal PHP errors may prevent WordPress from generating URLs correctly.
WordPress Memory Exhausted Error
Large plugins that modify URLs may consume excessive server resources.
Error Establishing Database Connection in WordPress
Broken database connections can prevent WordPress from loading content properly.
Conclusion
WordPress 404 errors after changing permalinks are usually caused by broken rewrite rules or corrupted files. htaccess files, plugin conflicts, or migration issues.
Start by resaving your permalink settings and regenerating your .htaccess file. Then investigate plugins, server settings, and custom rewrite rules if the issue persists.
In most cases, these simple troubleshooting steps will restore your posts and pages within minutes.

