Check 46.13 · Automation and quality control

Review template changes

Compare the title, canonical, robots, H1, hreflang and JSON-LD of each template before and after a change, and block regressions before they go live.

Priority
Complementary
Difficulty
Intermediate
Estimated time
3 h to 1 day
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

A template produces the code of hundreds or thousands of pages: product page, article, category, service page. An error in a template is therefore repeated on all those pages at once. Reviewing template changes means recording the SEO elements of a sample of URLs per template before the change, recording them again afterwards, and blocking the release as long as a critical difference has not been explained. Once this check is done, no change to a theme, a layout or an SEO plugin goes to production without this comparison.

Why it matters

The most expensive SEO regressions rarely come from an isolated page. They come from a shared file: a rewritten header.php that loses the canonical tag, a layout component that turns the H1 into a div, a plugin update that adds noindex to paginated pages, a new theme that no longer generates the Product JSON-LD.

Visually, nothing changes: the page displays, the client sees no difference, functional acceptance testing passes. Only the source code has changed, and only bots read it. Google and Bing eventually recrawl the pages and apply the new directives: deindexing, change of canonical page, loss of rich results. Generative engines' crawlers, which often read the HTML without running JavaScript, likewise lose the content or structured data removed from the initial code.

A check before release costs a few minutes. A regression discovered three weeks later in Search Console costs traffic, then recrawling time after the fix.

What it improves

  • Indexing noindex tags, wrong canonicals and redirects added by mistake are stopped before they reach bots.
  • Rich results The disappearance of a Schema.org type (Product, Article, BreadcrumbList) is detected before Search Console reports it.
  • Readability for generative engines Content and structured data stay in the initial HTML.
  • Cost of fixing An error fixed on staging requires neither a recrawl nor a wait.
  • Rankings No direct effect; the check prevents losses, it does not bring gains.

How to check

Answer these questions:

  1. Is there a list of the site's templates, with one or two representative URLs for each?
  2. Before the last theme or layout change, did someone compare the source code of those URLs before and after?
  3. Can an automatic update of the theme, the CMS or the SEO plugin go to production without a check?
  4. Do template changes go through staging and a review?

Quick test on one URL, to run on each template before and after a change:

curl -s -A "Mozilla/5.0" https://example.com/produits/the-vert-sencha/ | grep -o -i -E '<title>[^<]*</title>|<link[^>]*rel="canonical"[^>]*>|<meta[^>]*name="robots"[^>]*>|<h1[^>]*>|application/ld\+json'

A compliant result is identical before and after, except for the elements the change was meant to modify.

How to implement

Before you start

Take an inventory of the templates and choose a fixed sample. Example for the fictitious store Thé des Lisières:

Template Reference URL Why this one
Home page / Most linked page
Category /thes-verts/ Pagination and filters
Category, page 2 /thes-verts/?page=2 Directives on paginated pages
Product page /produits/the-vert-sencha/ Product in stock, with reviews
Out-of-stock product page /produits/the-blanc-pai-mu-tan/ Template variant
Blog post /blog/temperature-infusion-the/ Article JSON-LD, author
Legal page /mentions-legales/ Check for a possible noindex

Then list what to compare and what blocks the release:

Element Blocking difference
HTTP status code and redirect Always
Robots directives (meta tag and X-Robots-Tag header) Always
Canonical Always
Title Disappearance, or unplanned change
H1 Disappearance, duplicate or changed text
Hreflang Number or language codes changed
JSON-LD types Type removed
Meta description, number of links To check, not blocking

Finally, work on a staging site protected by authentication and fed with a recent copy of the production database: without identical content, the comparison fills up with irrelevant differences. See protect and audit the staging site (opens in a new tab).

With the free script

This Python script uses only the standard library. For each reference URL, it records the HTTP status code, the redirect, the title, the meta description, the robots directives, the canonical, the H1s, the hreflang tags, the JSON-LD types and the number of links, then compares two snapshots. Save it as seo_gabarits.py:

