Imagine trying to update your website, but for some reason you cannot access your dashboard. Worse yet, you can't even get to your WordPress login page because a 401 error is preventing you from doing so.

HTTP error 401 means there is a problem with authenticating your browser's credentials. In this tutorial, we will describe what it means and what causes it. Next, we'll go through three ways to fix the problem so that we can access your dashboard again.

What is HTTP 401 error and what are the potential causes?

At some point you've probably tried to log into your WordPress dashboard and accidentally sent the wrong credentials. When this happens, you see an error page telling you that you made a mistake, but you can still access it by re-entering the correct username and password.

The 401 error is similar in that it involves you trying to access a website using the wrong credentials, but at a higher level. If your browser doesn't authenticate properly with your site's server, you won't even be able to get to the WordPress login page.

Instead, you will get an error page similar to the following:

WordPress 401 error

A 401 permission required error means that you can try to access the resource again using the correct credentials. In other words, it is often a temporary problem, unlike a HTTP error 403 in which you are expressly prohibited from accessing the page you hope to reach.

In some cases, a 401 error will go away on its own, giving you access to your website again. However, locking down your site, even briefly, is not practical. Instead of sitting around hoping your browser fixes the problem, you can take steps to get to the dashboard faster.

How to fix the 401 error in WordPress

The main problem with a 401 error is that it has several potential causes. So it's hard to know which one affects your browser. With that in mind, we'll be discussing several possible fixes so that you can find them out.

1. Clear your Domain Name System (DNS) records

In many cases, your computer will store data about the IP addresses and URLs that you access most often. This way he can process future requests faster.

Deleting your DNS involves deleting all of this temporary data from your computer. That way, the next time you try to access the problematic URL, it will make a brand new request and re-authenticate you.

The process for flushing your DNS varies from operating system to operating system. If you are a Windows user, it is as easy as opening the command prompt and typing the command ipconfig / flushdns :

Dump DNS records on a Windows machine.

Windows will return a success message and you can try to access your website again.

Mac users will need to go through a similar process, but the command you need to enter in Terminal varies depending on the version of OSX you are using. Users of the three most recent iterations (Sierra, High Sierra, and Mojave) can use sudo killall -HUP mDNSResponder .

2. Clear your firewall and browser caches

Browsers can also store data so that you don't have to load websites again each time you access them. This process is called cached. In some cases, you may inadvertently store incorrect login information.

If this is the root of your 401 error, correcting the error is simple. Most modern browsers allow you to clear your cache in a matter of minutes. With Chrome, for example, you can go to Settings> Advanced  and look for the option Clear browsing data  :

Then you can specify the data you want the browser to delete. Select option Cached images and files  and click on the button Erase data  :

Erasing images and files cached in Chrome.

Try to access your website again. If the problem persists, the error may be due to your firewall cache.

In some cases, your firewall may not be communicating with your server, resulting in authentication errors. The correction process will depend on the tool you are using.

If you are a user Cloudflare , you can go to your dashboard and go to the tab Caching. Inside you will find an option for Purge all , which includes your entire firewall cache:

Cloud flare purge all

Purging your firewall's cache will not affect its functionality. In the worst-case scenario, you might experience longer load times the next time you visit your site, but this should fix itself after rebuilding your cache.

If you are using another firewall tool, you will need to go through its documentation and check if it allows you to manually clear your cache. For some services, you may need to contact support instead.

3. Test the conflicts between your plugins and your WordPress theme

Compatibility issues with your plugins and WordPress theme can sometimes trigger a 401 error. Disabling one or the other element in order to determine the source of the conflict is simple if you have access to the dashboard.

Just click on deactivate under the name of any plugin:

Wordpress divi plugin

For your theme, switch to a WordPress default such as Twenty Nineteen or Twenty Twenty. You can then reactivate each plugin one by one and wait for the problem to reoccur. You should be able to narrow down the problematic element.

However, a 401 error can prevent you from accessing your dashboard. This means that in order to deactivate your plugins and your theme, you will have to use the File Transfer Protocol (FTP) and an FTP client such as fileZilla .

Once connected to your server, go to public_html> wp-content> plugins :

Rename divi plugins folder

Then rename the folder of each plugin by right clicking on it. Something simple like the plugin name _disabled will do. This will prevent WordPress from locating these folders.

After deactivating your plugins, go to your website again. If the 401 error is gone, it means that an incompatibility between one or more items was the root cause.

You can then go back to FileZilla to change the names of your plugins. Check your site between each. When the 401 error reappears, you will know that the last activated tool is the culprit.

Disabling themes works the same way. Go to wp-content / themes, search the folder of the one you are using and rename it:

Change the divi themes folder

A default theme will automatically be activated to replace it. Again, test your website to see if the 401 error persists. Otherwise, your theme might be part of the problem and you will have to look for alternatives.

Conclusion

It is not uncommon to encounter errors in your daily web browsing. Usually, it doesn't matter. However, it gets serious when the website that hits you with a 401 error code is yours. If you fail to resolve it, you may find yourself stuck for an extended period of time.

There are many ways to resolve an HTTP 401 error on your WordPress site. Some of the most successful approaches include:

  1. Purge your DNS records.
  2. Clear the browser firewall and caches.
  3. Testing for conflicts between your WordPress plugins and your theme.

One of the most reliable ways too may be to contact your web host.