How to Fix Broken Permalinks in WordPress
John Turner
John Turner
I still remember the first time I logged into a client’s site and saw nothing but 404 errors. Every single page—gone. Or at least, that’s what it looked like.
Broken permalinks are one of the most common WordPress problems, and they almost always look worse than they actually are.
In this post, I’ll show you how to fix broken permalinks, starting with the simplest fix and working up to the more technical stuff.
Most of the time, you’ll have this resolved in under five minutes!
Here are the key takeaways:
- Broken permalinks make all posts and pages return 404 errors.
- Your content is still safe in the database, but WordPress just can’t route traffic correctly.
- Common causes include plugin conflicts, site migrations, corrupted .htaccess files, and incorrect file permissions.
- The fastest fix: Go to Settings » Permalinks and click Save Changes without changing anything.
- Always clear all caches after attempting a fix—browser cache, plugin cache, server cache, and CDN cache.
- If simple fixes don’t work, check for plugin/theme conflicts by deactivating everything and testing.
- Prevent future issues by using staging sites for updates, never changing your permalink structure after launch, and maintaining regular backups.
Table of Contents
What Are WordPress Permalinks?
A permalink is the permanent URL structure for your posts and pages. It’s what shows up in your browser’s address bar when someone visits your content.
WordPress gives you two main options for how these URLs look.
The first is what I call “ugly” permalinks. They look like this: https://yoursite.com/?p=123. They work fine technically, but they’re terrible for both humans and search engines.
The second option is “pretty” permalinks. These look like: https://yoursite.com/how-to-fix-broken-links/. A clear, keyword-rich URL performs better than a string of random numbers.
Pretty permalinks matter for two big reasons.
- They help visitors understand what a page is about before they even click.
- Google and other search engines use URL structure as a ranking signal.
How Do You Know If Permalinks Are Broken?
When I say “broken permalinks,” I’m talking about when WordPress suddenly can’t process these pretty URLs anymore.
Your content is still there in the database. WordPress just can’t route traffic to it correctly, so everything returns a 404 error instead.
The symptoms are usually pretty obvious. Your homepage loads fine, but every individual post and page returns a 404 error. When you click on any internal link, you get the “Page Not Found” message instead of your content.
Your WordPress admin dashboard still works perfectly. You can log in, see all your posts and pages in the backend, and everything looks normal there. But on the front end? Nothing but 404s.
Sometimes you’ll see this happen immediately after a specific action, like migrating your site, updating a plugin, or changing a server setting. Other times it seems to come out of nowhere.
It affects all your posts and pages at once, not just one or two random URLs. That’s how you know it’s a permalink problem and not just a few broken links.
Why Are Your Permalinks Broken?
Broken permalinks don’t just happen randomly. There’s almost always a specific trigger.
Plugin or Theme Conflicts
A new plugin or theme can mess with WordPress’s URL rewrite rules.
I once installed a security plugin that immediately broke every link on a site. The plugin was trying to add its own rewrite rules and ended up overriding WordPress’s core rules instead.
This happens more often than you’d think, especially with plugins that handle redirects, caching, or security features.
Site Migrations or Restores
When you move a site from one server to another, the .htaccess file (which controls how permalinks work) doesn’t always transfer correctly. Servers have different configurations, and what worked on your old host might not work on your new one.
Corrupted .htaccess File
The .htaccess file lives in your WordPress root directory and tells your server how to handle URLs.
Sometimes, plugins edit this file and directly cause broken permalinks. Other times, your manual changes could go wrong.
Either way, if the rewrite rules in that file get corrupted or deleted, your permalinks stop working.
SSL/HTTPS Issues
If you recently added an SSL certificate and switched your site to HTTPS, you might be dealing with redirect loops or mixed content issues that look like broken permalinks. The symptoms are similar, even though the root cause is different.
How to Fix Broken Permalinks in WordPress
Here are the best ways to fix broken WordPress permalinks:
- Reset permalinks (Settings » Permalinks » Save Changes)
- Clear all caches (browser, plugin, server, and CDN)
- Deactivate plugins and switch themes to find conflicts
- Check .htaccess file permissions (should be 644)
- Verify server configuration (mod_rewrite enabled on Apache)
- Check SSL settings match in Settings » General
- Manually regenerate .htaccess file if needed
- Contact hosting support or WordPress experts for complex issues
Reset Your Permalinks in wp-admin
WordPress has a built-in way for you to fix broken permalinks through the dashboard. You’ll save your permalink settings again, which makes WordPress regenerate its .htaccess file.
This fix works in most cases, and it takes less than 30 seconds. I’ve used it dozens of times, and it never stops feeling like magic.
Log into your WordPress admin dashboard and navigate to Settings » Permalinks. Don’t change anything. Just scroll down and click the Save Changes button.

