NewEdit your site from ChatGPT or Claude. Same rules as the built-in assistant.See how

← All guides

SEO

How to Optimize Title Tags and H1s with AI

Use AI to write title tags and H1s that match real search queries: what to feed the model, a prompt that works, what Google says, and what to check before you ship.

December 1, 20269 min readBy CMS Chat Team

To optimize a title tag and H1 with AI, give the model the page's real search queries from Google Search Console, the page's actual content and a few hard rules (keep the main phrase, one H1, title and H1 describing the same thing, no keyword stuffing), ask for several options, then pick one, fact-check it and ship it on one page at a time. AI is good at the wording. It cannot know which queries a page already earns unless you tell it, and that is where most AI-written titles go wrong.

The rest of this guide covers what the title tag and the H1 each do, what Google says about AI-written metadata, a prompt you can reuse, and the checks to run before and after the change.

Title tag vs H1: two jobs, one topic

The title tag is the <title> element in the page's <head>. It is not visible on the page itself, but Google uses it as a main source for the clickable headline in search results. The H1 is the main visible heading on the page, the first thing a visitor reads.

Google's title link documentation asks you to "write descriptive and concise text" for title elements, to give every page distinct title text, and to keep branding short, for example the site name at the start or end, separated by a hyphen, colon or pipe. The same page names "putting the title text in the first visible <h1> element on the page" as a way to make the main title stand out. Google also says that when it detects a problem with a title it "may try to generate an improved title link from anchors, on-page text, or other sources." In practice that means the title and the H1 should describe the same thing, even if the wording differs.

For the H1 itself, MDN's heading elements reference recommends: "Prefer using only one <h1> per page and nest headings without skipping levels." Google's SEO starter guide is more relaxed about structure: semantic heading order helps screen readers, but "from Google Search perspective, it doesn't matter if you're using them out of order." So follow MDN for accessibility and clean markup, and spend your SEO effort on the words.

A useful split:

  • Title tag: written for the search result. Lead with the phrase people type, add what makes the page different, end with the brand if there is room.
  • H1: written for the visitor who already clicked. It confirms they are in the right place, using the same main phrase in natural wording.

What Google says about AI-written titles

Google's guidance on using generative AI content does not ban AI help. It asks that the work meets Search Essentials and the spam policies, and it is specific about metadata: "This review also applies to metadata like <title> elements, meta description elements, structured data, and alternate texts for images, which can appear in Search results." It also says "it is critical to manually factcheck and review all AI-generated content for accuracy and trustworthiness before publishing."

Two practical rules come out of that:

  1. A human reads every title before it ships. The model may claim a service the business does not offer, a location it does not serve or a year that is wrong.
  2. Do not mass-produce pages around titles. The same guidance warns that generating many pages without adding value for users may violate the policy on scaled content abuse. Rewriting the title of a page that exists and has real content is a different thing from spinning up a hundred thin pages with keyword titles.

What to feed the model

Most weak AI titles come from weak input: "write an SEO title for my plumbing page." The model then guesses keywords. Give it facts instead.

  1. The page's top queries. In Search Console, open the Performance report, filter to the page, switch to Queries and sort by impressions. Copy the top five to ten, with impressions and average position. If the page has no data yet, use the phrase you want it to rank for and say so.
  2. The current title and H1. So the model knows what it is replacing and can keep what works.
  3. The page's real content. The first few paragraphs, or a short summary of what the page offers, for whom and where.
  4. Your constraints. Length target, brand format, words that must stay, claims that are off limits.

A prompt you can reuse

You are rewriting the title tag and H1 for one page. Current title: [title]. Current H1: [H1]. Page summary: [two or three sentences]. Top Search Console queries for this page, with impressions: [list]. Rules: keep the main query phrase in both the title and the H1, in natural wording. The title should be about 50 to 60 characters and end with " | [Brand]". The H1 must describe the same thing as the title but can be longer and friendlier. No keyword repetition, no claims that are not in the page summary, no clickbait. Give five title options and three H1 options, and for each title say which queries it covers.

