For AI agents: the complete documentation index is available at https://nhanbe.id.vn/llms.txt, the full documentation bundle is available at https://nhanbe.id.vn/llms-full.txt, and this page is available as Markdown at https://nhanbe.id.vn/building-for-the-web/web-seo/google-search-console-page-indexing.md.

Google Search Console: Page Indexing Playbook

Deep-dive engineering playbook on Googlebot's Crawling, Rendering, Canonicalization, and Indexing pipeline—how to interpret the Google Search Console Page Indexing report and debug every Not Indexed status.

SEOIndexingGooglebot

Google Search Console: Page Indexing Report & Debugging Playbook

For software engineers and technical SEO practitioners, Google Search Console (GSC) is far more than a keyword tracker—it is the primary diagnostic telemetry dashboard showing how Google's infrastructure interacts with your site architecture. Unlike third-party crawlers (such as Screaming Frog or Ahrefs) or site: search operators that can only simulate crawls from the outside, the Page Indexing report exposes Google's first-party internal state across its crawl queue, Web Rendering Service (WRS), and canonical clustering pipeline.

This guide breaks down the architecture behind the Page Indexing report, explains how to interpret its metrics accurately, and provides code- and infrastructure-level fixes for every Not indexed status defined in Google Search Central documentation.


1. Pipeline Architecture: From URL to the Google Index

To understand why a URL lands in a Not indexed bucket, trace the four-stage pipeline every URL must pass through inside Google's indexing infrastructure:

Awaiting crawlrobots.txt, 5xx, 4xx, redirecterrorsnoindex, Soft 404, JS renderfailureDuplicate cluster or low value01 Discoverysitemap.xml, links,redirects, URL Inspection02 Crawling (Googlebot)robots.txt, crawl budget,HTTP 200 + HTML03 Rendering & ParsingWRS: JS execution, metarobots, soft 404, canonical04 Canonicalization &Indexingduplicate clustering,canonical selection, qualityINDEXEDDiscovered - currently notindexedBlocked or HTTP-layerfailureExcluded by directive orthin contentCrawled - currently notindexed
  1. Discovery: Google learns that a URL exists via Sitemap.xml, internal or external links (<a href="...">), HTTP redirects (301/302), or manual URL Inspection submissions. At this point, the URL simply enters the Crawl Queue.
  2. Crawling: Google's crawl scheduler allocates Crawl Budget based on Crawl Capacity Limit (your server's health and latency) and Crawl Demand (how popular and stale the URL is). Before sending an HTTP request, Googlebot (primarily Googlebot Smartphone) checks /robots.txt per RFC 9309. If allowed, Googlebot fetches the document and inspects the HTTP status code and response headers.
  3. Rendering & Processing:
    • During initial HTML parsing, Google extracts <meta name="robots">, <link rel="canonical">, and discoverable <a href> links from the raw server response.
    • Provided no noindex directive blocks the page, the URL is queued for the Web Rendering Service (WRS)—an evergreen headless Chromium instance that executes client-side JavaScript, builds the final DOM, and evaluates whether the rendered view looks like an error or empty state (Soft 404).
  4. Canonicalization & Indexing:
    • Google groups duplicate or near-duplicate pages into a Duplicate Cluster and elects a single representative URL as the Google-selected canonical (see the Canonical URL Guide).
    • Finally, Google evaluates content quality and usefulness before committing the canonical URL to the Google Index.
[Why Third-Party Crawlers Cannot Replicate GSC]

An external crawler can only observe public signals from Stages 2 and 3 (HTTP status codes, robots.txt rules, noindex tags). It has no visibility into Google's internal Stage 1 crawl queue (Discovered – currently not indexed) or Stage 4 duplicate clustering and quality thresholds (Crawled – currently not indexed, Google-selected canonical).


2. How to Read the Page Indexing Report

Open Indexing > Pages in Google Search Console to view your site's URLs split into two top-level buckets—Indexed (green) and Not indexed (gray)—followed by the Why pages aren't indexed breakdown table.

Anatomy of the Page Indexing Report in Google Search Console

2.1. The Most Common Misconception: Trying to Drive "Not Indexed" to Zero

