How to rewrite titles and meta descriptions at scale with Claude Code
How to rewrite titles and meta descriptions at scale with Claude Code

To rewrite titles and meta descriptions at scale with Claude Code, keep three jobs separate. First, Claude audits every page and finds the ones that break your rules: missing, duplicated, boilerplate, out of date. Second, it drafts replacements into a spreadsheet, not into your site. Third, after a person has reviewed and approved the rows, a script applies them to the source files and a re-crawl proves the counts. The drafting is quick. The review is where the quality comes from.
Google is direct about this. Its guidance on AI-generated content says to "manually factcheck and review all AI-generated content for accuracy and trustworthiness before publishing," and that this "also applies to metadata like <title> elements, meta description elements". This guide gives the steps, example prompts, the check for each step and what a person reviews.
Key Takeaways
- Google sets no length limit. Titles and snippets are "truncated in Google Search results as needed, typically to fit the device width." Character targets are your house style, not Google's rule.
- Google's own priorities: a title on every page, distinct text per page, no keyword stuffing, no boilerplate, and brand names kept short.
- For large, database-driven sites where hand-written meta descriptions aren't practical, Google says "programmatic generation of the descriptions can be appropriate and are encouraged." "Good descriptions are human-readable and diverse."
- Draft into a spreadsheet with the current text, the proposed text and the reason. Apply only approved rows.
- Google writes title links and snippets automatically and may not use yours. Measure in Search Console over weeks, not days.
What Google actually asks for
Google's title link guidance boils down to a few rules: "Make sure every page on your site has a title specified in the <title> element," write "descriptive and concise text," "Avoid keyword stuffing," and "Avoid repeated or boilerplate text." It also says to "Brand your titles concisely," with the site name at the start or end, separated by a hyphen, colon or pipe. One common problem it names is the obsolete title, where a page about this year still carries last year's date in its title.
For descriptions, Google's snippet documentation says snippets "are primarily created from the page content itself," and that Google "sometimes uses the meta description" when it gives "a more accurate description." It asks you to "Create unique descriptions for each page" and warns that "Identical or similar descriptions on every page of a site aren't helpful." Where you can't write every one, it says to prioritize, and "at the very least, create a description for the critical URLs like your home page and popular pages."
That gives you a rule set Claude can check mechanically. Add your own: brand name policy, character targets, banned phrases, and whether titles mirror the H1.
Step 1: Export the current titles and descriptions
Work on a staging or local copy, on a git branch. Ask Claude Code to crawl it and build one row per indexable page.
Example prompt: Crawl the local build and create titles-audit.csv with one row per indexable page: URL, template, title, title length, meta description, description length, H1, and the page's visible date if it has one. Skip pages marked noindex and redirects. Report the row count.
If you have Search Console data, add clicks and impressions per page. Claude Code can write a script that calls Google's Search Console API with credentials you set up yourself. Keep the credentials file out of Claude's reach with a deny rule, and never paste keys into a prompt.
The check: the row count matches the number of indexable pages in your build or sitemap. If it's lower, the crawl missed a section.
Step 2: Flag the rows that break the rules
Ask Claude to score every row against the rules, rather than rewrite everything. Rewriting titles that already work just creates risk and review work.
| Problem | How Claude can detect it |
|---|---|
| Missing or empty title or description | Empty field, or a title that is only the brand name |
| Duplicates | Identical or near-identical text on more than one URL |
| Boilerplate | Long shared text that varies by only one word |
| Obsolete dates | A year in the title older than the page's visible date |
| Mismatch with the page | Title topic differs from the H1 or first paragraph |
| Keyword stuffing | The same word or phrase repeated in one title |
| Over your house length target | Character count above the target you set |
The check: read the flagged list for one template. If it flags pages you consider fine, tighten the rules before drafting.
Step 3: Draft replacements into the spreadsheet
Have Claude draft only for flagged rows, writing into new columns, with the reason for each change. For long lists, work in batches by template or section, and use /clear between unrelated batches to keep each session focused.
Example prompt: For each flagged row in titles-audit.csv, draft a new title and meta description in new columns. Base them only on that page's H1 and first two paragraphs. Keep titles near 55 characters and descriptions between 120 and 155, end titles with " | Brand" only on service pages, and don't add prices, claims, dates or numbers that aren't on the page. Add a column explaining each change.
That last instruction is the most important one. A model writing a description will happily add "free shipping" or "since 1998" because it sounds right. Google's guidance reminds you that "generative models don't retrieve facts, but predict a likely sequence of words." Confining the draft to facts on the page makes review much faster.
For very large sites, Claude Code can run the drafting as a script in non-interactive mode with claude -p, page by page. Our guide to headless mode and batch jobs covers that setup and its limits.
Step 4: A person reviews the drafts
Review in priority order: pages with the most impressions and clicks first, then the home page and service or product pages, then the long tail. For each row, the reviewer asks:
- Is every fact true and on the page: services, locations, prices, credentials?
- Does it describe this page, not the whole site?
- Would a person searching for this page recognize it?
- Is any claim one your business can't back up, especially in legal, health or financial topics?
Mark each row approved, edited or rejected. Only approved and edited rows go forward. For a reviewer who isn't technical, how to review a diff when you aren't a developer helps with the next step.
Step 5: Apply approved rows to the source, not the output
Titles and descriptions live in different places on different sites: in page front matter or data files on a static site, in a theme template, or in an SEO plugin's fields in a CMS database. Ask Claude to find the real source before writing any script.
Example prompt: Before changing anything, show me where the title and meta description for three sample URLs actually come from. Then write a script that applies only rows marked approved or edited in titles-audit.csv to those source fields. It should report how many it changed, skipped and couldn't find.
Three habits from our own site apply here. Check the second and last page the script changes, not just the first. If replacement text can contain a dollar sign, make sure the script handles it; on eseospace.com a JavaScript replace turned "$1" in "$1,200" into the first matched group. And edit the source of truth, since a rebuild will overwrite edits made in generated files. Those mistakes are written up in common Claude Code mistakes on websites.
The check: the script's "changed" count equals the number of approved rows. Run it a second time. It should change nothing.
Step 6: Re-crawl and compare
Re-run the crawl from step 1 on the updated build and compare it with the approved spreadsheet.
| Check | Pass condition |
|---|---|
| Approved rows | Live text matches the approved text exactly |
| Unapproved rows | Unchanged from the original crawl |
| Duplicates | None left among approved pages |
| Encoding | No broken characters, stray HTML entities or garbled prices |
| Other SEO elements | Canonicals, robots and H1s are unchanged |
The last row is a parity check. When we rebuilt eseospace.com, a parity check across titles, meta descriptions, robots, canonicals, structured-data types and H1s showed zero differences across all 217 pages checked, after one fix. Running the same comparison after a bulk edit catches collateral damage. A person then reviews the diff and approves the deploy.
Step 7: Measure after launch
Google's title link page says Google "has to recrawl and reprocess the page to notice updates," which "may take a few days to a few weeks." Then the result may still differ, because "Google's generation of title links on the Google Search results page is completely automated." So compare clicks and click-through rate in Search Console over several weeks, on the pages you changed versus a set you didn't. Don't expect a promised lift. If Google keeps showing a different title, compare yours with the page's H1 and main visible title, which Google also uses as sources.
What a person must review
- The rules themselves, especially brand policy and length targets.
- Every drafted row on high-traffic and money pages, and a random sample of the rest.
- Any row that adds a number, price, location or credential.
- The script's counts, and the re-crawl comparison before deploy.
Structured data needs the same fact-checking; see adding or fixing structured data at scale. For the wider SEO toolkit, start with Claude Code for technical SEO. For where human editing adds the most value, see AI-generated vs human-edited content.
Conclusion
Claude Code turns a title and meta description project into an audit, a reviewable spreadsheet and a tested script. Keep the steps separate: flag, draft into a sheet, have a person approve, apply to the source, re-crawl, and measure over weeks. Confine drafts to facts on the page, and never let a script apply rows nobody approved. If you'd like an audit and prioritized list done for you, see our SEO audit services. More guides are in our Claude Code Guide.
Frequently asked questions
How long should a title tag be?
Google sets no limit. It says "there's no limit on how long a <title> element can be," but the title link "is truncated in Google Search results as needed, typically to fit the device width." Pick a house target that keeps the main point near the start.
Is it OK to have AI write meta descriptions?
Yes, with review. For large sites, Google says programmatic generation "can be appropriate and are encouraged" and that good descriptions are "human-readable and diverse," and its AI guidance says to fact-check AI-written metadata before publishing.
Why does Google show a different title than mine?
Google builds title links automatically from several sources, including the <title> element, the main visible title, H1s and links to the page. It may change yours when it's vague, stuffed, boilerplate or doesn't match the page.
Should every page get a new title?
No. Rewrite pages that break your rules or underperform in Search Console. Changing titles that already work adds risk and review time with no clear benefit.
Can Claude Code update titles in WordPress?
Yes, on a staging copy, through your SEO plugin's import tools or WP-CLI, whose wp post command "Manages posts, content, and meta." Find where your plugin stores the title before writing any script, and test on a few posts first.
Put this into action with eSEOspace
We help businesses grow with seo, geo & aeo that actually performs. Explore the services behind this guide:
Get a FREE Audit
We'll perform a comprehensive SEO, AEO, GEO & CRO audit of your website — completely free — and show you exactly how to outrank your competitors.
Don't have a site yet? Get in touch →
Get a FREE GEO/AEO/SEO Audit
We'll analyze your site's SEO, GEO, AEO & CRO — completely free — and show you exactly how to get found across Google and AI answers.
Don't have a site yet? Get in touch →
Great — your audit is on the way!
We'll send your free SEO/GEO/AEO/CRO audit within the next few hours. Where should we send it?
You're all set! ✓
Your free audit is being prepared — check your inbox in the next few hours. Talk soon!
On this page
- Key Takeaways
- What Google actually asks for
- Step 1: Export the current titles and descriptions
- Step 2: Flag the rows that break the rules
- Step 3: Draft replacements into the spreadsheet
- Step 4: A person reviews the drafts
- Step 5: Apply approved rows to the source, not the output
- Step 6: Re-crawl and compare
- Step 7: Measure after launch
- What a person must review
- Conclusion
- Frequently asked questions





