Page titles and meta descriptions are the cheapest on-page fix there is, and the most often left in a bad state. A WordPress site inherits a default title pattern, a page builder duplicates a page and keeps its title, and a year later a dozen pages share the same snippet in search results.
You do not need a paid crawler to find this on a small business site. Here is a short script that reads the sitemap, fetches each page and reports the problems worth fixing. It uses the standard library plus nothing else.
What we are looking for
Google writes its own result titles and snippets, and it says so in its guidance on title links and snippets. That is not a reason to ignore them. The guidance is to give every page a unique, descriptive title and a useful description, and those are exactly the things a script can check:
- Missing title or missing meta description.
- Duplicate titles or descriptions across pages.
- Titles so long that they will be cut off (roughly over 60 characters is a sensible warning line) or so short that they say nothing.
- Descriptions that are very long or very short.
- Titles that are just "Home" or the site name repeated on every page.
The character limits are guidelines, not rules. Search results truncate by pixel width, so treat them as a prompt to look, not a pass or fail.
The script
import re, sys, urllib.request, collections from xml.etree import ElementTree as ET base = sys.argv[1].rstrip("/") ns = {"s": "http://www.sitemaps.org/schemas/sitemap/0.9"} def get(url): req = urllib.request.Request(url, headers={"User-Agent": "title-audit/1.0"}) return urllib.request.urlopen(req, timeout=15).read().decode("utf-8", "ignore") urls = [e.text for e in ET.fromstring(get(base + "/sitemap.xml")).iter("{%s}loc" % ns["s"])] titles, descs = collections.defaultdict(list), collections.defaultdict(list) for u in urls[:200]: try: html = get(u) except Exception as e: print("FETCH FAIL", u, e); continue t = re.search(r"<title[^>]*>(.*?)</title>", html, re.S | re.I) d = re.search(r'<meta[^>]+name=["\']description["\'][^>]*content=["\'](.*?)["\']', html, re.S | re.I) t = t.group(1).strip() if t else "" d = d.group(1).strip() if d else "" titles[t].append(u); descs[d].append(u) if not t: print("NO TITLE", u) elif len(t) > 65: print("LONG TITLE", len(t), u) elif len(t) < 15: print("SHORT TITLE", len(t), u) if not d: print("NO DESC", u) elif len(d) > 165 or len(d) < 50: print("DESC LENGTH", len(d), u) for label, group in (("TITLE", titles), ("DESC", descs)): for text, pages in group.items(): if text and len(pages) > 1: print("DUPLICATE", label, repr(text[:60]), pages) Run it with python3 audit.py https://example.co.uk. If the site uses a sitemap index, point it at one of the child sitemaps, or loop over them.
Reading the output
- Duplicates matter most. Two pages with the same title compete with each other and give a searcher no reason to pick either. Rewrite one around its own purpose.
- Missing descriptions are lower priority than missing titles. Google may write a snippet from the page anyway, but a hand-written one lets you lead with the reason to click.
- Do not fix everything at once. Start with the pages that already get impressions in Search Console, because a better title there pays back fastest. Leave low-value archive and tag pages alone, or set them to noindex if they add nothing.
Writing the replacements
A good title names the page's subject first, adds the place or audience if it genuinely applies, and puts the brand last. A good description is one or two sentences that say what the visitor will get and what to do next. No keyword lists, no all capitals, no promise the page does not keep.
Keep a spreadsheet of old title, new title and date changed. When you check Search Console a few weeks later you will know which edit to credit or reverse.
Where this fits
Titles and descriptions are one slice of on-page work, and they are the part you can hand to a junior or a script. The judgement calls, such as which pages deserve to rank for what, are the wider job of an SEO agency in Birmingham or any competent in-house person. Either way, run the audit before you quote: it takes a few minutes and tells you how much tidy-up a site really needs.
Written by Rocky V, Head of Operations at DigitalCave, an all-in-one web design, SEO and digital marketing agency in the West Midlands.