Claude Code Fixed 6 SEO Bugs on My Site in 40 Minutes. The Exact Prompts.
Your Lighthouse SEO score says 100. Mine did too. And the whole time, my site had 6 indexing bugs sitting live in production.
Garvit Sharma
18 June 2026 · 8 MIN READ
Claude Code Fixed 6 SEO Bugs on My Site in 40 Minutes. The Exact Prompts.
webight.comOn this page
Your Lighthouse SEO score says 100. Mine did too. And the whole time, my site had 6 indexing bugs sitting live in production.
See, that score checks meta tags and alt text. It does not open your sitemap and click every URL in it. It does not compare your canonical tag against what your server actually does when someone hits the bare domain. It has no clue what your JSON-LD claims about your business. So you can score a perfect 100 while Google quietly builds a worse and worse picture of your site.
In June 2026 I sat down with Claude Code and ran a real technical audit on webight.com. My own agency site. 6 bugs found, fixed, and verified in roughly 40 minutes. I am going to show you the exact prompts, because the prompts did the heavy lifting. Claude Code typed the fixes. The thinking about what to check came from me, and that order matters more than any tool.
What the audit found
Here is the full list, with the embarrassing parts left in.
- 12 dead URLs in the sitemap. I had redesigned the work page months earlier and deleted the individual
/work/[slug]case-study routes. The sitemap kept advertising all 12 of them. Google was being handed a map where 12 of the streets no longer exist. - Canonical pointing at the wrong host. The canonical tag said
https://webight.com. The server 307-redirects every request on that host tohttps://www.webight.com. So every page was telling Google "the real version of me lives at an address that redirects away from me." Mixed signals, and Google hates mixed signals. - Noindexed pages listed in the sitemap.
/privacyand/termscarried a noindex robots meta, and both sat in the sitemap. A sitemap says "please index this." A noindex tag says "do not index this." I was saying both at once. - NAP mismatch in the schema. The Organization JSON-LD listed
contact@webight.comwhile the footer and contact page both showhello@webight.com. One email in the structured data, a different one rendered on the page. For local and entity SEO, that inconsistency erodes trust in everything else the schema claims. - Wrong OG image dimensions. The metadata declared the share image at 1200 by 630, but the actual file is the square logo at 2048 by 2048. Platforms read the declared size, fetch the real file, and crop however they feel like it. Link previews looked broken on half the platforms.
- An indexable utility page.
/contact-saveexists as a fallback handler for the contact form. No robots meta, no disallow rule. A blank utility page, fully crawlable, one bad internal link away from showing up in search results for my own brand name.
None of these throw an error. None of them touch Lighthouse. The site looked perfect and was leaking signal in 6 places.
Prompt one: audit, do not touch
The biggest mistake people make with Claude Code is opening with "fix my SEO." That prompt hands over the thinking, and the output you get back is generic cleanup of whatever the model happens to notice. I never let it code first. The first prompt is always reconnaissance with explicit checks:
Audit this Next.js site for technical SEO issues. Do not change any code yet.
1. List every URL emitted by src/app/sitemap.ts. For each one, verify a
matching route actually exists in src/app.
2. Compare the canonical URL in layout.tsx against the host the production
server redirects to. Run: curl -sI https://webight.com and tell me if
the canonical and the redirect target disagree.
3. Find every page with a noindex robots meta. Flag any that also appear
in the sitemap.
4. Compare every contact detail in the JSON-LD (email, phone, address)
against what is visibly rendered on the contact page and the footer.
5. Check the OG image config: do the declared width and height match the
actual file in /public?
6. List every reachable route that should not be indexable: API routes,
form handlers, utility pages.
Output a numbered list of findings with file path, severity, and one line
on why each hurts indexing. No fixes yet.
Notice what that prompt is. It is a checklist I already had in my head from auditing client sites. Claude Code executed it in about 90 seconds and came back with all 6 findings, file paths included. If I had not known to ask about canonical-versus-redirect behavior, it would never have checked. The model is fast, obedient, and exactly as thorough as your question.
Prompt two: plan before code
For anything beyond a one-liner, I make it think out loud before it edits. This is the same thing I tell anyone learning to work with AI. When two people who cannot code hit a bug, the lazy one types "fix this." I type this:
Take finding 2. Before writing any code: explain the core reason this
happened, what the industry-standard handling is for canonical host
selection, and your exact plan including every file you will touch.
Then wait for my go-ahead.
For the canonical bug it came back with the right answer: pick one host as truth (www, since that is where the server already redirects), set metadataBase to it, and emit canonicals from it everywhere. Then I approved:
Approved. Implement the plan for finding 2 only. Touch nothing else.
Then run npm run build and paste the full output.
"Only" and "touch nothing else" are load-bearing words. Without them, Claude Code will helpfully refactor three unrelated files while it is in the neighborhood, and now your diff is unreviewable.
The actual fixes
The sitemap rewrite, complete and shipped:
import type { MetadataRoute } from "next";
export default function sitemap(): MetadataRoute.Sitemap {
const baseUrl = "https://www.webight.com";
// Only indexable, existing routes belong here. /privacy and /terms are
// noindexed and /work/[slug] pages no longer exist, so they are excluded.
const staticRoutes: MetadataRoute.Sitemap = [
{ url: baseUrl, lastModified: new Date(), changeFrequency: "weekly", priority: 1.0 },
{ url: `${baseUrl}/about`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.8 },
{ url: `${baseUrl}/services`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.9 },
{ url: `${baseUrl}/work`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.8 },
{ url: `${baseUrl}/pricing`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.8 },
{ url: `${baseUrl}/contact`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.7 },
{ url: `${baseUrl}/blog`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.5 },
];
return staticRoutes;
}
19 URLs down to 7 real ones. The robots file got the utility page locked down at the same time:
import type { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: "*",
allow: "/",
disallow: ["/api/", "/contact-save"],
},
sitemap: "https://www.webight.com/sitemap.xml",
};
}
And /contact-save got belt plus suspenders, its own layout-level meta:
import type { Metadata } from "next";
export const metadata: Metadata = {
robots: {
index: false,
follow: false,
},
};
The schema email became hello@webight.com to match the page. The OG config now declares the file's true 2048 by 2048 dimensions, with a proper 1200 by 630 share image on the to-do list. Small edits, all of them. The total diff was under 80 lines.
The verification loop
I do not trust an AI diff until something external confirms it, and you should not either. My loop after every fix in that session:
npm run build
curl -sI https://webight.com | grep -iE "HTTP|location"
curl -s https://www.webight.com/sitemap.xml | grep -c "<loc>"
Build passes. The bare domain still 307s to www, and the canonical now agrees with it. The sitemap counts exactly 7 locations. Then Lighthouse on the deployed site, because the same session also caught performance problems: a framer-motion opacity animation was holding my hero headline hostage with a 4,190ms render delay, fixed with a transform-only CSS animation that dropped it to 382ms. Mobile scores went from 90/96/96/100 to 96/100/100/100.
Look at that last number though. SEO was 100 before the session and 100 after. Six real bugs fixed, zero movement on the score. That is the whole point. The metric everyone screenshots cannot see the bugs that actually cost you rankings. Only a specific question can. Search Console will show the real effect over weeks, after Google recrawls.
The part that decides everything
I have watched this pattern for three years now, since the day ChatGPT launched. The people who get nothing out of AI all share one habit: they hand it the thinking, then blame the tool for the result. "Fix my SEO" produces garbage because it contains no knowledge. The 6-point audit prompt produced a perfect result because every line of it encoded something I learned the slow way, on client sites, before AI could type for me.
There is a name for this in psychology: cognitive offloading. Hand your thinking to an external tool often enough and the thinking muscle weakens. Fine for phone numbers. Fatal for judgment. The more you get spoonfed, the lazier you get, and AI is the most comfortable spoon ever built.
Claude Code in that session was a brilliant pair of hands. It read the codebase faster than I ever could, found every file, wrote clean diffs, ran the builds. Hands. The checklist, the approval gates, the "touch nothing else," the curl commands at the end, those came from a human who knew what broken looks like. 40 minutes of execution sitting on top of years of knowing what to ask.
So before your next session with Claude Code, write the checklist yourself, on paper, before you open the terminal. If you cannot fill 5 lines, the tool is about to think for you, and that is the moment you stop being the one in charge.
Got a Search Console screenshot that confuses you? Send it over, happy to take a look.
We build custom platforms, websites, and automation.
The two people who build it are the two you talk to, and every price is on the page.

Garvit Sharma
Full-stack developer and co-founder of Webight, a two-person web and AI studio in India. He writes these from real client work. More about us.
Keep reading
// RELATEDA Client Paid 3 Agencies for SEO Before Me. None of Them Opened the Website Code.
webight.comA Client Paid 3 Agencies for SEO Before Me. None of Them Opened the Website Code.
7 MIN READ
One Cloudflare Worker Saved My Client's App When Supabase Got Blocked. It Also Cut TTFB in Half.
webight.comOne Cloudflare Worker Saved My Client's App When Supabase Got Blocked. It Also Cut TTFB in Half.
6 MIN READ
The Contact Form Setup That Stopped Landing in Spam. Resend, Next.js, DKIM.
webight.comThe Contact Form Setup That Stopped Landing in Spam. Resend, Next.js, DKIM.
6 MIN READ