Are you seeing a 401 error on your WordPress website? We can help you resolve it.
Here at Bobcares, we have seen several such WordPress errors as part of our Server Management Services for web hosts, WordPress users, and online service providers.
Today we’ll take a look at the cause of this error. Also, let’s see how our Support Engineers resolve it.
What Causes WordPress 401 Error to occur?
There are different reasons for this error to occur. It includes improper authentication while communicating with the WordPress hosting server.
For instance, if the website admin folder has password protection then not entering a password would throw this error message.
But, sometimes this error can occur even without adding any special password protection to the website.
Security measures are taken by hosting companies to protect your WordPress website also can be a cause for this error. These security measures start showing this error when the WordPress login pages are accessed frequently.
How to troubleshoot WordPress 401 Error
Here are some of the steps our Support Engineers follow to tackle this error message.
1. Remove Password Protection Temporarily
Sometimes, customers tend to forget the admin directory password. So it would be a great idea to disable this password protection from the login page.
These steps can work for a few of the hosting companies but not all.
First, we access the WordPress hosting cPanel and locate the Directory Privacy or Password Protected Directories icon.
Next, we browse to the wp-admin directory and click on it.
After that, the control panel will now display its password protection settings. We simply uncheck the box next to ‘Password protect this directory’ option and click on the Save button.
Then, we click on the Go Back button and scroll down to the bottom of the page. From here we delete the username we used to login to the password-protected directory.
Finally, this successfully disables password protection for the WordPress admin directory.
2. Clear Firewall Cache to fix 401 error
Some customers do use some Cloud-based WordPress firewalls like Sucuri or Cloudflare. So, when the firewall fails to communicate with the website, this error can occur.
So, we suggest our customers purge their cache in their respective firewall providers.
3. Deactivate All WordPress Plugins
Sometimes, the plugins would be a culprit. So by deactivating the plugin we can check if any plugin is causing the issue.
In order to deactivate the plugin, we log into the WordPress dashboard and go to the Plugin page and deactivate the plugins.
However, if we are not able to log into the dashboard then we can disable it via FTP.
For that, we first connect to the FTP and access the website folder and go to /wp-content/ folder and rename the plugins folder to plugins.deactivated. Renaming the plugins folder thus way will deactivate all WordPress plugins.
Now we can visit the WordPress website’s admin area and try to log in. If everything works fine, then this means that one of the plugins was causing the issue.
We then switch back to FTP client and once again rename the plugin’s folder to just plugins.
Next, we return to the WordPress admin area and go to the plugins page. Then we activate each plugin one at a time until er start seeing the 401 error again. This way we find the culprit plugin.
4. Switch to a Default WordPress Theme
A function within the WordPress theme may also cause some issues. So in order to find it out, we can temporarily switch to a default theme.
For that, we access the WordPress dashboard >> Appearance >> Themes page. Now if there is a default WordPress theme installed, then we can go ahead and activate it.
If there is no default theme then we install it and activate it.
After that, we try accessing the website and check if the error resolves. This way we can check if the theme is causing any issue.
[Need any further assistance in WordPress errors? – We’re available to help you]
Today, we saw how our Support Engineers troubleshoot this error.