#!/usr/bin/env python3
"""Record the SEO elements of each template's reference URLs and compare two snapshots."""
import base64, json, os, sys
from html.parser import HTMLParser
from urllib.error import HTTPError, URLError
from urllib.request import HTTPRedirectHandler, Request, build_opener

UA = "Mozilla/5.0 (compatible; controle-gabarits/1.0)"
BLOQUANT = {"status", "location", "robots", "canonical", "title", "h1", "hreflang", "jsonld"}


class NoRedirect(HTTPRedirectHandler):
    def redirect_request(self, *args):
        return None


def jsonld_types(raw):
    try:
        data = json.loads(raw)
    except ValueError:
        return ["INVALID JSON-LD"]
    found = []

    def walk(node):
        if isinstance(node, list):
            for item in node:
                walk(item)
        elif isinstance(node, dict):
            kind = node.get("@type")
            if kind:
                found.extend(kind if isinstance(kind, list) else [kind])
            for value in node.values():
                walk(value)

    walk(data)
    return found


class Seo(HTMLParser):
    def __init__(self):
        super().__init__()
        self.data = {"title": "", "description": "", "robots": "", "canonical": "",
                     "h1": [], "hreflang": [], "jsonld": [], "links": 0}
        self.capture, self.buffer = None, ""

    def handle_starttag(self, tag, attrs):
        a = {k: (v or "") for k, v in attrs}
        rel = a.get("rel", "").lower().split()
        if (tag == "title" and not self.data["title"]) or tag == "h1" or (
                tag == "script" and a.get("type") == "application/ld+json"):
            self.capture, self.buffer = tag, ""
        elif tag == "meta" and a.get("name", "").lower() == "description":
            self.data["description"] = a.get("content", "").strip()
        elif tag == "meta" and a.get("name", "").lower() == "robots":
            self.data["robots"] = a.get("content", "").lower().replace(" ", "")
        elif tag == "link" and "canonical" in rel:
            self.data["canonical"] = a.get("href", "")
        elif tag == "link" and "alternate" in rel and a.get("hreflang"):
            self.data["hreflang"].append(a["hreflang"].lower())
        elif tag == "a" and a.get("href"):
            self.data["links"] += 1

    def handle_data(self, data):
        if self.capture:
            self.buffer += data

    def handle_endtag(self, tag):
        if tag != self.capture:
            return
        text = " ".join(self.buffer.split())
        if tag == "title":
            self.data["title"] = text
        elif tag == "h1":
            self.data["h1"].append(text)
        else:
            self.data["jsonld"] += jsonld_types(self.buffer)
        self.capture = None


def fetch(base, path):
    headers = {"User-Agent": UA}
    auth = os.environ.get("BASIC_AUTH")
    if auth:
        headers["Authorization"] = "Basic " + base64.b64encode(auth.encode()).decode()
    try:
        resp = build_opener(NoRedirect).open(Request(base + path, headers=headers), timeout=30)
    except HTTPError as err:
        resp = err
    except URLError as err:
        return {"status": f"ERROR {err.reason}"}
    page = Seo()
    if resp.status == 200:
        page.feed(resp.read().decode("utf-8", "replace"))
    row = page.data
    header = "" if os.environ.get("IGNORE_X_ROBOTS") else (resp.headers.get("X-Robots-Tag") or "")
    row["status"] = resp.status
    row["location"] = resp.headers.get("Location", "")
    row["robots"] = ",".join(x for x in (row["robots"], header.lower().replace(" ", "")) if x)
    row["hreflang"] = sorted(row["hreflang"])
    row["jsonld"] = sorted(set(row["jsonld"]))
    return row


def snapshot(urls_file, base, out):
    base, pages = base.rstrip("/"), {}
    with open(urls_file, encoding="utf-8") as f:
        for line in f:
            if not line.strip() or line.startswith("#"):
                continue
            template, path = (x.strip() for x in line.split(";", 1))
            print(f"{template} {path}")
            pages[path] = {"template": template, **fetch(base, path)}
    with open(out, "w", encoding="utf-8") as f:
        json.dump({"base": base, "pages": pages}, f, ensure_ascii=False, indent=1)