According to Google Search Central, a healthy production website never has 100% of its known URLs indexed. The Not indexed bucket combines two fundamentally different categories:

  • Intentional exclusions (healthy): 301 redirect source URLs, tracking-parameter variants (?utm_source=...), paginated or filtered views canonicalized to a parent page, admin/checkout routes carrying noindex, and internal API endpoints blocked by robots.txt. Seeing these in Not indexed confirms your technical guards are working as designed.
  • Unintended failures (bugs): Core landing pages, product pages, or articles listed in sitemap.xml that drop out of the index due to 5xx server errors, Soft 404 responses, broken client-side JavaScript rendering, or canonical mismatches.

2.2. The Essential Filter: All known pages vs. All submitted pages

Use the filter dropdown at the top-left of the Page Indexing report to isolate true regressions:

  1. All known pages: Every URL Googlebot has ever encountered across the web for your domain—including third-party spam links, arbitrary query strings, and legacy deleted routes.
  2. All submitted pages: Restricted strictly to the URLs you explicitly declared in the sitemap.xml files submitted to GSC.
[Golden Rule for Technical Audits]

Always switch the filter to All submitted pages first. Because an XML sitemap should contain only canonical, indexable URLs returning HTTP 200, any URL in All submitted pages that appears under Not indexed is a bug: either the page itself is failing to index, or your sitemap generator is leaking non-canonical/redirecting URLs into sitemap.xml.

2.3. Understanding the Source Column

Every row in the Why pages aren't indexed table carries a Source attribution:

Source LabelTechnical MeaningPrimary Owner
WebsiteTriggered directly by an explicit HTTP status code, response header, HTML meta tag, or rule served by your infrastructure (5xx, 404, Soft 404, noindex, robots.txt).Backend / Frontend / DevOps Engineers (inspect application code, server logs, CDN/WAF rules, and routing).
Google systemsDetermined by Google's crawl scheduler, duplicate clustering engine, or quality evaluation (Discovered - currently not indexed, Crawled - currently not indexed).Technical SEO & Engineering (optimize SSR/CSR rendering, internal link architecture, crawl budget, and content uniqueness).

3. Anatomy of the URL Inspection Tool

When you spot an unexpected spike in a Not indexed row, click the status row and run the URL Inspection Tool on representative sample URLs.

Anatomy of the URL Inspection Tool in Google Search Console

Google Index Tab vs. Test Live URL

Engineers are often confused when the default Google Index view reports an error (such as Crawled – currently not indexed or Duplicate), yet clicking TEST LIVE URL immediately returns a green checkmark: "URL is available to Google".

The two modes inspect completely different states:

DimensionGoogle Index Tab (Historical State)Test Live URL Mode (Real-Time Probe)
Data sourceReads the snapshot recorded during Googlebot's most recent background crawl and indexing pass.Dispatches a live HTTP fetch and headless WRS render at the exact moment you click the button.
Checks robots.txt, HTTP status, and noindexYes (as observed during the last scheduled crawl).Yes (in real time—ideal for verifying a newly deployed fix).
Evaluates duplicate clusters & canonical electionYes. Reports the actual Google-selected canonical URL.No. Live Test cannot run site-wide duplicate clustering, so it only confirms the page is fetchable—not that Google will accept your canonical or index the page.
Reports Sitemap membershipYes. Lists which submitted sitemaps contain the URL.No.
Renders visual screenshotNo. Shows captured Rendered HTML, HTTP response, and JS console logs.Yes. Captures a live visual screenshot from headless Chromium after JavaScript execution.

4. Deep Dive: Debugging Every Not Indexed Status

Google Search Console categorizes unindexed URLs into over a dozen specific statuses. Here is the engineering root-cause analysis and remediation playbook for each group.

Group A: Crawl Queue & Quality Evaluation (Source: Google systems)

