Sub topic 8
Why Search Engines Rewrite Titles
This chapter assumes you know basic HTML structure, how URLs and query strings work, and what a search results page looks like. It also assumes you have read the earlier chapters on the title tag, writing titles, and how snippets are generated.
You write a <title> element, publish the page, and then see something different in search results. This is normal. The title tag is a suggestion that the search engine can accept or replace. This chapter explains how the decision works, which patterns trigger a rewrite, and how to reduce unwanted rewrites.
The working model: the title tag is an input
Search engines build the displayed title link from several sources. Google's documentation says it uses signals such as:
- The contents of the
<title>element. - The main visible heading on the page, usually the
<h1>. - Other prominent text, such as headings styled to look like titles.
- Anchor text of links that point to the page.
- Open Graph titles (
og:title) and structured data names, in some cases.
The engine generates a candidate title (often your title tag, unchanged). It then asks whether the candidate describes the page well and suits the query. If it does not, it picks or assembles another one.
Two consequences follow:
- A rewrite is a judgment about quality, not a penalty. It does not mean your page is demoted.
- The rewrite can differ by query. The same page may show your title for one search and a modified one for another.
Common reasons for a rewrite
The title is too long
Display space is measured in pixels, not characters. A title wider than the space is cut with an ellipsis. Some engines go further and drop trailing words or the brand suffix. A common working range is 50 to 60 characters, but wide letters such as "W" use more room than "i". Treat the range as a guide and check real results.
The title is empty, generic, or a placeholder
Titles like "Home", "Untitled", "Page 1", or "New Document" tell users nothing. The engine usually replaces them with the <h1> or another heading.
Keyword stuffing and repetition
A title such as Shoes | Cheap Shoes | Buy Shoes | Best Shoes Online looks manipulative and gets replaced or trimmed. Repeating the same brand or phrase across the title is another trigger.
Boilerplate shared across pages
If every page on a site has the title Example Store, the title does not distinguish one page from another. The engine tends to substitute page-specific text.
Mismatch with the visible content
When the title says one thing and the <h1> says another, the engine may trust the heading. This often happens when a title is set in a CMS field and the page body is edited later without updating it.
Separators and brand placement
Engines often move or remove the site name. A title like Example Store - Trail Running Shoes for Beginners may be shown as Trail Running Shoes for Beginners | Example Store or with the brand dropped. Putting the brand at the end, after a consistent separator, makes it easier for the engine to identify and handle.
Query-specific rewriting
If a search contains terms that match a section of your page better than your title, the engine may surface that section's heading instead. This is a feature of how the result is tailored, and you cannot fully control it.
Reproducing the problem
The following table shows typical cases and the likely cause.
| What you see in results | Likely cause |
|---|---|
| Title ends with "..." | Title wider than the display limit |
| Your `<h1>` replaces the title tag | Title is generic, empty, or conflicts with the `<h1>` |
| Brand name missing or moved | Engine trimmed or reordered the brand segment |
| Title contains text from a link pointing at you | Anchor text matched the query better than the title |
| Different title for different queries | Query-dependent tailoring |
A diagnostic checklist
Work through these steps for a page whose title was rewritten.
- Search for the exact page and note the title shown. Try two or three realistic queries, because tailoring varies.
- View the page source, not the DOM in the inspector. Confirm there is exactly one
<title>and that it is in the<head>. - Compare the title to the
<h1>. Do they describe the same topic? - Count pixel width, or at least characters, and look for stuffing or repeated phrases.
- Check whether the title is generated by JavaScript after load. Crawlers may read the rendered result, but a mismatch between raw and rendered HTML can cause inconsistent output.
- Check other pages on the site for duplicates of this title.
A short script can help with steps 2 and 3 across many pages.
import re
import sys
import urllib.request
def fetch(url):
request = urllib.request.Request(url, headers={"User-Agent": "title-check/1.0"})
with urllib.request.urlopen(request, timeout=10) as response:
return response.read().decode("utf-8", errors="replace")
def first_match(pattern, html):
match = re.search(pattern, html, re.IGNORECASE | re.DOTALL)
if not match:
return ""
return re.sub(r"<[^>]+>|\s+", " ", match.group(1)).strip()
def report(url):
html = fetch(url)
titles = re.findall(r"<title[^>]*>", html, re.IGNORECASE)
title = first_match(r"<title[^>]*>(.*?)</title>", html)
h1 = first_match(r"<h1[^>]*>(.*?)</h1>", html)
print(url)
print(f" title tags : {len(titles)}")
print(f" title : {title!r} ({len(title)} chars)")
print(f" h1 : {h1!r}")
if len(titles) != 1:
print(" WARNING: expected exactly one title tag")
if len(title) > 60:
print(" WARNING: title may be truncated")
if not title:
print(" WARNING: title is empty")
if __name__ == "__main__":
for target in sys.argv[1:]:
report(target)Run it as python title_check.py https://www.example.com/shoes/trail-running. A regular expression is fine for a quick check, but it is not a full HTML parser. Use a parser such as html.parser or BeautifulSoup for production audits.
Reducing unwanted rewrites
Follow these practices, which come from the causes above:
- Give each page a unique title that names its main topic.
- Keep the title and the
<h1>aligned. They need not be identical, but they should agree. - Put the most important words first, so truncation removes the least valuable part.
- Use one consistent separator and place the brand last.
- Write for people. Describe the page in natural language rather than a list of keywords.
- Keep the title in the server-rendered HTML.
<head>
<title>Trail Running Shoes for Beginners | Example Store</title>
</head>
<body>
<h1>Trail Running Shoes for Beginners</h1>
</body>In this example the title and heading agree, the brand sits at the end, and the length is well inside the usual limit.
Edge cases
- Rewrites that look wrong but are correct. A rewritten title that includes the query's wording may simply be tailoring. Check several queries before acting.
- Pages with several valid headings. If a page has multiple
<h1>elements, the engine has more candidates, and it may pick one you did not expect. - Pagination and filters. Titles such as
Shoes - Page 2are legitimate. Missing page numbers on paginated URLs can produce duplicate titles that are then replaced. - Other search engines. Bing and others use similar signals but different thresholds. Verify in each engine you care about.
- Social previews.
og:titlecontrols link cards on social platforms. It does not control search results, though it can serve as a signal.
Exercise
A product page has the title "Home" and the h1 "Waterproof Hiking Boots for Wide Feet". Search results show "Waterproof Hiking Boots for Wide Feet | Example Store". What most likely happened, and what should you change?
Show answer
The engine judged the title "Home" too generic to describe the page and substituted the h1 text, then added the site name. Change the title tag to a page-specific one, such as "Waterproof Hiking Boots for Wide Feet | Example Store", so the title and h1 agree and no rewrite is needed.
Exercise
You search for your page with three different queries and see three slightly different titles. Do you have a bug? Name one thing to check anyway.
Show answer
Not necessarily. Engines can tailor the displayed title to the query. Check that the page has exactly one title element, that it is unique on the site, and that it agrees with the h1, so every variant the engine builds starts from a good source.