07887 423199me@richieaubin.com

Catch development indexing flags before release

Test the intended state of each template before rollout. A passing check on the homepage can miss an accidental noindex on an entire product or service section.

Release indexing checks example
Example image · CC0 1.0 licence

Choose a way to do this check

Crawl comparison on this site

  1. Upload matching before and after CSV exports with status, indexability and canonical columns.
  2. Investigate changes and compare the named control. A missing row may mean export scope changed.

Screaming Frog List mode

  1. Run both an expected-indexable URL and an intentionally excluded route through the candidate release.
  2. Compare their directives and canonicals, then run the same list after deployment.

Inspect pasted page source

  1. Check the published source for unexpected indexing instructions.
  2. Compare response headers separately and review rendered metadata when scripts can change it.

1. Choose a positive and negative control

Pick a normal public page and a public confirmation route intended to remain excluded. Maintain expected canonical URLs separately for each site or preview environment. If staging has an intentional global noindex, run this test on an isolated production-mode candidate accessible only to the authorised test runner. Do not remove staging authentication just to make the test pass.

2. Assert against the delivered response

Install requests and beautifulsoup4 in the test environment. Set CHECK_BASE to your authorised candidate and EXPECTED_CANONICAL to the exact URL the public guide should declare. This example prohibits any robots header on the guide as a project-specific rule and expects the confirmation page to carry an explicit robots meta noindex.

release_indexing.py · check one public template and one control
import os
import re

import requests
from bs4 import BeautifulSoup

base = os.environ["CHECK_BASE"].rstrip("/")
expected_canonical = os.environ["EXPECTED_CANONICAL"]

def document(path):
    response = requests.get(base + path, timeout=15, allow_redirects=False)
    assert response.status_code == 200, (path, response.status_code)
    soup = BeautifulSoup(response.content, "html.parser")
    assert soup.head is not None, path
    return response, soup.head

public, head = document("/guides/")
assert not public.headers.get("X-Robots-Tag")
assert [tag.get("href") for tag in head.select('link[rel~="canonical"]')] == [
    expected_canonical
]
for tag in head.find_all("meta"):
    if str(tag.get("name", "")).lower() in {"robots", "googlebot", "bingbot"}:
        assert not re.search(r"\b(?:noindex|none)\b", tag.get("content", ""), re.I)

_, private_head = document("/checkout/confirmation/")
flags = [tag.get("content", "") for tag in private_head.find_all("meta")
         if str(tag.get("name", "")).lower() == "robots"]
assert any(re.search(r"\bnoindex\b", value, re.I) for value in flags)

Run this as an ordinary Python process with assertions enabled. It tests the initial response only. Add a rendered check if scripts can change the head, and check robots.txt separately with a policy test appropriate to the target crawler.

3. Prove the check can fail

Introduce noindex into an isolated copy of the guide response and confirm the job fails. Restore it, then check that the excluded control still reports noindex. Repeat on the public edge after deployment because the CDN can add headers. Roll back if priority templates become unavailable or a known exclusion disappears.

Technical references

Frequently asked questions

Should every route have an identical rule?

No. Write expectations for public, excluded and access-controlled routes separately.

Can robots meta and HTTP headers disagree?

Yes. Check both channels and remove conflicting or redundant instructions.

Does this prove the page is indexed?

It proves only the response conditions in this test.

Should I disable staging protection for the test?

Keep staging protected. Run from an authorised environment with a representative fixture.

Written by Richie Aubin

Published