SEO·Claude Code
SEOClaude Code

Add a unique <title> tag to every pageClaude Code

The <title> tag is the single strongest on-page ranking signal. Without unique, descriptive titles per page, Google cannot tell your pages apart and your search CTR collapses.

rocket_launch

Fixing this in Claude Code

Anthropic's official terminal coding agent

Claude Code can grep the whole project and enforce uniqueness. Prompt it to list every page file and print its title, then fix duplicates in one pass.

Using a different tool? Pick your stack:

The prompt for Claude Code

Copy and paste this into your Claude Code chat exactly as-is.

Run Claude Code in the project root and make these exact changes, scanning the whole codebase first:

Add a unique <title> tag

1. Add a unique, descriptive <title> in <head> on every page (10-60 characters).
2. Include the primary keyword and the brand name.
3. Make sure no two pages share the same title.

Why this matters

Google reads the <title> tag before anything else on your page. It becomes the blue link text in search results, the browser tab label, and the default text when someone bookmarks or shares your URL. A weak or duplicate title quietly caps how high any page can rank, no matter how good the content is.

Studies of CTR in the Google SERP consistently show that rewriting a bland title to something specific and benefit-led lifts click-through by 15-40%. That is a free traffic multiplier — the ranking does not need to move for you to get more visitors.

AI tools like Lovable, Bolt and v0 often generate an entire site with a single templated <title> like "App" or "Home" because the user never asked for better. This is the #1 SEO miss in AI-built apps and takes 5 minutes to fix.

How to use this prompt in Claude Code

  1. 1. Open your Claude Code project.
  2. 2. Copy the prompt above with the copy button.
  3. 3. Paste into the Claude Code chat and send.
  4. 4. Review the diff, accept the changes, redeploy.
  5. 5. Verify the fix using the checklist below.

Common mistakes to avoid

  • error_outlineSetting `document.title` inside a useEffect — crawlers without JS execution see the empty default.
  • error_outlineUsing the same title on every page (e.g., the company name alone).
  • error_outlineWriting titles over 60 characters — Google truncates anything beyond ~580px of pixel width.
  • error_outlineStuffing 5 keywords separated by pipes. One primary keyword + brand is plenty.
  • error_outlineForgetting to set a title at all on route files — some frameworks fall back to "React App" or the build tool name.

How to verify the fix worked

  • check_circleView page source (Ctrl+U) and confirm `<title>` appears with the right text in raw HTML, not only after JS runs.
  • check_circleRun `curl -s https://yoursite.com/page | grep "<title>"` — the correct title must appear.
  • check_circleCrawl the site with Screaming Frog or Sitebulb and sort by title — no duplicates allowed.
  • check_circleCheck Google Search Console → Indexing → Pages for "Duplicate title tag" warnings.

Frequently asked questions

What is the ideal title length?expand_more
10 to 60 characters, or roughly 580 pixels wide. Google truncates anything longer mid-sentence.
Does setting document.title in JavaScript count?expand_more
For Google, mostly yes — but with a delay and uncertainty. For AI crawlers (ChatGPT, Claude, Perplexity) it does not count at all. Always ship the title in the initial HTML.
Will Google rewrite my title?expand_more
Sometimes — since 2021 Google rewrites about 60% of titles in results. Clean, descriptive titles under 60 chars get kept; keyword-stuffed or duplicate titles get replaced.

Want all 34 prompts tailored to your Claude Code site?

Pantra scans your site in 10 seconds, detects the stack, and generates the exact prompts that apply — only the ones you actually need.

Scan my site

Related Claude Code prompts