WordPress regenerates your .htaccess file with fresh rewrite rules. Even if you didn’t change any settings, the act of saving forces WordPress to rewrite those rules from scratch.
Nine times out of ten, your site is fixed at this point. If not, keep reading.
Clear Your Cache
Before you assume the permalink reset didn’t work, clear every cache on your site.
Start with your browser cache. In Chrome, you can do this by clicking the three-dot icon and Delete Browsing Data.

Select Cached images and files and hit Delete data.

Then clear your caching plugin. If you’re using WP Rocket, W3 Total Cache, or any other caching plugin, find the Clear Cache button in your WordPress admin bar or the plugin settings.

Don’t forget server-side caching. Many hosts have their own caching layer. Check your hosting control panel for a cache-clearing option.
If you use a CDN like Cloudflare, you’ll need to purge that cache too.
I’ve seen situations where the problem was actually fixed after step one, but cached pages kept showing 404 errors for hours. Clear everything, then test again.
Deactivate Conflicting Plugins or Themes
If resetting permalinks didn’t work, you’re probably dealing with a plugin or theme conflict.
You’ll want to check your plugins first. Deactivate all of your plugins to see if the issue disappears.

Now test your site. Do the links work?
If so, you’ve confirmed a plugin conflict. Reactivate your plugins one by one, testing after each activation, until you find the culprit.
If your links still don’t work with all plugins deactivated, try switching to a default WordPress theme like Twenty Twenty-Five. Go to Appearance » Themes, activate a default theme, and test again.

When you find the conflicting plugin or theme, you have a few options:
- Check if there’s an update available that might address the issue.
- Look for alternative plugins that do the same job.
- Contact the developer’s support team.
Check File Permissions
WordPress needs write access to your .htaccess file to update it automatically. If the permissions are wrong, WordPress can’t write the new rewrite rules when you reset your permalinks.
The correct file permissions are:
- Files (including .htaccess): 644
- Folders: 755
You can check this through an FTP client like FileZilla or through your hosting control panel’s File Manager.
Right-click on a file and select File Permissions. You’ll see a dialog box with checkboxes.

For 644, you want:
- Owner: Read + Write
- Group: Read only
- Public: Read only
If the permissions are wrong, change them and then go reset your permalinks again using the Settings » Permalinks method.
Verify Server Configuration
This is where things get more technical.
If you’re on an Apache server (which is most shared hosting), you need the mod_rewrite module enabled. This module allows pretty permalinks to work in the first place.
Most hosts enable this by default, but not all of them.
If you’re on Nginx, that’s a different story. Nginx doesn’t use .htaccess files at all. It handles URL rewrites through its own configuration files, which means you can’t fix this yourself through WordPress.
Contact your hosting support if you suspect a server configuration issue. Tell them you’re getting 404 errors on all posts and pages, and ask them to verify that mod_rewrite is enabled (for Apache) or that the permalink rewrite rules are configured correctly (for Nginx).
Hosting support teams have seen this a hundred times and can fix it in minutes.
Check for SSL Issues
If you recently moved to HTTPS, this might not be a permalink problem at all.
Go to Settings » General in your WordPress dashboard.
Look at two fields:
- WordPress Address (URL)
- Site Address (URL)
Both should match exactly. And if you have an SSL certificate, both should start with https:// (not http://).

If they don’t match, update them. But be careful here—if you get this wrong, you can lock yourself out of your site. Make a backup first.

If you see a redirect loop after fixing this, you might also need to update your .htaccess file to force HTTPS redirects correctly.
Manually Regenerate htaccess File
If nothing else has worked, it’s time to manually create a new .htaccess file.
Connect to your site via FTP and navigate to your WordPress root directory. Find the .htaccess file and download a copy to your computer as a backup.
Rename the file on the server to .htaccess_old.