Asking for several options and for the queries each one covers makes the model show its reasoning, and it gives you something to compare instead of a single answer to accept or reject.

Example

A page about a Leeds plumbing firm, with "emergency plumber leeds" as its top query and "24 hour plumber leeds" as the second, might get options like:

  • Title: "24-Hour Emergency Plumber in Leeds | Smith & Sons"
  • H1: "Emergency plumbing in Leeds, day or night"

Both keep "emergency plumber" and "Leeds", the title picks up the "24 hour" variant, and the H1 reads like a sentence a person would say. Before shipping, check the one thing the model cannot know: does the firm really answer calls 24 hours a day? If not, the option is out, however well it targets the query.

Checks before you ship

Run each option through a short list. These come straight from the Google and MDN pages above:

  • Main phrase kept. The top query's core words appear in the title and in the H1.
  • Distinct. No other page on the site has the same or a near-identical title.
  • No stuffing. Each phrase appears once. Google notes there is no reason to repeat the same words.
  • Short brand. Site name once, at the start or end.
  • Title and H1 agree. Same topic, same main phrase.
  • One H1. The template does not already output a second H1, for example a logo wrapped in an <h1>.
  • True. Every claim in the title matches the page and the business.
  • Meta description in step. If the title changed angle, the description should follow. Google's snippet documentation asks for a unique description per page and warns that "long strings of keywords" are less likely to be shown.

Ship one page, then measure

Change one page at a time and note the date, the old text and the new text. Google's starter guide says changes can take from hours to months to show up, and suggests waiting a few weeks before judging. Then compare clicks, CTR and average position for the same queries against your note. If the page lost its main query, put the old wording back.

Our guide to SEO-safe edits to titles, H1s and meta descriptions covers that workflow in more detail, including which edits to route to whoever owns SEO for the site.

When AI is the wrong tool

  • Template-driven titles. If hundreds of product or location pages share one title template, fix the template once. Page-by-page AI rewrites will drift and create near-duplicates.
  • Pages with no content yet. A great title on a thin page does not help. Write the page first.
  • A CMS with an SEO panel. If your CMS already has a title and description field with a search preview, use it, and use AI only to draft the text you paste in.
  • High-stakes pages. For the page that brings most of the site's traffic, AI can draft options, but the decision belongs to the person who owns the site's SEO.

FAQ

Should the title tag and H1 be the same?

They can be, and that is fine for simple pages. They do not need to match word for word. What matters is that both describe the same topic and both contain the main query phrase.

Can AI write meta descriptions too?

Yes, with the same input and the same review. Ask for a description that says what the page offers and for whom, with the most important point first, and check that it is unique to the page.

How long should an AI-written title be?

Google does not set a character limit, but long titles get cut off in results. Aim for the key phrase near the start so it survives truncation.

Where CMS Chat fits

CMS Chat edits sites whose content lives in a Git repository, such as Next.js, Astro, Hugo, Nuxt and plain HTML sites. You ask for a change in plain language, for example "make the homepage title about emergency plumbing in Leeds", and the AI finds the file, makes the edit and commits it, or opens a GitHub pull request for risky changes. Each mapped zone has a guardrail level: editable, warn, escalate or locked. Titles, meta descriptions and H1s are the kind of zone you can keep in warn mode, so the person editing sees a plain-language warning before anything commits.

With the optional Google Search Console connection, CMS Chat warns before an edit touches a title, H1 or meta description that ranks, which covers the "check the queries first" step above. Every change is a commit in the site's own repository, so the before and after are on record. See how it works, or read what an AI CMS is for the wider picture. You can also make the same edits from Claude or ChatGPT through the MCP connection.

Change your site by asking.

Sign up, connect your site and ask for your first change in plain words.

month to monthrevert any changebigger work stays with your agency

Prefer to see it first? Ask for a walkthrough