Sub topic 16
Auditing and monitoring your metadata
This chapter assumes you can write titles, descriptions, and canonical tags, and that you know status codes and query strings. Here you check a whole site for mistakes and keep checking after launch.
What to check
Most metadata problems fall into four groups: missing, duplicate, truncated, or conflicting.
| Problem | Title | Description | Canonical |
|---|---|---|---|
| Missing | No `<title>` or an empty one | No tag, so the engine builds a snippet | No tag on a page with URL variants |
| Duplicate | Same title on many pages | Same text on many pages | Many different pages point to one URL |
| Truncated | Cut off in results (about 60 characters is a rough guide) | Cut off (about 155 characters is a rough guide) | Not applicable |
| Conflicting | Title differs from the `<h1>` topic | Describes another page | Canonical target redirects, returns 404, or is `noindex` |
Truncation depends on pixel width, not character count. Treat length limits as warnings, not errors.
The audit workflow
- Crawl the site with a crawler that reports the rendered head. If your framework sets tags with JavaScript, a raw HTML fetch can miss them.
- Export the title, description, canonical, status code, and indexability for each URL.
- Flag issues with rules like the script below.
- Fix the cause in the template or data source, not page by page.
A simple rule checker
This script takes crawl rows and reports issues. Run it with Node.
const pages = [
{ url: "https://www.example.com/a", title: "Trail Shoes | Example Store", description: "", canonical: "https://www.example.com/a" },
{ url: "https://www.example.com/b", title: "Trail Shoes | Example Store", description: "Compare trail shoes.", canonical: "/b" },
{ url: "https://www.example.com/c", title: "", description: "Size guide.", canonical: "" }
];
function audit(rows) {
const issues = [];
const titles = new Map();
for (const p of rows) {
if (!p.title) {
issues.push([p.url, "missing title"]);
} else {
if (p.title.length > 60) issues.push([p.url, "title may truncate"]);
if (titles.has(p.title)) issues.push([p.url, "duplicate title of " + titles.get(p.title)]);
else titles.set(p.title, p.url);
}
if (!p.description) issues.push([p.url, "missing description"]);
if (!p.canonical) issues.push([p.url, "missing canonical"]);
else if (!p.canonical.startsWith("https://")) issues.push([p.url, "canonical is not an absolute https URL"]);
}
return issues;
}
for (const [url, issue] of audit(pages)) console.log(url, "-", issue);Checking canonical targets is harder. For each canonical, request the target and confirm it returns 200, is indexable, and points to itself. A canonical chain (A to B to C) or a target that redirects is a conflicting signal.
Monitoring over time
Metadata breaks after releases, not only at launch. Set up these checks:
- Run the crawl weekly, or in your deploy pipeline, and fail the build if the number of missing or duplicate tags rises.
- Watch the "Pages" indexing report in Google Search Console. Statuses such as "Duplicate, Google chose different canonical than user" show where your hint was ignored.
- Use the URL Inspection tool to compare your declared canonical with the one Google selected.
- Track click-through rate per template in the Performance report. A sudden drop after a title change is a signal to roll back.
- When a title in results differs from yours, compare it with your
<title>,<h1>, and anchor text before editing. The cause is often a weak or repeated title.
Common errors
- Fixing symptoms in one page when a template generates the fault on thousands.
- Trusting a crawl of source HTML on a site that injects tags with JavaScript.
- Treating the selected canonical as a bug. It is a hint, and the engine may choose another URL.
Exercise
A crawl shows 400 product pages with the same title and a canonical that points to the category page. Name two problems and where you would fix them.
Show answer
The duplicate titles make pages hard to tell apart, and the canonical to the category page asks engines to drop the products from the index. Fix both in the product template: build the title from the product name and make the canonical a self-referencing absolute URL.