Sub topic 12
Auditing and Revising Existing Pages
This chapter assumes you can read basic HTML (head, body, title, h1 to h6) and know what a results page and a target keyword are. It also assumes you have met the earlier chapters on title tags, the h1, heading hierarchy and keyword stuffing. Here you apply that material to pages that already exist.
Why existing pages need a separate process
Writing a title for a new page is a blank-page task. Revising a live page is a change-management task. The page may already rank, already earn clicks, or already be linked from elsewhere. A careless rewrite can lose those gains.
A good audit is a short loop:
- Collect the current title, meta description and headings for each page.
- Compare them with the page's target keyword and search intent.
- Fix the flagged problems.
- Record what you changed and when.
- Check results later, then repeat.
What to check
Most problems fall into a few categories. Each has a detection method and a usual fix.
| Problem | How to detect it | Usual fix |
|---|---|---|
| Missing title | No `title` element, or it is empty | Write one around the target keyword |
| Duplicate titles | Two or more URLs share the same title text | Give each page a title that reflects its own topic |
| Truncated title | Title much longer than about 60 characters, or cut off with "..." in results | Move the keyword and the main idea to the start and shorten |
| Over-optimised title | Same word repeated three or more times, or a list of keyword variants | Rewrite as one readable phrase |
| Missing or multiple h1 | Zero or more than one `h1` | Use one `h1` that states the page's topic |
| Skipped heading level | An `h4` directly after an `h1` | Use the level that matches the real nesting |
| Vague headings | "More", "Info", "Overview" | Name the content of the section |
| Keyword absent from title and h1 | Exact phrase or a clear variation missing | Add it where it reads naturally |
Duplicates need a view across the whole site. Everything else can be judged page by page.
Gathering the data
For a handful of pages, view the source by hand. For a site of any size, use a crawler or an export from your content system. It should give you one row per URL with the title, the headings and the target keyword you assigned to the page.
If you have a search performance report such as Google Search Console, add two columns: the queries the page already appears for, and its click-through rate. A page that gets many impressions but few clicks often has a title problem. A page whose real queries differ from its assigned keyword may have a search intent mismatch. In that case, fix the keyword assignment before editing any text.
Automating the first pass
A script can catch the mechanical problems. It cannot judge whether a title is good. The script below uses only the Python standard library. It parses each page, runs the checks from the table, and finds duplicate titles across pages.
import re
from collections import Counter
from html.parser import HTMLParser
GENERIC = {"more", "overview", "introduction", "details", "info", "misc", "other"}
class PageParser(HTMLParser):
def __init__(self):
super().__init__()
self.title = ""
self.headings = [] # list of (level, text)
self._current = None
self._buffer = []
def handle_starttag(self, tag, attrs):
if tag == "title" or (len(tag) == 2 and tag[0] == "h" and tag[1] in "123456"):
self._current = tag
self._buffer = []
def handle_data(self, data):
if self._current:
self._buffer.append(data)
def handle_endtag(self, tag):
if tag == self._current:
text = " ".join("".join(self._buffer).split())
if tag == "title":
self.title = text
else:
self.headings.append((int(tag[1]), text))
self._current = None
def audit(html, keyword):
parser = PageParser()
parser.feed(html)
kw = keyword.lower()
issues = []
title = parser.title
if not title:
issues.append("title is missing")
else:
if len(title) > 60:
issues.append(f"title is {len(title)} characters; it may be truncated")
if kw not in title.lower():
issues.append("title does not contain the exact keyword phrase")
words = Counter(re.findall(r"[a-z0-9']+", title.lower()))
repeated = [w for w, n in words.items() if n >= 3]
if repeated:
issues.append(f"title repeats {repeated}")
h1s = [text for level, text in parser.headings if level == 1]
if not h1s:
issues.append("no h1")
elif len(h1s) > 1:
issues.append(f"{len(h1s)} h1 elements")
elif kw not in h1s[0].lower():
issues.append("h1 does not contain the keyword phrase")
previous = 0
for level, text in parser.headings:
if previous and level > previous + 1:
issues.append(f'h{level} "{text}" skips from h{previous}')
if text.lower() in GENERIC:
issues.append(f'generic heading: "{text}"')
previous = level
return parser.title, issues
PAGES = {
"weak": (
"repot a snake plant",
"<title>Snake plant | snake plant repotting | repot snake plant | best snake plant</title>"
"<h1>Snake Plant</h1>"
"<h4>Snake plant repotting tips snake plant</h4>"
"<h2>More</h2>",
),
"revised": (
"repot a snake plant",
"<title>How to Repot a Snake Plant: Step-by-Step Guide</title>"
"<h1>How to Repot a Snake Plant</h1>"
"<h2>When to repot</h2><h2>What you need</h2>"
"<h3>Choosing a pot</h3><h3>Choosing soil</h3>"
"<h2>Step-by-step repotting</h2><h2>Aftercare</h2>",
),
}
titles = Counter()
for name, (keyword, html) in PAGES.items():
title, issues = audit(html, keyword)
titles[title] += 1
print(f"{name}:")
for issue in issues or ["OK"]:
print(f" - {issue}")
for title, count in titles.items():
if count > 1:
print(f'duplicate title on {count} pages: "{title}"')Running it prints:
weak:
- title is 74 characters; it may be truncated
- title does not contain the exact keyword phrase
- title repeats ['snake', 'plant']
- h1 does not contain the keyword phrase
- h4 "Snake plant repotting tips snake plant" skips from h1
- generic heading: "More"
revised:
- OKTo audit real files, replace the PAGES dictionary with HTML read from disk and the keyword from your tracking sheet.
Reading the flags with judgment
Every flag is a prompt to look, not an order to change.
- Exact phrase missing. A title like "Repotting a Snake Plant: Steps and Soil Tips" may serve the keyword well even though it does not contain "repot a snake plant" verbatim. Accept a natural variation. Rewrite only if the main idea is unclear or the keyword's core terms are absent.
- Multiple h1 elements. HTML allows this, but one clear topic statement per page is easier to maintain and audit. Merge them or demote the extras.
- Duplicate titles. First decide whether the pages are really different. If they are, write distinct titles. If two pages target the same keyword and the same intent, you have a content overlap problem that no title can solve. Merge or differentiate the pages.
- A different title in the results. Search engines sometimes replace your title with other text, often the
h1or another on-page text. This happens most when the title is very long, stuffed with repeats, or does not match the page content. Fix those causes. Do not assume the rewrite means your title is wrong, because engines also rewrite good titles for particular queries.
Checking headings for accessibility
Screen reader users often move through a page by jumping from heading to heading, or by listing all headings. An outline that skips from h1 to h4 suggests missing content. A heading called "More" tells them nothing when read out of context.
During the audit, read your heading list on its own, without the body text. If you can tell what each section covers and how the sections nest, the outline works for both people and search engines. Never choose a heading level for its default size. Pick the level that matches the structure and set the visual size with CSS.
Worked revision
The weak page from the script has these problems: a 74-character title with a repeated keyword, no exact-phrase match, a vague h1, a skipped level, and a heading ("More") that says nothing. The original markup:
<!-- Weak: repeated keyword, skipped level, vague headings -->
<title>Snake plant | snake plant repotting | repot snake plant | best snake plant</title>
<h1>Snake Plant</h1>
<h4>Snake plant repotting tips snake plant</h4>
<h2>More</h2>The revision follows these decisions:
- Confirm the intent. People searching "repot a snake plant" want instructions, so the page type is a how-to guide. The title should say so.
- Rewrite the title. Put the keyword first, add the page type, and stay under about 60 characters (46 here).
- Rewrite the
h1. Make it state the topic in plain words and share the title's keyword. - Rebuild the outline. Use
h2for the main sections andh3for subsections, with no skipped levels. Each heading names its content. - Handle variations. Related terms such as "pot" and "soil" appear in subheadings because the sections are about them.
<head>
<title>How to Repot a Snake Plant: Step-by-Step Guide</title>
<meta name="description" content="Learn when and how to repot a snake plant, which pot and soil to use, and how to avoid root damage.">
</head>
<body>
<h1>How to Repot a Snake Plant</h1>
<h2>When to repot</h2>
<h2>What you need</h2>
<h3>Choosing a pot</h3>
<h3>Choosing soil</h3>
<h2>Step-by-step repotting</h2>
<h2>Aftercare</h2>
</body>Run the audit script on the new version and it reports no issues. That tells you the mechanical problems are gone, not that the page will rank better. The next section covers that.
Measuring and iterating
Search results change slowly, and many factors move at once. Make the evidence usable:
- Record a baseline. Before editing, note impressions, clicks, click-through rate and average position for the page over the last few weeks.
- Log the change. Keep a simple record with the date, URL, old text and new text.
- Change one page type at a time. If you rewrite every title on the site in one day, you cannot compare changes. Start with the pages that have the most impressions and the lowest click-through rate.
- Wait before judging. Search engines need time to recrawl and reprocess the page. Compare similar periods, such as the same days of the week, after a few weeks.
- Read the result by query. If impressions rise for the target keyword and click-through rate improves, keep the change. If you lose ground, you have the old text in your log and can restore it.
Schedule a repeat audit, for example every quarter or after any template change. Templates cause the largest errors. One bad title pattern in a template can create thousands of duplicate or truncated titles at once.
Common mistakes when revising
- Treating a flag as a verdict, such as forcing the exact phrase into a title that already reads well.
- Rewriting titles for pages that already perform well, with no baseline to compare against.
- Fixing the title but leaving a vague
h1and a skipped heading level, so the page still sends mixed signals. - Assigning the same target keyword to several pages, which produces near-duplicate titles by design.
- Skipping the log, then being unable to explain a ranking drop.
Exercise
A crawl shows that 40 category pages all have the title "Category | Example Shop", and one of them, "Garden Tools", gets many impressions but a low click-through rate. Name two actions you would take, in order, and say what you would record before starting.
Show answer
First, change the page template so that the title includes the category name, for example "Garden Tools: Buy Spades, Rakes and More | Example Shop", which removes the duplicate titles on all 40 pages at once. Second, check that the Garden Tools page's h1 and headings match the same keyword and that no heading level is skipped. Before starting, record a baseline for the Garden Tools page (impressions, clicks, click-through rate and average position over recent weeks) and log the old title text with the date of the change.
Exercise
Your script flags a page because the title "Repotting a Snake Plant: Steps and Soil Tips" does not contain the exact phrase "repot a snake plant". The h1 is "How to Repot a Snake Plant" and the page matches the how-to intent. What should you do, and why?
Show answer
Probably nothing, or at most a small edit after previewing it. The title contains the core terms in a natural variation, and the h1 carries the exact phrase, so the page's topic is clear. The exact-phrase check is a prompt to review, not a rule. Rewriting a title that already reads well and fits the intent risks losing existing performance with no clear gain.