#Google Search Console Indexing

This template ships with basic SEO generation and a script to submit indexing requests to Google.

#Built-in SEO output

  • sitemap.xml is generated from localized site/product/blog routes.
  • robots.txt points crawlers to the sitemap.
  • Canonical and localized metadata are generated per route.

Set this in .env.local:

NEXT_PUBLIC_SITE_URL=https://your-domain.com

#Search Console verification

Add your verification code:

NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION=YOUR_GOOGLE_SITE_VERIFICATION_CODE

#Indexing script setup

Set target domain:

GOOGLE_INDEXING_URL=https://your-domain.com

Provide Google service account credentials using one of these methods:

  1. service_account.json at project root (recommended)
  2. GIS_CLIENT_EMAIL and GIS_PRIVATE_KEY env vars
  3. ~/.gis/service_account.json

service_account.json must include:

{
  "client_email": "your-service-account@project.iam.gserviceaccount.com",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
}

#Run indexing

Force indexing now:

yarn seo:index-google

Index only if stale (skips when last run was within 24 hours):

yarn seo:index-if-stale

#Notes

  • The script caches submission status in .cache/.
  • Use seo:index-if-stale for scheduled jobs and seo:index-google for manual reruns.