def compare(file_a, file_b):
    with open(file_a, encoding="utf-8") as fa, open(file_b, encoding="utf-8") as fb:
        a, b = json.load(fa), json.load(fb)

    def norm(value):
        if isinstance(value, str):
            for base in (a["base"], b["base"]):
                value = value.replace(base, "")
        return value

    diffs = []
    for path, before in a["pages"].items():
        after = b["pages"].get(path, {})
        for field in sorted((set(before) | set(after)) - {"template"}):
            old, new = norm(before.get(field)), norm(after.get(field))
            if old != new:
                level = "BLOCKING" if field in BLOQUANT else "to check"
                diffs.append(f"[{level}] {before['template']} {path} {field}: {old!r} -> {new!r}")
    print("\n".join(diffs) or "No differences.")
    return 1 if any(d.startswith("[BLOCKING]") for d in diffs) else 0


if __name__ == "__main__":
    if sys.argv[1] == "snapshot":
        snapshot(*sys.argv[2:5])
    else:
        sys.exit(compare(*sys.argv[2:4]))

Create the list of reference URLs, gabarits.txt, in the template;path format:

# template;path
accueil;/
categorie;/thes-verts/
categorie-page-2;/thes-verts/?page=2
produit;/produits/the-vert-sencha/
produit-rupture;/produits/the-blanc-pai-mu-tan/
article;/blog/temperature-infusion-the/

Two uses:

# 1. Production versus staging, before the release
python3 seo_gabarits.py snapshot gabarits.txt https://example.com prod.json
BASIC_AUTH="user:password" IGNORE_X_ROBOTS=1 \
  python3 seo_gabarits.py snapshot gabarits.txt https://staging.example.com preprod.json
python3 seo_gabarits.py compare prod.json preprod.json

# 2. Production before and after the deployment
python3 seo_gabarits.py snapshot gabarits.txt https://example.com avant.json
# ... deployment ...
python3 seo_gabarits.py snapshot gabarits.txt https://example.com apres.json
python3 seo_gabarits.py compare avant.json apres.json

IGNORE_X_ROBOTS=1 neutralizes the X-Robots-Tag: noindex header that staging sites often send on every page; never use it on production. The addresses of both hosts are removed before comparison: a canonical https://staging.example.com/thes-verts/ is thus equivalent to https://example.com/thes-verts/. The compare command exits with code 1 when there is a blocking difference, which makes it possible to stop a deployment pipeline.

The script reads the initial HTML, without running JavaScript. If part of the SEO is injected in the browser, add the rendering check from the Next.js section.

With Screaming Frog

Versions Screaming Frog SEO Spider with a paid license, November 2026.

Crawl comparison mode compares two saved crawls, and can match two different hosts:

  1. Switch to list mode (Mode > List) and load the production reference URLs, then save the crawl. Do the same with the staging URLs; staging HTTP authentication is set in the crawler configuration.
  2. Open Mode > Compare and select the two crawls.
  3. In the comparison configuration, use URL mapping to match https://staging.example.com to https://example.com, and change detection for titles, meta descriptions, H1s and structured data.

The tabs then show, for each element, the new, removed, modified or unchanged URLs. The exact labels of the options are in the tool's user guide.

With a continuous monitoring service

Services such as Conductor Monitoring or Little Warden monitor production continuously and alert when an element changes: robots.txt, redirects, content, SEO tags depending on the tool and the plan. They detect after the fact what the staging check should have stopped: keep them as a safety net, especially for changes made outside any deployment (site editor, plugin updated automatically). See monitor titles and structured data (opens in a new tab).

WordPress

Versions WordPress 6.6 to 7.1.

