#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.xmlis generated from localized site/product/blog routes.robots.txtpoints 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:
service_account.jsonat project root (recommended)GIS_CLIENT_EMAILandGIS_PRIVATE_KEYenv vars~/.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-stalefor scheduled jobs andseo:index-googlefor manual reruns.