Claude Code logo
How-To Guide

How do I rank my Claude Code site on Google?

To rank my Claude Code site on Google, keep your SEO rules in CLAUDE.md, have Claude Code write a robots.txt and a sitemap, give every page a unique title and description, then submit the sitemap in Google Search Console. Claude Code edits files in your project, so each of these is a prompt and a file change you can review.

Updated November 22, 2026

TL;DR

Put rules in CLAUDE.md

Run /init, then keep the SEO rules in CLAUDE.md so every session follows them.

Ask for crawl files

Ask Claude Code for robots.txt and sitemap.xml, then submit the sitemap in Search Console.

GrandRanker writes the pages

GrandRanker publishes search-led articles to your site, so new pages keep arriving.

5 steps

Step-by-Step

  1. 1

    Create the project CLAUDE.md

    Start Claude Code in the project folder and run /init to generate a starting CLAUDE.md. Add your SEO rules to that file, such as one unique title and description per page.

  2. 2

    Ask Claude Code for robots.txt

    Ask Claude Code to write a robots.txt file that does not block your public pages. Google's robots.txt guidance says the file must be located at the root of the site host to which it applies.

  3. 3

    Ask Claude Code for sitemap.xml

    Ask Claude Code to generate a sitemap.xml that lists every public page. Google's sitemap guidance says The sitemap file must be UTF-8 encoded, and a single sitemap is limited to 50,000 URLs.

  4. 4

    Write unique titles and descriptions

    Ask Claude Code to write a unique title and meta description for every page from that page's own content. Google's snippet guidance says identical or similar descriptions on every page of a site aren't helpful.

  5. 5

    Deploy and submit the sitemap

    Deploy the site, then open the Sitemaps report in Google Search Console. Paste the sitemap URL into the Add a new sitemap box and click Submit, which needs owner permissions on the property.

Why does Google need robots.txt and a sitemap?

A sitemap lists the URLs you want Google to find, and robots.txt tells crawlers which URLs they can access. Google's robots.txt guidance says the file must be located at the root of the site host to which it applies, and the file must be named robots.txt. A rule applies only within the protocol, host and port where it is posted, so check the live address rather than a local copy.

Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools. It can write both files in the same change as your pages, then you confirm both URLs load in a browser after you deploy.

What should each page title and description say?

Each page needs its own title and meta description. Google's snippet guidance says identical or similar descriptions on every page of a site aren't helpful when individual pages appear in search results. Google also says there's no limit on how long a meta description can be, while the snippet is truncated in Google Search results as needed.

Ask Claude Code to write these from each page's content, then read a sample of pages yourself. Check that the description says what the page answers, and keep titles short so they read clearly in search results.

Where do the SEO rules live?

The rules belong in CLAUDE.md, so every new session starts with them. CLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. You write these files in plain text; Claude reads them at the start of every session.

Add rules such as one unique title and description per page, a sitemap regenerated on each build, and a robots.txt that never blocks public pages. Review the file when a rule changes, since Claude follows what is written there.

Common mistakes

A robots.txt that blocks the site stops crawlers from reading it, so check it after every change. Google's robots.txt guidance also says the file is not a mechanism for keeping a web page out of Google, so use noindex for pages that must stay out of results. Sitemaps must be UTF-8 encoded, so ask Claude Code to write the file in that encoding and open it in a browser before you submit it.

Sources

Frequently Asked Questions

Let GrandRanker Do This for You

Grandranker does this for you. GrandRanker writes search-led articles and publishes them to a hosted blog on a subdomain you point at your app, so new pages keep arriving without changing your code.