Three sources of template changes often escape the check:

  • Block themes: templates modified in Appearance > Editor > Templates are saved in the database and take precedence over the theme files. They therefore go through neither Git nor staging. Restrict this right to administrators and run the snapshot again after each change.
  • Automatic updates: an update of the theme or of the SEO plugin (Yoast SEO, Rank Math, SEOPress) can change the <head> code across the whole site. In Plugins and Appearance > Themes, disable auto-updates for these items and apply them on staging first.
  • Theme files: edit a child theme versioned in Git, never the parent theme or the admin file editor. Disable the latter in wp-config.php:
define('DISALLOW_FILE_EDIT', true);

To list what is going to change before an update, use WP-CLI on staging:

wp theme list --update=available
wp plugin list --update=available

Then run the script's snapshot, apply the updates, run the snapshot again and compare. Most WordPress hosts offer a one-click staging copy: it is the right place for this test.

Shopify

Versions Shopify, all plans, November 2026 interface.

Never edit the published theme directly. In Online Store > Themes, open the … menu of the live theme, choose “Duplicate”, edit the copy, then use the copy's preview for the snapshot: its URL contains the preview_theme_id parameter. Add this parameter to each path in gabarits.txt:

produit;/products/the-vert-sencha?preview_theme_id=123456789

For teams that develop with Shopify CLI, push the working version to an unpublished theme:

shopify theme push --unpublished --json

With the GitHub integration (Online Store > Themes > Add theme > Connect from GitHub), every change made in the theme editor is committed to the connected branch: the repository keeps track of template changes made outside the development team. Store apps can also inject code into pages: take a new snapshot after installing or updating an app that touches product pages.

Laravel

Versions Laravel 12 and 13.

The templates are the Blade views in resources/views. Add one test per template that checks the SEO tags in the HTML response, and run it before every merge. File tests/Feature/SeoTemplatesTest.php:

<?php

namespace Tests\Feature;

use App\Models\Product;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class SeoTemplatesTest extends TestCase
{
    use RefreshDatabase;

    public function test_product_template_keeps_its_seo_tags(): void
    {
        $product = Product::factory()->create(['slug' => 'the-vert-sencha', 'name' => 'Thé vert Sencha']);

        $response = $this->get("/produits/{$product->slug}");

        $response->assertOk();
        $response->assertSee('<title>Thé vert Sencha', false);
        $response->assertSee('<link rel="canonical" href="'.url("/produits/{$product->slug}").'">', false);
        $response->assertDontSee('noindex', false);
        $response->assertSee('"@type":"Product"', false);
        $this->assertSame(1, substr_count($response->getContent(), '<h1'));
    }
}

Adapt the strings to your exact markup (attribute order, JSON-LD encoding). Run them with php artisan test --filter=SeoTemplatesTest. To protect the views themselves, add a CODEOWNERS rule (GitHub section below) on resources/views/.

Next.js

Versions Next.js 15 and 16 (App Router).

SEO tags come from the metadata object or the generateMetadata function of the page.tsx and layout.tsx files, and a change in a shared layout.tsx affects every page below it. Test the HTML actually served, after next build and next start, with Playwright. File tests/seo-gabarits.spec.ts:

import { test, expect } from '@playwright/test';

