Have you ever gotten the ‘404 page not found’ error when visiting a web page or a post through their regular URLs in WordPress?
There may be a few reasons why WordPress permalinks may not be working. Although it is mostly due to conflicts or setting issues.
Here we explain what are the causes of this issue and how we can fix it.
What Causes WordPress Permalinks Not Working?
As mentioned above there are a few solid possibilities that could break WordPress permalinks. Permalinks are simply the URLs of your posts, pages, and categories and they allow users and search engines like Google to access the content easily.
Permalinks don’t change unless you edit them. But what causes WordPress permalinks to break?
There are a few possibilities that could break permalinks in WordPress. Let us discuss in detail one by one.
Installing New Plugins
WordPress offers you the ability to add or remove functionality to WordPress. Plugins are very useful and even the most beginner WordPress user has at least 5 different plugins installed on WordPress.
Plugins are known to cause many issues and incompatibility in WordPress. Some plugins can conflict with other plugins, themes or even the WordPress itself.
Especially, new plugins are known to contain bugs. Thus, we recommend downloading plugins from verified websites or even the official WordPress website.
Installing new plugins can directly edit the .htaccess file and cause permalinks to break.
Permalinks are very useful and at the same time very fragile. Thus, whenever you update WordPress core files, plugins or themes, there’s always a possibility that the updates result in version confliction.
If the latest version of WordPress is not compatible with older plugins or themes, you may end up with broken permalinks. However, you have to update the core files as soon as they are released to make sure the security and performance are up to date.
If the permalinks are broken due to this reason, and there are absolutely no fixes for it, you will have to wait for your theme and plugins developers to release the latest version to work with the latest version of WordPress.
Migrating WordPress to a New Domain or Server
It is not unusual for permalinks to break after a site migration. While this is a normal occurrence, many WordPress beginners think their website is broken and don’t know how to fix this or don’t even know where to start.
As mentioned above, when you migrate WordPress to a new environment you won’t be able to access your website’s content unless you fix the broken permalinks.
Even implementing SSL can cause URL issues and ultimately you will see annoying errors and this alone can cause permalinks to break.
Besides, adding SSL to WordPress requires mild modification to the .htaccess file and this could break WordPress permalinks.
Restoring a WordPress Backup
Restoring a WordPress backup can cause WordPress permalinks to break and this will leave you with a lot of ‘404 page not found’ errors.
Even if you are using a WordPress backup plugin like Duplicator to backup or migrate your website, you could end up with a website with broken permalinks.
Changes in the .htaccess File
As you probably know the .htaccess file is the connection between you and the apache servers. This file is in charge of many commands including redirects, and even configuring the WordPress permalinks.
When we want to fix the WordPress permalinks not working issue, the first place you should check is the .htaccess file because as we said, it covers many functionalities. This file is usually a hidden file. Thus, you may not even know it exists on your server.
However, some plugins may apply some changes to this file and could cause many issues, amongst them it could break your website’s permalinks.
Besides, if you are not familiar with your server you might have accidentally deleted this file and ultimately, this causes permalinks to break.
How to Fix WordPress Permalinks Not Working?
Whether your WordPress permalinks are broken due to the reasons we mentioned above or not, let’s start the process of fixing them.
As you probably know by now, WordPress permalinks won’t change unless you edit them or they are edited by a plugin or update. Either way, they are very fragile. Even a simple bug in the WordPress Dashboard could break permalinks.
The first method to fix broken permalinks is by resetting them.
Here is how to reset WordPress permalinks:
Login to the WordPress Dashboard.
Hover over Settings and click on Permalinks.
If your permalinks are set to display day and name, change it to any other available options, for example, post name and click on Save Changes at the bottom of the page. Then, reselect the original option for example, in our case we have to reselect day and name and click on Save Changes.
Now, reload the website and check if you can access and posts or pages.
If the problem is gone you can stop reading this article, if it still exists, follow other methods below.
Check the .htaccess File
The .htaccess file is an important file in WordPress. This file can be found in the main directory where you have WordPress installed.
Usually, most hosting providers hide the dotfiles. Therefore, if you can’t find this file on your server, enable the option to show the hidden files on the server.
To do so, you can either access your web server via an FTP client or directly from the cPanel (hosting panel).
To check if the .htaccess file is the issue or not simply right-click on it and rename it to any other name but make sure you remember the name so you don’t lose the file. For example, you can rename it to .htaccess_old
By renaming the .htaccess file your WordPress won’t be able to detect it. Thus, it thinks as if this file is disabled. Now login to the WordPress Dashboard and reset your permalinks again (if you have forgotten how, follow the steps above).
Then, reload your website and check if the permalinks are working or not.
Keep in mind, by resetting the permalinks WordPress creates a new .htaccess file, therefore, there is no need to rename the old file back.
As mentioned above plugins can add or remove functionality to WordPress. However, some plugins can’t simply work well with one another. If this is the case, how do you fix this?
If you have recently installed a plugin, then you know for sure that the plugin is causing the WordPress permalinks to stop working. That’s good news, we will begin our diagnosis by deactivating the plugin that broke the permalinks.
Now, reset your WordPress permalinks as we have taught in the method above. Reload your website and check if you can access your posts or pages.
If the permalinks are working now, then you know what’s the problem and what’s causing it.
The best thing to do is to delete the plugin that’s causing the permalinks to break and download alternative plugins. Besides, it’s best to let the developers of the plugin know that their plugin is causing WordPress permalinks to break.
You can ask the developers or the WordPress community to see which plugins are conflicting with the installed plugin. Developers usually know which plugins aren’t compatible with their plugin.
Therefore, by asking them, they could tell you which plugin is causing the confliction and then you need to find an alternative plugin for the plugin in question.
If you don’t know which plugin is causing the issue, we recommend deactivating all plugins and reactivate them one by one to find the plugin that’s causing permalinks to break. Keep in mind, you need to reload your posts and reset permalinks after activating each plugin.
Edit the httpd.conf File
If you are using Apache as your main web server, your httpd.conf or sites-available or sitename.conf file needs editing. However, your web directory needs to allow the .htaccess file to override its configuration.
Keep in mind, to edit this file you need to have access to the server.
Change your web directory override rule and enable it. Simply copy and paste the code below in the directory:
<Directory /var/www/> AllowOverride All </Directory>
Make sure the path in the code matches your server’s path.
Enable mod_rewrite module
To enable the mod_rewrite module, simply type the code below:
$ sudo a2enmod rewrite
If you have enabled this module before, you will receive a warning. In this case, you will need to restart the server by using the following code:
$ sudo systemctl restart apache2
In this article, we talked about a few methods on how to fix the WordPress permalinks not working issue. If you are receiving the 404 page not found error in WordPress, there could be many issues. One of them is related to permalinks.
If your WordPress permalinks are damaged or broken, you won’t be able to access any content of your website. There are a few solid possibilities as to why permalinks break.
For example, installing a new plugin, updates, migrating WordPress to a new domain or server, restoring an old backup, and modifying the .htaccess file.
The fixes are pretty straight-forward. In this article, we mentioned a few solid fixes to the WordPress permalinks not working issue. They may seem basic but they are very effective and can resolve the issue.
If, however, you are using the Apache web server, then the issue can be fixed by enabling two modules or editing the httpd.conf file.
2 Comments Leave a Reply
You made hours researching the problem worth it. Changing “Allowoverride” to “all” helped me with 404 on all pages after changin permalinks structure!