1. Discovered – currently not indexed

  • What it means: Google knows the URL exists (via sitemap.xml or a link), but Googlebot has not yet made an HTTP request to fetch it (Last crawl shows N/A).
  • Root causes:
    1. Crawl capacity bottleneck: Your server's response latency is high or returning elevated error rates, causing Googlebot to throttle its crawl rate to avoid overloading your origin.
    2. Crawl budget exhaustion (spider traps): Faceted navigation (?color=red&size=xl&sort=asc), infinite calendar links, or session parameters generate hundreds of thousands of low-value URLs that flood the crawl queue.
    3. Weak internal discovery (orphan pages): The URL is listed in sitemap.xml but has zero internal <a href> links pointing to it from indexable pages.
  • How to debug & fix:
    1. Open Settings > Crawl stats in GSC and inspect Average response time (ms). If average TTFB exceeds 500–800 ms, introduce edge caching (CDN, Redis, AEM Dispatcher) and optimize slow database queries.
    2. Block combinatorial filter and internal search paths in /robots.txt (Disallow: /*?sort=, Disallow: /search).
    3. Add contextual internal links from high-authority category or hub pages to the unindexed pages.

2. Crawled – currently not indexed

  • What it means: Googlebot fetched and rendered the page (HTTP 200 OK, no robots.txt block, no noindex directive), but Google's indexing pipeline chose not to store it in the search index.
  • Root causes:
    1. Client-Side Rendering (CSR) / Hydration failures: In Single-Page Applications (React, Vue, Angular), the server returns an empty shell (<div id="app"></div>). When WRS executes JavaScript to fetch page data, an API call fails due to CORS, missing environment variables, timeouts, or content that only mounts after user interaction (Googlebot does not scroll or click buttons). As a result, WRS sees a blank or near-empty DOM.
    2. Thin or programmatic boilerplate content: Empty category pages (0 products), sparse tag archives, or programmatic pages that swap out only a city name while keeping 95% identical boilerplate copy.
  • How to debug & fix:
    1. Open URL Inspection > View Crawled Page > HTML and search (Ctrl+F) for a unique sentence from your primary body content. If it is missing from the rendered DOM, check More Info > Page resources and JavaScript console messages for blocked API calls or runtime exceptions.
    2. Migrate SEO-critical routes to Server-Side Rendering (SSR), Static Site Generation (SSG), or Incremental Static Regeneration (ISR) so primary content is present in the initial HTML payload.
    3. Automatically emit <meta name="robots" content="noindex"> on zero-result category pages until inventory is populated.

Group B: Duplicate Content & Canonical Conflicts (Canonicalization)

3. Alternate page with proper canonical tag

  • What it means: The URL declares a <link rel="canonical" href="..."> pointing to another URL, and Google respected your hint by indexing the target canonical instead.
  • Action required?
    • None if the URL is an intentional parameter variant (?page=1, ?utm_campaign=..., ?fbclid=..., print view).
    • Fix immediately if:
      1. The alternate URL is erroneously included in sitemap.xml (remove it from your sitemap generator).
      2. A template bug hardcoded <link rel="canonical" href="https://example.com/" /> across distinct child pages, collapsing them into the homepage.

4. Duplicate without user-selected canonical

  • What it means: Google found multiple URLs serving identical content, and none of them declared a valid <link rel="canonical"> tag. Google elected one canonical automatically and excluded the rest.
  • Common cause: The same route resolves under mixed case (/Rooms/Deluxe vs. /rooms/deluxe), both trailing-slash variants (/rooms/deluxe/ vs. /rooms/deluxe), or arbitrary query strings.
  • How to fix:
    • Render a self-referencing <link rel="canonical"> on every indexable page:
      <link rel="canonical" href="https://hotel.example/rooms/deluxe" />
    • Enforce lowercase paths and a consistent trailing-slash policy via 301 redirects in your routing middleware.

5. Duplicate, Google chose different canonical than user

  • What it means: Your HTML declared <link rel="canonical" href="URL_A">, but Google overruled your hint and elected URL_B as the canonical URL.
  • Why Google overrides developer canonicals:
    1. Conflicting site signals: The page's canonical tag points to URL_A, but sitemap.xml lists URL_B and internal <a href> navigation links point to URL_B.
    2. Canonicalizing non-equivalent content: Pointing an out-of-stock product page's canonical tag to its parent category page. Because the two pages do not share duplicate content, Google ignores the canonical hint.
    3. Client-side JS canonical mutation: The server HTML outputs <link rel="canonical" href="URL_A">, and client-side JavaScript later mutates or appends a second canonical tag pointing to URL_B.
  • How to fix:
    • Inspect the URL in GSC to see which Google-selected canonical won.
    • Align all four signals to the exact same URL: <link rel="canonical"> = sitemap.xml entry = internal <a href> links = 301 redirect targets.

Group C: Indexing & Crawling Directives (Directives & Removals)

6. Excluded by ‘noindex’ tag

  • What it means: Googlebot crawled the URL and encountered an explicit noindex directive in either:
    1. The HTML <head>:
      <meta name="robots" content="noindex" />
    2. Or the HTTP response headers (common on PDFs, images, or reverse-proxy rules):
      X-Robots-Tag: noindex
  • Common deployment traps:
    • Deploying to production with a staging environment variable (APP_ENV=staging or VERCEL_ENV=preview) that injects noindex globally.
    • Shipping <meta name="robots" content="noindex"> in the initial server HTML and relying on client-side JavaScript to remove it after data loads—Googlebot stops processing for indexing as soon as it sees noindex in the raw HTML response.

7. Blocked by robots.txt

  • What it means: A Disallow rule in /robots.txt prevented Googlebot from fetching the URL. Because Googlebot did not crawl the page, it is normally excluded from the index (unless strong external/internal links point to it, in which case it may surface under the warning "Indexed, though blocked by robots.txt" without a text snippet).

:::warning[Never Use robots.txt to De-Index Already Indexed Pages] If a set of URLs (such as /search?q=... or leaked /staging/... paths) is already indexed in Google, do not immediately add Disallow to robots.txt. Blocking a URL in robots.txt prevents Googlebot from visiting the page to read a noindex tag or 404/410 status code—leaving the stale URL trapped in search results indefinitely.

Correct de-indexing sequence:

  1. Keep the URL crawlable in robots.txt.
  2. Serve <meta name="robots" content="noindex">, X-Robots-Tag: noindex, or an HTTP 404 / 410 status code.
  3. Wait for Googlebot to recrawl and drop the URLs from the index (or use the GSC Removals tool for immediate temporary hiding).
  4. Only after the URLs move to Excluded by ‘noindex’ tag or Not found (404) should you add a Disallow rule in robots.txt to save crawl budget. :::

8. Blocked by page removal tool

  • What it means: A property administrator submitted a temporary removal request under Indexing > Removals in GSC. Temporary removals hide the URL from search results for roughly 6 months (180 days). To restore indexing sooner, cancel the active request in the Removals dashboard.

Group D: HTTP Status Codes, Redirects & WAF Blocks (Source: Website)

9. Server error (5xx)

  • What it means: Your server returned an HTTP 500, 502, 503, or 504 status code—or timed out before sending response bytes—when Googlebot requested the URL.
  • Why it is critical: Sustained 5xx errors cause Googlebot to drastically throttle your domain's crawl rate and will drop existing high-ranking pages from the Google Index if the error persists across multiple recrawl attempts.
  • How to debug:
    • Filter your web server, reverse proxy, and APM logs (Datadog, New Relic, CloudWatch) by User-Agent matching Googlebot.
    • Real users often hit warm CDN caches, whereas Googlebot systematically crawls deep pagination and long-tail category routes that miss the cache—triggering database connection pool exhaustion, SSR memory spikes, or origin timeouts.

10. Not found (404) vs. Soft 404

These two statuses look similar by name but represent opposite technical behaviors:

StatusHTTP & DOM BehaviorWhen Is It Healthy vs. Broken?
Not found (404) (or 410 Gone)Server returns a real HTTP 404 or 410 status code.Healthy when an item or article was permanently removed with no equivalent replacement. Only fix (via a 301 redirect) if the page moved to a new URL or carries valuable backlinks/internal links.
Soft 404Server returns HTTP 200 OK, but the rendered page displays an error message ("Product not found"), renders an empty shell, or bulk-redirects (301/302) dead URLs to the homepage (/).Always a bug. Returning 200 OK for missing resources wastes crawl budget and confuses index quality signals.
  • How to fix Soft 404 errors in modern frameworks:
    • Never bulk-redirect dead URLs to /. Only 301 redirect a retired URL when a direct 1-to-1 replacement page exists.
    • In SSR/SPA frameworks (Next.js, Nuxt, Remix, AEM), when a database or CMS lookup returns null, explicitly return an HTTP 404 status at the server response layer rather than rendering a client-side "Not Found" component with status 200.

11. Page with redirect & Redirect error

  • Page with redirect: The URL returned a 301, 302, 307, or 308 redirect. Google follows the redirect and indexes the destination URL instead of the source URL. Simply remove redirecting source URLs from sitemap.xml and update internal <a href> links to point directly to the final destination.
  • Redirect error: Triggered when:
    • Redirect chain is too long: Googlebot follows at most 10 redirect hops per request (keep production redirects to 1 hop, or at most 2).
    • Redirect loop: For example, a CDN rule redirects http -> https while the origin Nginx server redirects https -> http, or trailing-slash add/strip rules conflict.
    • Malformed or empty Location: response header.

12. Blocked due to unauthorized request (401), access forbidden (403), or other 4xx issue

  • 401 Unauthorized: The route requires HTTP Basic/Digest authentication (often left enabled by mistake after promoting a staging build).
  • 403 Forbidden & Other 4xx (such as 429 Too Many Requests):
    • When a public page shows 403 or 429 in GSC, the culprit is almost always a WAF, CDN, or Bot Protection rule (Cloudflare Bot Fight Mode, AWS WAF, Akamai, or Nginx rate-limiting) challenging or blocking Googlebot IPs.
    • How to verify authentic Googlebot requests at the firewall: Never allowlist based solely on the User-Agent string (which anyone can spoof). Verify Googlebot using one of Google's two official methods:
      1. Reverse DNS (rDNS) + Forward DNS lookup: Verify the source IP's PTR record resolves to *.googlebot.com. or *.google.com., and confirm a forward A/AAAA lookup on that hostname resolves back to the exact same IP address.
      2. Official CIDR IP allowlist: Sync Googlebot's published IP subnets from https://developers.google.com/search/apis/ipranges/googlebot.json.

5. Diagnostic Flowchart & Triage Matrix

When auditing a site with thousands of Not indexed URLs, use this decision tree to triage actionable regressions vs. expected exclusions:

No: Admin, filter, trackingparam, or retired URLYesNoYes: Core product, article, orcategory page5xx / 403 / 404 / Soft 404 /Redirect errorBlocked by robots.txt / Excludedby noindexDuplicate / Alternate canonicalDiscovered / Crawled - currentlynot indexedURL appears under NotIndexed in GSCShould this URL be indexedas a canonical searchlanding page?Is this URL listedin sitemap.xml?Remove from sitemap.xml& point internal links to finalcanonicalIntentional ExclusionNo action requiredWhich GSC status group?Server / Routing / WAFLayer:• Fix 5xx crashes & reduceTTFB• Allowlist verifiedGooglebot IPs in WAF• Return HTTP 200 for livepages, 404/410 for deadpages• Collapse redirect chainsto 1 hopDirective Layer:• Unblock path in /robots.txt• Remove meta noindex &X-Robots-Tag headersCanonicalization Layer:• Add self-referencingrel='canonical'• Align Canonical, Sitemap& internal URLs 100%Rendering & ArchitectureLayer:• Inspect Rendered HTMLin URL Inspection• Serve primary content viaSSR/SSG• Prune spider traps & addinternal links

Engineering Triage Matrix

GSC StatusSourcePriority (when affecting core pages)Technical Root CauseActionable Fix
Server error (5xx)WebsiteP0 (Critical)Origin crash, SSR timeout, DB pool exhaustion, or CDN 502/504.Inspect server logs for Googlebot, enable edge caching, and optimize slow queries.
Excluded by ‘noindex’ tagWebsiteP0 (Critical)Leaked <meta name="robots" content="noindex"> or X-Robots-Tag: noindex.Audit production env vars and strip noindex from public page templates.
Blocked due to access forbidden (403)WebsiteP0 (Critical)WAF, CDN bot challenge, or rate-limiter blocking Googlebot IPs.Allowlist verified Googlebot CIDRs (googlebot.json) or rDNS (*.googlebot.com).
Soft 404WebsiteP1 (High)Empty state/error UI served with HTTP 200 OK, or bulk 301 redirects to /.Return a real HTTP 404/410 status from SSR when records are missing.
Crawled - currently not indexedGoogle systemsP1 (High)WRS failed to render client-side JS content, or content is thin/boilerplate.Verify Rendered HTML in URL Inspection; adopt SSR/ISR; consolidate thin pages.
Redirect errorWebsiteP1 (High)Redirect chain > 10 hops, A -> B -> A loop, or invalid Location header.Collapse redirects to a single 301 hop; fix conflicting CDN/Nginx rewrite rules.
Duplicate, Google chose different canonicalGoogle systemsP2 (Medium)Conflict between rel="canonical", sitemap.xml, internal links, or redirects.Align canonical tags, sitemap URLs, and internal <a href> links to one format.
Duplicate without user-selected canonicalGoogle systemsP2 (Medium)Missing <link rel="canonical"> on pages reachable via multiple URL variants.Add self-referencing canonical tags and enforce lowercase/trailing-slash redirects.
Discovered - currently not indexedGoogle systemsP2 (Medium)Crawl budget exhaustion, slow server TTFB, or orphan pages without internal links.Block filter traps in robots.txt, keep TTFB < 500 ms, and add internal links.
Alternate page with proper canonical tagWebsiteP3 (Verify)Parameterized or alternate URL properly canonicalized to its primary URL.Expected behavior. Verify none of these alternate URLs appear in sitemap.xml.
Page with redirectWebsiteP3 (Verify)URL returns a valid 301/302 redirect.Expected behavior. Remove source URLs from sitemap.xml and update internal links.
Not found (404)WebsiteP3 (Verify)URL returns HTTP 404.Leave as 404 if permanently removed; 301 redirect only if a 1:1 replacement exists.

6. Code Patterns: Fixing Indexing Bugs in Application Code

6.1. Preventing Soft 404 and Setting Self-Referencing Canonicals in Next.js (App Router)

A classic bug in React and Next.js applications occurs when a database lookup returns null and the component renders a "Room not found" message without calling notFound(). Because the server still responds with HTTP 200 OK, Google flags the URL as a Soft 404.

app/rooms/[slug]/page.tsx
import { notFound } from 'next/navigation';
import type { Metadata } from 'next';

interface PageProps {
  params: Promise<{ slug: string }>;
}

// 1. Emit a clean self-referencing canonical URL stripped of tracking query params
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
  const { slug } = await params;
  const room = await fetchRoomBySlug(slug);

  if (!room) {
    return {
      title: 'Room Not Found',
      robots: { index: false, follow: false },
    };
  }

  const canonicalUrl = `https://hotel.example/rooms/${room.slug}`;

  return {
    title: `${room.name} | Hotel Example`,
    description: room.summary,
    alternates: {
      canonical: canonicalUrl,
    },
    robots: {
      // Proactively noindex unpublished listings before they become thin pages
      index: room.isPublished,
      follow: true,
    },
  };
}

// 2. Return a real HTTP 404 status at the SSR layer when the record does not exist
export default async function RoomDetailPage({ params }: PageProps) {
  const { slug } = await params;
  const room = await fetchRoomBySlug(slug);

  if (!room) {
    // Calling notFound() instructs Next.js to send a true HTTP 404 status code
    notFound();
  }

  return (
    <main>
      <h1>{room.name}</h1>
      <p>{room.description}</p>
    </main>
  );
}

6.2. Protecting Staging Environments Without Leaking noindex to Production (Nginx)

Instead of hardcoding <meta name="robots" content="noindex"> in HTML templates (where it can easily be merged from staging into main by mistake), enforce non-production indexing blocks at the reverse-proxy or CDN layer via the X-Robots-Tag HTTP response header:

/etc/nginx/conf.d/staging.conf
server {
    listen 443 ssl http2;
    server_name staging.hotel.example;

    # Block search engines from indexing any asset (HTML, PDF, images) on staging
    add_header X-Robots-Tag "noindex, nofollow, noarchive" always;

    location / {
        proxy_pass http://backend_upstream;
    }
}

6.3. Automating Bulk Diagnostics with the GSC URL Inspection API

When auditing hundreds of URLs, clicking through the GSC web UI one URL at a time is impractical. Google provides the official urlInspection.index.inspect REST endpoint to programmatically retrieve verdict, coverageState, robotsTxtState, googleCanonical, userCanonical, and lastCrawlTime.

:::info[URL Inspection API Quota Limits] Per Google Search Console API documentation, usage is capped per Search Console property at:

  • 2,000 queries per day
  • 600 queries per minute :::

Below is a Node.js script using the official googleapis SDK to batch-inspect a list of URLs and print a diagnostic table:

scripts/inspect-urls.mjs
import { google } from 'googleapis';

const SITE_URL = 'https://hotel.example/'; // Or 'sc-domain:hotel.example' for a Domain property
const KEY_FILE_PATH = './service-account-key.json';

async function inspectBatchUrls(urls) {
  const auth = new google.auth.GoogleAuth({
    keyFile: KEY_FILE_PATH,
    scopes: ['https://www.googleapis.com/auth/webmasters.readonly'],
  });

  const searchconsole = google.searchconsole({ version: 'v1', auth });
  const results = [];

  for (const inspectionUrl of urls) {
    try {
      const response = await searchconsole.urlInspection.index.inspect({
        requestBody: {
          inspectionUrl,
          siteUrl: SITE_URL,
          languageCode: 'en-US',
        },
      });

      const indexResult = response.data.inspectionResult?.indexStatusResult;
      results.push({
        url: inspectionUrl,
        verdict: indexResult?.verdict,               // PASS, NEUTRAL, or FAIL
        coverageState: indexResult?.coverageState,   // e.g., "Crawled - currently not indexed"
        pageFetchState: indexResult?.pageFetchState, // SUCCESSFUL, SOFT_404, SERVER_ERROR...
        lastCrawlTime: indexResult?.lastCrawlTime,
        userCanonical: indexResult?.userCanonical,
        googleCanonical: indexResult?.googleCanonical,
      });
    } catch (error) {
      console.error(`[Error] Failed to inspect ${inspectionUrl}:`, error.message);
    }
  }

  console.table(results);
}

inspectBatchUrls([
  'https://hotel.example/rooms/deluxe',
  'https://hotel.example/rooms/deluxe?view=ocean',
  'https://hotel.example/offers/expired-promo',
]);

7. Pre-Flight Checklist Before Clicking "Validate Fix"

After deploying a fix to production, walk through these four verification steps before clicking Validate Fix in Google Search Console:

  1. Verify raw HTTP headers through your live CDN / Reverse Proxy: Run curl -I https://hotel.example/path to confirm the CDN cache has been purged and the endpoint returns the expected HTTP status code, X-Robots-Tag, Location, and Cache-Control headers.
  2. Run Test Live URL on 3–5 sample URLs: In GSC, inspect several affected URLs, click TEST LIVE URL, and check View Tested Page > HTML / Screenshot to confirm Googlebot sees the updated status code, canonical tag, and rendered DOM.
  3. Trigger Validate Fix in the Page Indexing report:
    • Validation transitions to Started.
    • Google immediately probes a small sample of URLs. If any sample URL still exhibits the error, validation halts and reports Failed.
    • If the initial sample passes, Google queues the remaining URLs in the bucket for recrawling. Full validation (Passed) typically takes several days to two weeks, depending on your site's size and crawl budget.
  4. Skip validation for intentional statuses: Informational buckets such as Page with redirect (for legitimate redirects) or Blocked by page removal tool do not require validation unless the status was caused by a misconfiguration you just reverted.

8. Official References

All status definitions, technical thresholds, and remediation workflows in this guide are cross-referenced against official Google Search Central and Search Console documentation:

  1. Page Indexing Report — Google Search Console Help
  2. URL Inspection Tool — Google Search Console Help
  3. Crawl Stats Report — Google Search Console Help
  4. How Google Search Works (Crawling, Indexing, Serving) — Google Search Central
  5. Consolidate Duplicate URLs & Canonicalization — Google Search Central
  6. Robots Meta Tags & X-Robots-Tag Specifications — Google Search Central
  7. Fix Search-Related JavaScript Problems (Web Rendering Service) — Google Search Central
  8. Crawl Budget Management for Large Sites — Google Search Central
  9. HTTP Status Codes, Network Errors, and Soft 404s — Google Search Central
  10. Redirects and Google Search (Maximum Hops & Loop Handling) — Google Search Central
  11. Verifying Googlebot and Other Google Crawlers (rDNS & IP Ranges) — Google Search Central
  12. URL Inspection API Reference & Quota Limits — Google Developers