const pages = [
  { gabarit: 'produit', path: '/produits/the-vert-sencha', title: /Thé vert Sencha/ },
  { gabarit: 'article', path: '/blog/temperature-infusion-the', title: /Température d'infusion/ },
];

for (const p of pages) {
  test(`template ${p.gabarit}: SEO elements`, async ({ request, page }) => {
    const response = await request.get(p.path);
    expect(response.status()).toBe(200);
    expect(response.headers()['x-robots-tag'] ?? '').not.toContain('noindex');

    const html = await response.text();
    expect(html).toContain('rel="canonical"');
    expect(html).toContain('application/ld+json');

    await page.goto(p.path);
    await expect(page).toHaveTitle(p.title);
    await expect(page.locator('h1')).toHaveCount(1);
    await expect(page.locator('meta[name="robots"][content*="noindex"]')).toHaveCount(0);
  });
}

The first part reads the initial HTML, the one most bots read; the second checks the rendered page. Declare the test address in use.baseURL in playwright.config.ts. Integrating these tests into the pipeline is detailed in integrate SEO, performance and accessibility tests into CI/CD (opens in a new tab).

With GitHub

Versions GitHub, Free, Team and Enterprise plans, November 2026.

Require an SEO review on template files. Create .github/CODEOWNERS:

# Templates: SEO review required
/resources/views/            @example-org/seo
/app/**/layout.tsx           @example-org/seo
/wp-content/themes/          @example-org/seo
/templates/                  @example-org/seo
/sections/                   @example-org/seo

Then, in Settings > Branches, edit the protection rule for the main branch and tick “Require review from Code Owners”. A pull request that touches these folders can no longer be merged without the approval of a member of the designated team, who attaches the result of the compare script to their review.

Approval procedure

Formalize the rule in four steps, whatever the tooling:

  1. Baseline snapshot of production, just before the deployment.
  2. Snapshot of staging and comparison: no unexplained blocking difference.
  3. Release, then a new snapshot of production and comparison with the baseline snapshot.
  4. Recording of the change and the result in the change history (opens in a new tab).

If a blocking difference is discovered in production, revert to the previous version of the template rather than fixing it in a rush. See prepare a rollback plan (opens in a new tab).

Common mistakes

  • Checking only the display: visual acceptance testing sees neither the canonical, nor the robots directives, nor the JSON-LD.
  • A single reference URL for the whole site: each template and each variant (out of stock, page 2, product without reviews) has its own code.
  • Comparing against a staging site with stale content: content differences drown out template differences.
  • Releasing production with the staging noindex: it is the most frequent regression after a redesign. See remove indexing blocks on the live site (opens in a new tab).
  • Forgetting changes made outside deployments: WordPress site editor, Shopify theme editor, apps and plugins updated automatically.
  • Picking up the title of an SVG icon: an in-house tool that reads every <title> tag confuses the document's with those of inline SVGs. The script only keeps the first one.
  • Blocking everything: a difference in meta description or number of links deserves a look, not a halt to the release.

Frequently asked questions

Which SEO elements should you compare when you change a template?

Compare first the HTTP status code, the robots directives in the meta tag and in the X-Robots-Tag header, the canonical, the title, the H1, the hreflang tags and the JSON-LD structured data types. A difference in any of them must be explained before the release. The meta description, the number of links and the length of the text deserve a check, but do not on their own justify blocking a deployment.

How many URLs should you test per template?

One or two reference URLs per template are enough, as long as they cover its variants: out-of-stock product, paginated category page, article without an image, translated page. On a store, about ten URLs often cover everything. What matters is keeping the same list from one check to the next, so that the comparisons are about the template and not about the choice of pages.

How do you check a Shopify theme before publishing it?

Duplicate the published theme from Online Store, then Themes, edit the copy and record the SEO elements of its pages through the preview, whose URL contains the preview_theme_id parameter. Compare this snapshot with the one of the live theme: canonical, title, H1, robots and structured data must be identical, except for intended changes. Only then publish it, and take a new snapshot on the live store.

Can a WordPress SEO plugin update break indexing?

Yes. A plugin such as Yoast SEO, Rank Math or SEOPress generates the titles, canonicals, robots directives and structured data for the whole site: an update that changes a default setting or a behavior affects every page at once. Disable its automatic update, apply it on staging first, compare a sample of URLs per template before and after, and only then update production.

Updated on

Topic checklist (PDF)

And now?

In the “Automation and quality control” topic

  1. Schedule automated crawls
  2. Monitor HTTP status codes and uptime
  3. Monitor robots.txt and noindex
  4. Monitor canonicals and sitemaps
  5. Monitor titles and structured data
  6. Monitor performance
  7. Monitor backlinks and brand mentions
  8. Monitor rankings
  9. Schedule recurring GEO tests
  10. Create alerts for traffic and conversion drops
  11. Create deindexing alerts
  12. Integrate SEO, performance and accessibility tests into CI/CD
  13. Review template changes
  14. Keep a history of changes
  15. Keep an incident log
  16. Generate periodic reports
  17. Assign an owner to each issue