Go to Settings » Permalinks in WordPress and click Save Changes. WordPress should create a brand new .htaccess file with the default rewrite rules.
If WordPress can’t create the file automatically (due to permissions), you’ll need to create it manually. Create a new file called .htaccess and paste this code:
# 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
Upload that file to your WordPress root directory, making sure the permissions are set to 644. Test your site again.
Get Expert Help
If you’ve tried everything above and your permalinks are still broken, the issue might be deeper than a standard fix can handle. It could be a database problem, a bad server configuration, or something else entirely.
Your first call should be to your hosting support team. Most hosts have WordPress specialists who can dig into server logs and identify issues you can’t see from the WordPress admin.
If your host can’t help (or if you’re on a host with minimal support), consider reaching out to a WordPress maintenance service. WPBeginner offers premium WordPress support that can handle issues like this.

Sometimes paying an expert for 30 minutes of their time saves you hours of frustration.
How to Prevent Permalinks from Breaking in the Future
Fixing broken permalinks once is annoying. Fixing them repeatedly is a nightmare.
Here’s how to avoid dealing with this issue again.
Use a Staging Site
Test everything on a staging site before you touch your live site.
Plugin updates, theme changes, and major WordPress core updates should go through staging first. If something breaks your permalinks (or anything else), you’ll catch it before real visitors see 404 errors.
Duplicator Pro makes this simple. Create a full backup of your production site, then drag and drop that WordPress backup file into your staging environment. It sets up a complete clone automatically, including the database and all your files.

I do this before every major change now. It’s saved me more times than I can count.
Avoid Changing Permalink Structure
Once your site is live and indexed by Google, don’t change your permalink structure.
I know the temptation. Maybe you started with /?p=123 and now you want pretty URLs. Or you want to remove the date from your post URLs.
But here’s what happens: every single URL on your site changes. Every backlink pointing to your content breaks. Your Google rankings tank because those indexed URLs now return 404 errors.
If you absolutely must change your structure, you need to set up 301 redirects for every old URL. That’s doable with plugins like AIOSEO or Redirection, but it’s tedious and error-prone.
Just pick a good permalink structure from the start and stick with it. I recommend Post Name (/sample-post/) for most sites. It’s clean, SEO-friendly, and flexible.
Create Regular Backups
A recent backup is your ultimate safety net.
If something breaks, you can restore a backup and be back online in minutes. Without a backup, you’re stuck troubleshooting with no easy way out.
I recommend setting up automatic backups with Duplicator. Schedule them to run overnight when traffic is low. Store the backups off-site (not just on the same server as your website).

Here’s my backup rule: if you’d worry about losing the work from the past 24 hours, back up daily. If you’d worry about losing the past week, back up weekly.
Frequently Asked Questions (FAQs)
Where do I find permalinks in WordPress?
Go to your WordPress dashboard and navigate to Settings » Permalinks. That’s where you can view and change your site’s URL structure.
How do I add a permalink in WordPress?
WordPress generates permalinks automatically when you publish content. If you want to customize the URL slug for a specific post or page, you can edit it in the post editor by clicking on the permalink section in the sidebar or below the title.
Do changing permalinks break pages?
Yes, absolutely. When you change your permalink structure, every URL on your site changes, which breaks all existing links from search engines, social media, and other websites pointing to your content.
How do I fix WordPress broken links?
If all your posts and pages return 404 errors, that’s a permalink problem—follow the troubleshooting steps earlier in this article. If only specific links are broken, use a plugin like Broken Link Checker to scan your site and manually update or redirect those URLs.
How do I flush permalinks in WordPress?
Go to Settings » Permalinks and click Save Changes without making any modifications. This flushes the old rewrite rules and regenerates them from scratch.
Keep Your Site Links Healthy
Broken permalinks feel catastrophic when they happen. Your entire site suddenly returns 404 errors, and it looks like everything is gone.
But in most cases, your content is fine. WordPress just can’t route traffic correctly because the rewrite rules got messed up.
The methodical approach works: reset permalinks first, clear caches, check for conflicts, verify permissions, and escalate from there if needed.
And once you’ve fixed the problem, take steps to prevent it from happening again. Use staging sites for testing. Don’t change your permalink structure on established sites. Keep regular backups.
If you’ve dealt with broken permalinks after moving a site, you know how frustrating it is. Duplicator Pro handles the server configuration and .htaccess adjustments automatically during migrations, which prevents most permalink issues before they happen.
The automatic backups also ensure you always have a recent restore point if an update causes problems. Try Duplicator Pro out today!
While you’re here, I think you’ll like these other hand-picked WordPress resources: