How to fix “Blocked due to unauthorized request (401) / access forbidden (403)” on React SPA
If Search Console shows “Blocked due to unauthorized request (401) / access forbidden (403)” on your React SPA site, you are in the right place. Googlebot could not read the page because it asked for login or access was denied. This page covers the causes and a step-by-step fix for React SPA. A React app that runs only in the browser (Create React App, Vite). Content is drawn with JavaScript, so you depend on Google's rendering queue; prerendering or server-side rendering is recommended.
Contents
What does this status mean?
The server answered Googlebot with 401 (login required) or 403 (forbidden). Googlebot does not log in, so the page cannot be indexed.
Likely causes on React SPA
- The page is members-only or password-protected.
- A firewall, WAF or bot protection blocks Googlebot IPs.
- A country or IP restriction covers Google IPs.
- A hotlink or user-agent rule rejects Googlebot.
- React SPA note: Add public/robots.txt; without it many server setups return index.html in place of robots.txt. Do not block /static or JS files; Google needs them to render the page.
Step-by-step fix on React SPA
- In your React SPA admin go to: public/index.html, react-helmet or similar head management, public/robots.txt and server redirect settings.
- Add public/robots.txt; without it many server setups return index.html in place of robots.txt. Do not block /static or JS files; Google needs them to render the page.
- A large JS bundle delays rendering. Use code splitting, lazy loading and caching, and prerender critical pages on the server where you can.
- If the page should be public, remove the protection; if it should stay private this line is expected.
- Allow-list Googlebot as a verified crawler in the WAF and firewall.
- Allow Googlebot by verifying with reverse DNS rather than trusting the user agent.
- Confirm the response code with a live test in URL inspection.
- After fixing, start validation and send the URL.
Extra checks for React SPA
- canonical and duplicate URLs: Produce title, description and canonical separately on each route with a library such as react-helmet; otherwise every route carries the same head and can look duplicated. Server-side prerendering solves this at the root.
- redirects and 404: Client redirects (window.location, Navigate) are not 301s. Do real redirects on the server (nginx, Netlify _redirects, Vercel vercel.json) and return a 404 status for unknown routes; otherwise every URL returns 200 and creates soft 404s.
After fixing
In Search Console start "Validate fix" for this status and resubmit the page with URL inspection. First confirm the blocker is gone with the free Free indexability checker tool; for many URLs follow Bulk URL indexing: how to send thousands of pages to Google. Google makes the indexing decision itself and timing ranges from days to weeks.
More information
Frequently asked questions
Can Google see members-only content?
No. Previews need structured data and paywalled-content markup.
How do I tell if I am blocking Googlebot?
Look for 403 entries for Googlebot requests in your firewall logs.
Where are these settings on React SPA?
public/index.html, react-helmet or similar head management, public/robots.txt and server redirect settings.
Related pages
- React SPA: URL is unknown to GoogleFixes
- React SPA: Indexed, not submitted in sitemapFixes
- React SPA: Crawled - currently not indexedFixes
- Laravel: Blocked due to unauthorized request (401) / access forbidden (403)Fixes
- Ghost: Blocked due to unauthorized request (401) / access forbidden (403)Fixes
- WordPress: Blocked due to unauthorized request (401) / access forbidden (403)Fixes