Sub topic 14
Verifying fixes with a recrawl
This chapter assumes you can read a crawl export, group rows with pandas, and interpret status codes, canonical links and noindex directives from earlier chapters. After you ship a fix, you still need evidence that it worked. A recrawl gives you that evidence.
Why a fix is not done when it ships
A deployed change can fail quietly. A redirect rule may match the wrong paths. A canonical tag may point at a URL that itself redirects. A template change may reach only some page types. Verification compares a crawl taken before the fix with a crawl taken after it, using the same settings.
Keep these things constant between the two crawls:
- The start URLs, crawl scope and user agent.
- The rendering mode (raw HTML or rendered).
- The same extraction rules for body text, so hashes and word counts are comparable.
What to check for each fix type
Each remediation leaves a different signature in the crawl. Check for that signature, not just that the page count changed.
| Fix | What the recrawl should show |
|---|---|
| Redirect | Old URLs return 301 and land on a 200 URL in one hop |
| Canonical | Duplicates have a canonical pointing to the preferred URL, which is indexable and self-canonical |
| Noindex | Pages return 200 with a noindex directive, are not blocked by robots.txt, and are not in the sitemap |
| Consolidate | Merged URLs redirect to the target, and the target's word count and content have grown |
| Improve | Word count and unique content rise, and the page no longer shares a hash or high similarity with others |
Comparing two crawls
The script below joins the before and after exports on URL. It reports the URLs in each duplicate group from the earlier crawl and what each one looks like now. It assumes both files have the columns url, status, body_hash and word_count.
import pandas as pd
before = pd.read_csv("crawl_before.csv")
after = pd.read_csv("crawl_after.csv")
merged = before.merge(
after, on="url", how="left", suffixes=("_before", "_after"), indicator=True
)
# Group sizes in the earlier crawl, counting only 200 pages.
ok_before = before[before["status"] == 200]
sizes = ok_before.groupby("body_hash")["url"].transform("count")
dupe_urls = set(ok_before.loc[sizes > 1, "url"])
check = merged[merged["url"].isin(dupe_urls)].copy()
check["still_200"] = check["status_after"] == 200
check["missing_from_recrawl"] = check["_merge"] == "left_only"
print("Duplicate URLs checked:", len(check))
print("Still return 200:", int(check["still_200"].sum()))
print("Not found in recrawl:", int(check["missing_from_recrawl"].sum()))
survivors = check[check["still_200"]]
remaining = survivors.groupby("body_hash_after")["url"].agg(list)
print(remaining[remaining.str.len() > 1])A URL that is missing from the recrawl is not proof of success. It may simply have fallen out of your crawl scope, for example because nothing links to it anymore. Test a sample of old URLs directly to confirm their status codes.
The last lines list groups that still share a hash after the fix. If a group appears there, the duplicate still exists, and you should open the signals for those URLs again.
Common errors when verifying
- Comparing crawls with different settings. A change in rendering or extraction can alter hashes and word counts without any real change to the site.
- Trusting the CMS preview. Only the crawled response shows what a bot receives.
- Checking only the canonical tag. Also confirm the target is a 200, indexable page, and that internal links and sitemaps point to it.
- Creating new problems. Look for redirect chains, redirect loops, and pages that became noindex by accident.
- Declaring victory too early. A crawl shows what the site serves. Search engines reprocess pages on their own schedule, so index coverage changes later. Treat the recrawl as proof of the implementation, and treat index reports as the slower proof of the effect.
A short verification loop
Exercise
After a redirect fix, your comparison shows 40 of 50 old duplicate URLs missing from the recrawl. Can you report that 40 redirects work? What should you do?
Show answer
No. A URL missing from the recrawl may only be out of crawl scope, since nothing links to it anymore. Request a sample of the 40 old URLs directly, or crawl them as a list, and confirm each returns a 301 that reaches a 200 target in one hop. Then check the other 10 URLs for remaining duplicates.