8 Methods to Fix 401 Unauthorized Error

401 unauthorized
401 unauthorized

It can be said that this 401 Unauthorized error is one of the most annoying WordPress errors. How come? For visitors, you cannot login to the website and enjoy its features.

As for website owners, you cannot enter the admin dashboard from your own website. Annoying, right?


You really need to know how to fix WordPress 401 unauthorized or authorization required. You will not realize when it comes and when you experience the error, you will certainly be confused about how to solve it.

This 401 unauthorized error is often found on several types of websites, especially for websites that are already quite large.

If you have a website that is quite large and has a lot of visitor traffic, then don’t be surprised if you experience this.


Finding out how to fix an unauthorized 401 WordPress is very important to anticipate if it happens again. If you have learned how to deal with it, it will be easier to act when the website has an error like that. Some error displays may appear as follows:

  • “Authorization Required”
  • “401 Unauthorized”
  • “HTTP Error 401 – Unauthorized”
  • “disabled_client. The OAuth client was disabled”
  • “invalid_client”
  • “deleted_client” etc.


What is the 401 Unauthorized Error and What Causes It?

As the name suggests, the 401 Unauthorized error occurs because you do not provide proof of legal authority to access a website. Either it’s entered the wrong username and password or indeed you have not registered on the website.


However, in some cases, this 401 error still appears even though you have entered all the correct information, you know. Why did it happen? Here are some of the causes:

  • No Access

As a website visitor, you will not be able to access pages that are only intended for admins/website owners.

  • Plugin Issue

Some WordPress security plugins can lock the admin dashboard in the event of a brute force attack.

  • Protection from Hosting Providers

If your hosting provider detects a large number of logins at once, they will usually throw up a 401 error as a safeguard.

  • Denied Server

Even if all the information is correct, you are still rejected by the server. Maybe it’s because you’re banned or there’s a certain problem from the server side.


How to Fix WordPress 401 Authorization Required?

If you have a website that is quite popular, of course you will experience what is called a 401 authorization error, but don’t worry because here are some ways to fix it.


  1. Recheck URL

Not all websites give you the freedom to browse every page of the website. Indeed, pages that are not allowed to be accessed will not be displayed on the website, but sometimes website owners enter the wrong URL in one of the links.

As a result, you will be taken to a page/directory that should only be accessible by the website admin and a 401 error will appear.


So, double check your URL. Does the URL actually go to the page you want to go to? If not, we recommend that you return to the previous page and try clicking the link again.

If it still takes you to the same URL, you can contact the website owner to fix the link.


  1. Clear Cookies in Browser

Cookies are a collection of information about all your activities when browsing a website. This information includes the history of your authority on the website.


So, if the cookies on the website are corrupted, you will likely also encounter a 401 error. This is because your browser cannot provide the required authorization information when the website requests it. The solution to this problem is to clear cookies in your browser.


If you are using Google Chrome, you can delete cookies by clicking on the three-dot icon at the top right. After that, select More Tools – Clear Browsing Data in the pop up menu that appears.

Then, make sure that you have checked Cookies and other site data and that the Time Range option is on All Time. Finally, click the blue Clear Data button.

After successfully deleting browser cookies, you can re-open the website that previously displayed 401 Unauthorized.


  1. Clear Browser Cache

Cache is website files that are automatically saved by the browser when you first access the website. This cache is a technology that helps speed up website loading because the browser doesn’t have to download the same file over and over again.


Well, if the files stored in your browser cache do not match the latest version of the website, a 401 error can also appear. Therefore, you can try clearing the cache in your browser to resolve this 401 Unauthorized error.


For Chrome browser users, select the three dot icon at the top right, select the More Tools menu – Clear Browsing Data then you check Cached Images and Files, select Clear Data.


You also need to clear the cache in WordPress because sometimes the WordPress cache doesn’t immediately update the data changes/settings that you make, so it can bring up the 401 Unauthorized error.

It’s easy to use the WP Super Cache plugin, select the Contents tab and click Delete Cache.


  1. Temporarily Turn Off All Your Plugins

Error plugins or plugins with incorrect settings can also cause a 401 Unauthorized error on your website. Therefore, you must temporarily disable all installed plugins.


If after that the 401 error disappears, you can activate the plugins one by one to find out which plugin is causing the 401 error.


Turning off all the plugins in WordPress is very easy. You just enter the Plugin menu from the dashboard, click Bulk Plugin and select Deactivate from the drop down menu that appears. Then, click the checkbox on Plugins to automatically select all your plugins and click Apply.


However, if the 401 Unauthorized error occurs when you want to login (so you can’t enter the dashboard), you can use FTP to turn off all plugins. You just need to go to the /wp-content/ directory, then rename the plugins folder to plugins.deactivated.


  1. Use the Default WordPress Theme

Sometimes, the features of the theme you are using can be the cause of the 401 error. To fix this, you can switch to the default WordPress theme. Default themes are themes created by the WordPress team and have been optimized so as not to cause errors on your website.

The default WordPress themes have the names Twenty Twenty One, Twenty Twenty, Twenty Nineteen, Twenty Seventeen and so on.

If after changing the default theme the 401 Unauthorized error disappears, it means that the theme you used earlier was indeed the cause.


  1. Reset Your Password

Sometimes, hosting providers automatically block login access when a continuous login attempt is detected and a 401 error appears. So, if you forget your website password, we recommend using the Forgot Password feature to reset your password. This is better than trying to enter the password over and over again risking a 401 error.


If you use the Forgot Password feature, a link to reset your password will be sent to your email immediately. Just click the link and enter a new password. After that, you can try login again using the password you just created.


  1. Temporarily Delete Password Folder

If you give a password to a certain folder in cPanel, this solution can be tried. It’s possible that you forgot the password for this directory or the server settings have changed. So you have to temporarily delete the password and reset it later.


Go to cPanel, select the Directory Privacy menu which can be found in the Files section. Alternatively, you can also use the search feature. Once opened, you will find all the files and folders from your hosting account.

Select the folder for which you previously gave the password. Then, uncheck the Password protect this directory and click the Save button.


Finally, scroll to the bottom of the page and delete the username and password you provided in the folder. After that, you can try reopening the page that previously displayed the 401 error. If the 401 error has disappeared from that page, you can reset the username and password for the folder.


  1. bluehost3

    Contact Your Hosting Service

If all of the above doesn’t work, the last thing you can do is contact your hosting service. Maybe there really is a problem from their side or there is suspicious activity on your website.


This is because many hosting service providers automatically block all access to websites if suspicious activity is detected. As a result, you can’t do anything to get rid of the 401 error.

An experienced support team in WordPress such as from Bluehost web hosting will definitely help clear up the problems you face.


Fix Error 401 on Your Website Now

The 401 Unauthorized error is annoying, but there are ways to fix it so you don’t have to panic when you encounter this 401 error.

If you have tried the 8 steps above and have not succeeded, this is the step that maybe rarely discussed or thought of by webmasters.

401 Unauthorized2
401 Unauthorized2

Based on experience and doing trial and error for days there is one last important thing that you must do:

  • Please login to Google Search Console, select the “Sitemaps” menu on the left.
  • Click the list of sitemap files and select the 3 dots on the top right, click “Remove Sitemap“.
  • Perform these steps until all sitemap files are successfully removed.
  • When finished, select the Sitemap menu again, then “Add a new submit”.
  • Fill in your website sitemap, then click “Submit“.

Note: first you need to uninstall the WordPress plugin that contains the sitemap.xml.

1 thought on “8 Methods to Fix 401 Unauthorized Error”

Leave a Comment