WordPress Permalinks Not Working: Effective Steps to Resolve 404 Errors

Wordpress

WordPress permalinks not working?

Unexpectedly running into a 404 error on some of your pages?  It’s a sign of broken permalinks.

Broken permalinks are a common WordPress issue. This particular issue often occurs after installing or updating a plugin, or a theme. Other causes include changes in the .htaccess file, migrating to a new domain or server, restoring backups, etc.

The good news is that broken permalinks can be fixed. 

How To Fix Broken Permalinks In WordPress

You can fix broken permalinks in WordPress by resetting the permalink settings, replacing .htaccess file with default code, and sorting all conflicting plugins.

The broken permalink issue, or the β€œ404 error,” is one of the most common issues on a WordPress site. This can be caused by several issues which, in turn, can be fixed via simple steps.

The β€œ404 Page Not Found” error is quite common for those who use websites daily. It may be a harmless error for the user, and they may move on. However, it is a huge issue for the owner of a website.

This error means that you are facing an issue of a broken permalink, or a link to another website that is designed to remain unchanged. Before we suggest the steps to fix your broken permalink, you should understand the reasons why this error occurs.

Listed here are a few reasons why your site might be suffering from an issue of a broken WordPress permalink.

Below Steps To Fixing Broken Permalinks In WordPress

  1. Reset the permalink settings
  2. Replace .htaccess file with default code
  3. Sort all conflicting plugins

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.

Reasons Why A Permalink Might Be Broken

There are several triggers of broken permalinks.

If you are trying to find the root cause of your broken link, the following reasons could be playing an important role in causing the 404 error:

  • A new plugin installation pay cause interruption with your program files 
  • While restoring your backup files or during migrating WordPress to a different server or domain can result in a broken permalink.
  • Once you have updated a plugin, there might be a compatibility issue resulting in a 404 error
  • Any changes with your .htaccess file can result in a broken permalink 

Investigating these causes my involve looking through your website’s directory pages.

1. Reset The Permalink Settings

As obvious as it sounds, most people forget the first thing they need to do is to reset their permalink settings.

Double-checking your permalinks settings helps you save time and energy. If there is a small glitch in the settings, you can quickly get past it andΒ fix your broken link immediately.

Don’t be completely sure that there is no issue with your settings simply because you didn’t do anything recently. A small issue can occur while you were updating your software version or migrating your files. 

Changing your permalink settings is quite simple. Follow the steps mentioned below to quickly revert your permalink settings back to the standard ones. 

  1. Login to your WordPress Dashboard.
  2. Click on β€œPermalink Settings.” Once you get there, you need to change the settings away from standard settings. For instance, change it back to β€œnumeric.” 
  3. Once you have done this, you need to select a β€œstandard-setting” again and save changes. 
  4. Go back to your WordPress site, and check the post or the site pages. 

If the permalink is fixed, you can be thankful that the issue was nothing more than a slight glitch in your settings. However, if the issue persists, then you need to follow the next steps below to find the root cause of the problem and fix it.

2. Reconfigure the .htaccess File

The .htaccess is one of the core files thatΒ run your WordPress website. This file plays a useful role in carrying out several important tasks on your site. You can use it to add and customize several features on your website such as improving security and increasing traffic.

With the .htaccess playing some of the key roles on your website. There is a possibility that if this file is changed or altered in any way, it may lead to the much dreaded β€œ404 error.”

Here are a few steps that can help you sort your .htaccess file and replace it with a default one.Β 

# 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
  1. Select the β€œFile Manager” option through the hpanel. 
  2. Once you get there, select the domain you are using and click on β€œGo to File Manager.”
  3. You can now select the β€œpublic_html” folder and select β€œ.htaccess file.”
  4. Right-click on the file and rename it with a different name.
  5. Once you have renamed the old file, select the β€œNew File” icon and name the file β€œ.htaccess.” 
  6. Write the code below in your new .htaccess file and click on save. 

The above solution will most likely be able to solve your problem with the .htaccess file.

Once you have followed the steps above, go back toΒ your WordPress siteΒ and see whether the error occurs again.

If the issue is still there, go on to the next step.

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:

  1. 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.
  2. If you’re using another service, simply enable rewrite_module in Apache and then remember to restart the service or VPS.

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *