Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Fix Google Search Console coverage issues, canonical problems, sitemap errors, and crawl budget waste in Next.js apps.
When to Use
Use when a Next.js site has Google Search Console coverage issues such as duplicate canonicals, accidental noindex, crawl waste, or discovered-but-not-indexed URLs.
Use when auditing sitemap, robots.txt, redirect, internal-linking, or static-rendering problems before an SEO release.
Use when you need framework-specific examples for Next.js App Router metadata, generateMetadata, robots.js, and sitemap routes.
// ❌ WRONG — relative URLcanonical: '/blog/my-post'// ❌ WRONG — missing trailing slash inconsistency // (pick one and stick with it sitewide)// ✓ CORRECT — absolute URL, consistent scheme + subdomaincanonical: 'https://www.yourdomain.com/blog/my-post'
Step 2 — Noindex Audit
Find pages that are accidentally noindexed:
# Search for noindex in metadata
rg -n --glob '*.{js,ts,jsx,tsx}''noindex|robots.*noindex' app pages
# Check layout.js — a noindex here affects ALL pages
grep -n "robots" app/layout.js
In Next.js App Router, robots in the root layout applies globally. Only set it there if you want the whole site affected.
// app/layout.js — only set robots if you need sitewide controlexportconst metadata = {
// ✓ Allow indexingrobots: { index: true, follow: true },
// ❌ This would noindex the entire site:// robots: { index: false }
};
Pages with zero internal links are rarely indexed. Every important page should be reachable from:
Homepage or navigation
A sitemap
At least one other content page
# Find pages that have no inbound links from other pages# (manual check — grep for the slug across all files)
grep -r "/blog/my-orphan-post" --include="*.{js,ts,jsx,tsx,md}" . | grep -v "sitemap\|the-page-itself"
Step 6 — Redirect Audit
# Find all redirects in Next.js config
grep -A 3 "redirects" next.config.js
# Check for redirect chains (A → B → C — should be A → C)# Test a suspected chain:
curl -sI https://www.yourdomain.com/old-url | grep -i location
// next.config.js — keep redirects flat (no chains)asyncredirects() {
return [
{
source: '/old-url',
destination: '/new-url', // Must NOT itself redirectpermanent: true, // 308 for SEO
},
];
}
Step 7 — robots.txt Check
curl -s https://www.yourdomain.com/robots.txt
# ✓ Good
User-agent: *
Allow: /
Sitemap: https://www.yourdomain.com/sitemap.xml
# ❌ Bad — disallows crawling of important content
Disallow: /blog/
Disallow: /tools/