Are you having issues with broken permalinks? Have they stopped working and started causing 404 errors? You’ve come to the right place. In this article, we will have a look at some of the reasons why your WordPress permalinks may not be working and how to fix them.
Why WordPress permalinks might be broken?
There are several reasons why your permalinks may be broken:
- Conflicts with themes or plugins: Updating your themes and plugins is a must to keep your site safe and get the latest features. However, sometimes these updates can create conflicts with the permalinks
- WordPress core update: Similarly, updating WordPress can sometimes create the permalinks to stop working
- Restoring backup: When you restore a backup, it may create conflicts with the permalinks because the backup file might not be compatible with your current theme environment
- Change in file permissions: If the .htaccess file has the wrong permission, it may cause broken permalinks
- Migration to a new WordPress server or domain: Migrating a site or even implementing SSL can cause broken permalinks and 404 Page Not Found errors.
As there can be several causes, it’s not always that easy to figure out what’s causing problems with the permalinks.
Now that you better understand why your permalinks may be broken, let’s see how to fix them.
WordPress Permalinks Not Working? How to Fix Them
There are different ways to fix broken WordPress permalinks:
- Reset the permalinks
- Reconfigure the default .htaccess
- Solve conflicts with plugins/themes
- Verify the Apache configuration
In most cases, you won’t need to apply all of these solutions. The key is to find out what’s causing the problem and apply the best solution for that case.
In this section, we’ll show you all these four methods step-by-step, so you can fix your permalinks in no time.
1) Resetting the Permalinks
The simplest solution is to reset your permalinks settings. The good news is that you can do this from the WordPress dashboard and you don’t need any third-party tool.
To reset the permalinks, first, log in to your WordPress dashboard and go to Settings > Permalinks.
Then, you need to select one of the permalink structure options. For example, if you want to use a plain permalink structure, change it to post name structure or anything else and save the changes.
After that, select the plain permalink structure and save the settings again.
That’s it! You have updated the .htaccess file through the WordPress settings. Sometimes there are glitches in the settings and by simply doing this you may solve the issue. Keep in mind that if you’re using a caching plugin, you’ll also need to clear your site cache.
After that, go to any page on your site and check the permalinks. If the permalinks are working correctly now, it’s all fixed. Otherwise, you may see a 404 Page and you’ll have to try the next solution.
2) Reconfigure the .htaccess File
If resetting the permalinks didn’t work, you can try reconfiguring the .htaccess file. You can easily do this if you have cPanel or FTP access.
One of the reasons why permalinks may be broken is because the .htaccess file has an error and you need to replace it with a new one. In this section, we will show you how to reconfigure the .htaccess file the right way.
First, in your cPanel, go to the File Manager section and open the public_html folder. There, you will see the .htaccess file. If you don’t see it, enable the option to see hidden files.
Right-click on it, select Rename and change its name to something else. For example, .htaccess_old.
After that, create a new .htaccess file and call it .htaccess.
Then, paste the following code inside it and save it.
# 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
This will create the default content of the .htaccess file and help you reconfigure it.
Now go back to your site and check if the WordPress permalinks are working. If you still have issues, move on to the next solution.
If you think your .htaccess file has other issues, check out our guide on how to fix the .htaccess file in WordPress.
3) Solve conflicts with Plugins/Themes
Sometimes a plugin or theme can generate conflicts that may cause the WordPress permalinks to break or stop working. The good news is that finding the faulty plugin/theme isn’t hard. All you need to do is deactivate your plugins and then activate them one by one. Let’s see how to do that.
First, log in to your WordPress dashboard and go to Plugins. Then, you need to deactivate all your installed plugins. For that select them, select Deactivate from the dropdown and click Apply.
Now all your plugins will be deactivated.
After that, go to your site and check whether the permalinks are working. If you don’t see any errors, it means that one (or more) plugins were causing the issue. So now activate the plugins one by one and check your permalinks until you find the one that’s generating problems.
Once you find the faulty plugin, contact their support team and ask them for help.
If you’ve tried all the solutions above but your WordPress permalinks are still not working, the Apache server might be the issue.
4) Verify the Apache configuration
Sometimes Apache web servers can have issues with permalinks. Apache comes with a security module called Mod_security. If you have enabled it on your site, permalinks might be broken. All you need to do to solve it is disable it from your cPanel.
If you are unsure about this extension, you can ask your web hosting support team to disable it.
Once the Mod_security module is disabled, save the permalinks again and the error will be gone.
This is how you can fix the issues with the permalinks on an Apache server.
NOTE: Most times these solutions will fix the problem but if they don’t, you may need to try something else. Sometimes people overlook the Apache override permission. If that’s not set, the .htaccess won’t be invoked, so the changes in the permalinks won’t have any effect. To fix that, you should set a directive for the directory your site is being served from.
Sometimes this won’t be possible, but if you have control over the configuration of the HTTPD server, try the following code in httpd.conf or apache2.conf:
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Once that is set, restart the service, and your permalink should work again.
NOTE: Sometimes the above solution may not work because the directive mod_rewirte is missing. There are two ways to allow the mod_write module:
- Type sudo a2enmod rewrite in the terminal to trigger the mod_write module and then restart Apache to apply the changes by typing sudo systemctl restart apache2 in the terminal.
- If you’re using another service, simply enable rewrite_module in Apache and then remember to restart the service or VPS.
What Problems can Broken Permalinks cause?
Now that you know how to fix issues with permalinks, let’s better understand some of the problems they can cause on your website.
Issues with the Add to Cart Button
When running an online store, if the WordPress permalinks aren’t working they may cause conflicts with the Add to Cart button on the shop or individual product pages.
As you probably know, the Add to Cart button is a key element for every WooCommerce shop, so if you’re having problems with the permalinks, you should fix it as soon as possible.
If your Add to Cart button is not working, change the permalinks structure and save it. After that, revert to your preferred structure and save the settings again. This way, you can fix most issues. For more information on how to fix issues with the Add to Cart button, check out this guide.
WooCommerce Shop Page Empty
Sometimes, the default WooCommerce shop page won’t show any products because of issues with the WordPress permalinks not working. Your shop page is where your customers find all the available products to purchase. If that page isn’t working properly, it can negatively affect your sales and conversions.
If this is your case, reconfiguring the permalinks can help you fix this problem. Similar to what we did before, simply go to the Settings > Permalinks, make a change, and save the changes. Then, select your preferred permalink structure and save it again.
After that, check your shop page. If you are still having issues, clear your browser cache and the permalinks should work again.
For more information about how to solve this issue, check out our guide on how to fix the Shop Page empty.
How to Check Broken Links In WordPress
Apart from fixing WordPress permalinks, you should also check broken links that redirect users to 404 pages. If you have a site with hundreds of pages/posts, finding broken links manually can be challenging and time-consuming. For those cases, using a dedicated plugin is the best solution.
There are several tools for this, but we recommend Broken Link Checker. It’s a free plugin that even though it hasn’t been updated for a while, still works with the latest versions of WordPress.
First, you need to install and activate Broken Link Checker. Log in to your WordPress dashboard, and go to Plugins > Add New. Look for the plugin and then install it and activate it as shown below.
Once you have activated the plugin, you will see its configuration under the Settings.
You will see five tabs there:
- General
- Look for links in
- Which links to check
- Protocols and APIs
- Advanced
General Settings
Here you can find the total link count and broken links.
The tool will check for broken links according to the interval that you specify. By default, it’s 72 hours, but you can adjust it depending on your needs. If you post a lot of content every single day, you may want to check the links every 24 or 48 hours.
Look For Links In Settings
From the Look for Links In tab, you can select your target pages to look for broken links. Typically, you will look for broken links in the blog posts, pages, comments, and custom posts.
Which Links to Check Settings
From the Which Links to Check section, you can choose the link type you need to check: from HTML links and images to YouTube videos or playlists, Vimeo videos, and much more.
Protocols & API Settings
Protocols & API Settings will help you to identify broken links through third-party APIs.
Advanced Settings
Finally, the Advanced Settings will display every additional configuration options you want to know such as timeout, maximum execution time, and more.
Once you have configured these options, remember to save the settings.
From now on, the plugin will automatically check for broken links according to the specific interval you set. When the plugin finds broken links, you will see them in the dashboard and you will be able to update them.
Conclusion
All in all, there may be several causes that create problems with your permalinks, so it may not be easy to find a solution. Apart from providing users with a bad customer experience, this can also cause issues with your shop page and Add to Cart button.
In this guide, we’ve seen what can cause the WordPress permalinks to stop working and what to do to fix it. If you’re facing problems with broken permalinks, we recommend you try these solutions in order:
- Reset the permalinks
- Reconfigure the default .htaccess
- Solve conflicts with plugins/themes
- Verify the Apache configuration
We hope you have found this article and learned something new. If you did, please consider sharing this post with your friends and fellow bloggers on social media.
Which method did you use to fix your permalinks? Do you know any other solutions that we should add? Let us know in the comments below.
3 Comments
Add comment Cancel reply
You must be logged in to post a comment.
Thank you for this informative article. I got valuable information here.
Glad you found our article helpful.
I had problem with permalinks. Becouse I have own ubuntu server, my solutions was stop modul rewrite. Just write in linux terminal on your server: a2enmod rewrite. After It, everithing is fine. Google link on my website work, and link in website too. Second solution can help, change menu and link on button in admin website… Restart or change .htaccess was’t profitable for me.