Error 401: Unauthorized
Is your site suddenly asking for a username and password? Check right here whether it is locked for every visitor.
Checks the status code, every redirect, the variants with and without www and over http and https, the SSL certificate and the response time.
Free, no sign-up - no data about you is stored.
Result
Technical finding without guarantee. The check runs once from a server in Germany. If your website is only unreachable from certain networks or countries, the result may differ.
What does Error 401 mean?
A 401 means this page requires you to log in and the request didn't include valid credentials. Despite the name "Unauthorized", it's really about missing authentication: the server doesn't know who you are. It sends a WWW-Authenticate header, and the browser then shows the familiar grey login prompt.
The difference to 403: with a 401 you could get in with the right credentials. With a 403 the server knows who you are (or doesn't care) and refuses access anyway.
Common causes.
Server-side password protection
Directory protection via Basic Auth, set up with
.htaccessand.htpasswdor in the hosting panel, locks the whole site or a folder.Staging or test environment
Test sites are protected on purpose so Google and strangers can't see them. When the staging copy goes live, the protection sometimes comes along.
Wrong or changed credentials
The password was changed, saved incorrectly in the browser, or the user was deleted.
Protected admin area
Some hosts and security plugins add an extra password prompt in front of
wp-login.phporwp-admin.APIs without a valid key
APIs return 401 when a token or application password is missing, expired or wrong.
With WordPress and hosting.
On WordPress, a 401 for regular visitors almost always comes from the server, not from WordPress itself. A classic case is a staging site with directory protection that gets copied to the live domain via plugin or hosting tool, protection rules in .htaccess included. Suddenly every visitor sees a password prompt and Google only gets 401.
Via the REST API, WordPress returns 401 when a request needs authentication and has none. That affects apps, integrations with inventory or accounting systems, and the block editor when your session has expired. Some security plugins block the REST API for logged-out visitors entirely, which can break contact forms or third-party plugins.
How to fix it.
Check whether it's everyone
If the checker above returns 401, the site is protected for everyone. If it returns 200, it's your account or your browser.
Check your credentials
If you have them, enter them again and remove wrongly saved passwords in your browser. A private window helps because nothing is pre-filled there.
Look for directory protection in the panel
Hosting panels usually have an item like "Directory privacy" or "Password-protected directories". There you can see which folder is protected and remove the protection.
Check the .htaccess
If there is a
.htaccessin the main directory or a subfolder with authentication settings pointing to an.htpasswd, that is where the protection comes from. Make a copy first, then remove only those lines.Check security plugins
If only the login or the REST API is affected, look in your security plugin settings for login, XML-RPC or REST API protection.
Impact on Google.
Google can't see content behind a login. Pages returning 401 won't be indexed, and pages that were indexed drop out after a while. That's exactly right for a staging site, and a real problem for the live site that quickly shows in your traffic.
If the protection is removed quickly, Google usually picks the pages up again. You can speed this up by requesting indexing for your most important URLs in Search Console.
Help from a developer
I can take care of it.
The check shows where things go wrong. I am happy to fix it, once or on an ongoing basis.
Good to know
Questions about Error 401?
The most common questions, answered briefly.
Questions about Error 401
What's the difference between 401 and 403?
401: you're not logged in, valid credentials would let you in. 403: access is forbidden, and logging in won't change that.
Where do I get the credentials?
From whoever looks after the site, or from the hosting panel where the directory protection was set up. If nobody is around anymore, the protection can be removed there too.
Should my staging site return a 401?
Yes, password protection is the most reliable way to keep test sites away from Google. Just make sure it doesn't get copied over when going live. That kind of process is part of my WordPress maintenance.
All status codes at a glance.
2xx: Success
- 200OKAll good: the server understood the request and delivers the page.
- 201CreatedThe request succeeded and created something new, for example a record via an API.
- 204No ContentSuccessful, but the response has no body. Typical for APIs and background requests, not for regular pages.
3xx: Redirects
- 301Moved PermanentlyPermanent redirect: the page now lives at a new address. Search engines switch to the new URL.Causes and fixes →
- 302FoundTemporary redirect: the page is currently available at another address, the original URL stays valid.Causes and fixes →
- 303See OtherRedirect to another page that is fetched with GET, typically after submitting a form.
- 304Not ModifiedThe page has not changed since the last visit, so the browser uses its cached copy. Not an error.
- 307Temporary RedirectTemporary redirect like 302, but the request method (such as POST) is guaranteed to stay the same.
- 308Permanent RedirectPermanent redirect like 301, but the request method (such as POST) is guaranteed to stay the same.
4xx: Client errors
- 400Bad RequestThe server can't process the request because it is malformed, for example due to oversized cookies or a broken URL.Causes and fixes →
- 401UnauthorizedThis page requires you to log in, for example via server-side password protection. No valid credentials, no access.
- 403ForbiddenThe server understood the request but refuses access, for example because of file permissions, a firewall or a block.Causes and fixes →
- 404Not FoundThere is no page at this address. It was deleted, moved, or the URL is misspelled.Causes and fixes →
- 405Method Not AllowedThe address exists but doesn't accept this kind of request, such as a POST where only GET is allowed.
- 408Request TimeoutThe server waited too long for the complete request and closed the connection, often on a slow connection.
- 410GoneThe page was removed deliberately and permanently and won't come back. A clearer signal than 404.Causes and fixes →
- 429Too Many RequestsToo many requests in a short time: a rate limit or bot protection is temporarily slowing down access.Causes and fixes →
- 451Unavailable For Legal ReasonsThe page is blocked for legal reasons, for example by an official order or a country block.
5xx: Server errors
- 500Internal Server ErrorGeneric server error: something went wrong while building the page. With WordPress it is usually a plugin, theme or PHP issue.Causes and fixes →
- 501Not ImplementedThe server doesn't know or support the request method. Rare on regular websites.
- 502Bad GatewayA server in front (proxy, nginx, CDN) didn't get a usable response from the actual server, often because PHP crashed.Causes and fixes →
- 503Service UnavailableThe server is temporarily unavailable due to maintenance or overload. Try again later.Causes and fixes →
- 504Gateway TimeoutA server in front waited too long for the actual server to respond and gave up.Causes and fixes →
- 520Web Server Returned an Unknown ErrorCloudflare error: the server behind Cloudflare sent an empty, invalid or unexpected response.
- 521Web Server Is DownCloudflare error: the server behind Cloudflare refuses the connection, so it is down or blocking Cloudflare.
- 522Connection Timed OutCloudflare error: Cloudflare couldn't establish a connection to the server behind it in time.
- 523Origin Is UnreachableCloudflare error: the server behind it can't be reached, often because of a wrong IP address in the DNS records at Cloudflare.
- 524A Timeout OccurredCloudflare error: the connection to the server works, but it didn't respond in time (100 seconds by default).
- 525SSL Handshake FailedCloudflare error: the encrypted connection between Cloudflare and the server behind it could not be established.
- 526Invalid SSL CertificateCloudflare error: the SSL certificate on the server behind Cloudflare is invalid or expired (with SSL mode "Full (strict)").
No status code: connection errors
- ×Server not found (DNS)There is no server for this domain: it has expired, is misconfigured, or the record with the IP address is missing.Causes and fixes →
- ×Connection refusedThe server is known but doesn't accept connections. The web server isn't running or a firewall is blocking.
- ×TimeoutThe server didn't answer in time. It is overloaded, stuck, or not reachable at all.
- ×Certificate error (SSL)The SSL certificate has expired, doesn't cover this domain, or the certificate chain is incomplete. Browsers show a warning.Causes and fixes →

