The 401 Unauthorized error is one of the most annoying and troublesome WordPress error messages. Not only does this error message make it difficult for website visitors, but it can also make it difficult for website owners.
If you are a visitor to the website, this error message will prevent you from logging into the website. You will not be able to enjoy the features on the website. In addition, for website owners, you will not be able to enter the admin dashboard of your own website.
Although Error 401 is troublesome, you don't need to worry. We'll explain what causes it and how to resolve it for you.
To know more about what error 401 is, what causes it, and how to resolve it, let's take a look at the breakdown of Error 401 below!
Here's what causes Error 401 to appear on WordPress websites:
- URL Expiration. There is a URL error, as it has been updated.
- Plugin. It could be due to a security plugin that has a firewall.
- Tema. The theme you are using may be the cause.
- Credential Login. Error in entering login information.
- Cache and Cookies. Cache and Cookies information in the browser is outdated.
- Server Issues. Web server errors, this can happen when the hosting service provider is taking security measures to prevent cyber attacks.
- IP Restrictions. IP addresses that are blacklisted for suspicious behavior.
How to resolve Error 401
To fix the 401 error, there are several ways or methods you can use, according to your status. Below are some ways to resolve error 401. You can check one by one in no particular order according to the methods below.
1. Checking Internet Connection
An internet connection is the main prerequisite for you to access the website. You need to make sure your internet connection is not having any problems. You can do a Google Ping to check your internet connection.
- Type CMD in the Windows search bar. To run the Command Prompt, click Open.
2. Clear Browser Cache and Cookies
If you can access the website normally using a different browser, then you need to clear the Cookies and Cache on the browser.
- Open the browser you are using. In this guide we are using Google Chrome. Then, click the three-dot icon (⋮) on the top right to display the browser menu. Select the History menu.
3. Temporarily Disable All Your WordPress Plugins and Themes
WordPress themes and plugins can also cause 401 errors. In most cases, the error occurs after updating or installing new plugins and themes. Don't use beta versions of themes or plugins as these are usually still under development and have many issues.
Once the 401 error disappears, you can reactivate plugins one by one to find out which plugin is causing the Unauthorized Error.
You can deactivate all plugins by going to the Plugins menu from the dashboard > click Bulk Plugins > select Deactivate from the drop down menu that appears > click the checkbox on Plugins to automatically select all your plugins > click Apply.
You can disable all plugins through cPanel. Login to your cPanel hosting > Find the File section and click File Manager > Select your domain root then search for the public_html file > find the domain name/subdomain that you installed > wp content > Themes/Plugin > Rename by adding -disabled. Do it one by one in turn.
Don't worry, deactivating all plugins will not delete your existing data.
4. Clear WordPress Cache
Just like the browser cache, the WordPress cache aims to speed up access to your website. However, sometimes the WordPress cache doesn't immediately update the settings or changes you've made. This is what leads to the 401 Unauthorized error.
As such, you'll need to clear the WordPress cache manually. To delete your WordPress cache, you can use the WordPress Super Cache plugin (WP Super Cache). To delete cache with WP Super Cache, login to Dashboard > select Settings menu > click WP Super Cache > press Delete Cache button under Delete Cached Pages.
5. Flush DNS
Operating systems can also cache a DNS. The stored cache may be the cause of the website experiencing Error 401. Just like the browser cache, you can also delete it.
1. Type CMD in the Windows search bar. To run the Command Prompt, click Open.
2. At the Command Prompt, type the command ipconfig /flushdns and press Enter to execute the command.
3. You have successfully cleared your DNS Cache. Try accessing your website again. If you can't access your website, continue to the last step.
Conclusion
There are several ways to solve the 401 Unauthorized error, depending on your status as a visitor or website owner. Some of the ways that can be done to resolve error 401 are:
- Checking the internet connection
- Membersihkan cache browser dan cookie browser
- Deactivate all WordPress plugins and themes
- Clearing the WordPress cache
- Flush DNS
After reading the description above, you don't need to worry anymore if the Unauthorized Error message reappears. Now that you know what causes it and how to resolve it, you can easily resolve error 401.