Decide whether Google should get past the sign-in

Blocked due to unauthorized request (401) means Googlebot asked for the page and your server answered 401 Unauthorized, a request for credentials Googlebot never sends, so Google can't index the page. If the page is private, that's the right answer and you can leave it. If it belongs in search, something in front of the page asks for a sign-in it shouldn't, and the fix is to take that requirement off the page.

What this Search Console status means

  • The report lists a URL under this reason when Googlebot's request came back with a 401, the code a server uses to say the client must authenticate first. Google's crawler doesn't log in to anything, so it stops there. Google suggests opening the page in an incognito window to see the same wall, as its Page indexing report guide explains.

  • Google handles a 401 the way it handles most client errors. It ignores whatever content came with the response, keeps the URL out of its index, drops it if it was indexed before, and requests it less often as time goes on. Google's HTTP status code guide describes that behavior.

Why Googlebot gets a 401 when you don't

  • You're still signed in

    Your browser sends its session cookie or saved password with every request, so the page opens for you. Googlebot arrives with none of that, like a first-time visitor on a new device.

  • A build-time lock stayed on

    Password protection added while the site was under construction can outlive the launch, or keep covering a folder you later opened to everyone.

  • A sign-in rule matches too much

    A proxy, CDN or server rule written for an admin path can match a wider pattern than intended and start asking for credentials on public pages.

  • Private URLs reached your sitemap

    Account pages, drafts and preview links that land in a sitemap or a public template get crawled like any other address, and they answer 401 because they're supposed to.

Google's Page indexing report guide names a sitemap that lists URLs behind a login requirement as one cause of a spike in errors, and its sitemap guide says to include only the URLs you want in search results.

How to fix blocked due to unauthorized request

  1. Sort public pages from private onesOpen the example URLs in the report. Account, checkout, admin and preview pages should ask for a sign-in, so leave those as they are and set them aside.
  2. Reproduce the 401 without your sessionLoad each public URL in a private window, or request it with curl and the -I flag. A sign-in prompt or a 401 status confirms what Googlebot got.
  3. Find the layer asking for credentialsRead the WWW-Authenticate header in the 401 response. Its scheme and realm point to the web server, a proxy or your app, and the 401 Unauthorized guide walks through each one.
  4. Lift the requirement on public pagesMove the page out of the protected path or switch the lock off for it, then confirm in a private window that it opens without a prompt.
  5. Drop private URLs from your sitemapList only pages you want in search. Where you can, remove links to account or preview pages from templates that every visitor sees.

Letting verified Googlebot past a sign-in

  • Google's guide offers a second route: keep the sign-in for people and let Googlebot's own requests through. Verify each one with a reverse DNS lookup that ends in googlebot.com, followed by a forward lookup that returns the same address, or match the address against the common-crawlers.json ranges Google publishes for Googlebot. Google's other hostnames, google.com and googleusercontent.com, belong to special-case crawlers and to fetches that people trigger, including fetches by apps anyone can run on Google Cloud, so a match there must never open the login. Google's verification guide covers both methods.

  • Weigh that before you do it. Google's Crawl Stats help warns that Googlebot can be spoofed, so admitting it without a login effectively removes the page's security. If the page sits behind a subscription, paywalled content markup tells Google which part is paywalled, which helps it tell what you're doing apart from cloaking.

Frequently asked questions

Why does the page open for me but show a 401 in Search Console?

Your browser is signed in and Google's crawler isn't, so Google sees what a logged-out visitor sees. If a private window opens the page too, the problem may already be gone: the report reflects Google's last crawl, so compare the crawl date in URL Inspection with when you changed anything. The Page indexing report guide suggests the same check.

Can I send 401 to slow down Google's crawling?

No. Google says 401 and 403 have no effect on crawl rate and shouldn't be used for that. A server error or a 429 makes its crawlers back off temporarily, and Google's HTTP status code guide links to its advice on reducing crawl rate.

Should I block private pages in robots.txt instead?

Google's Crawl Stats help offers it as one option for 401 pages. It stops the crawl requests, but a blocked URL that other pages link to can still be indexed without its content, which shows up as Indexed, though blocked by robots.txt. A 401 keeps the page out of the index on its own, so a private page reported here needs no change.