Sub topic 14
Verifying Fixes with a Recrawl
A fix that is deployed has not necessarily worked. Redirect rules can match the wrong paths, a template change can drop a canonical tag, and a CMS update can quietly undo a noindex. A recrawl is how you check. This chapter shows how to compare a crawl taken before the fix with one taken after it, and how to keep watching the site afterwards.
It assumes you already have a baseline crawl export, a remediation plan from the previous chapter, and basic pandas skills. You should also know how redirects, canonical links and robots directives appear in a crawl.
What a recrawl proves
A recrawl shows what your server returns to a crawler now. It can confirm status codes, redirect targets, canonical elements, meta robots values, internal links and extracted body text. It cannot confirm what a search engine has decided to index. Search engines treat canonicals as hints and take days or weeks to recrawl and reprocess URLs.
So verification has two layers:
- Technical verification (immediate): the site now sends the signals you intended.
- Outcome monitoring (delayed): the search engine's index moves toward the state you wanted.
Do the first layer completely before you wait on the second. If the signals are wrong, waiting only delays the correction.
Prepare before you change anything
Verification is easiest if you set it up before deployment.
- Keep the baseline crawl. Do not overwrite it. You need the same columns in both crawls: URL, status, redirect target, canonical, meta robots, body hash, word count and inlinks.
- Write down the expected result for every URL in scope. For example: "this URL returns a 301 to that URL" or "this URL returns 200 with a canonical to that URL". An expectation written afterwards tends to match whatever happened.
- Save the URL list. You will recrawl the affected URLs, not only the site's start page.
- Use the same crawl settings. Keep the user agent, JavaScript rendering mode, robots.txt handling and crawl scope the same. If you switch from raw HTML to rendered crawling, canonicals injected by JavaScript will appear or disappear and the comparison will mislead you.
Check each fix against its expected signal
Different remediations leave different traces. The table lists what to look for in the recrawl.
| Remediation | Expected in the recrawl | Typical failure |
|---|---|---|
| Redirect | Old URL returns 301 or 308 to the exact target. The target returns 200 in one hop. | Redirect chain, redirect to a similar but wrong URL, 302 used by mistake |
| Canonical | Duplicate returns 200 with a canonical equal to the preferred URL. The preferred URL's canonical points to itself. | Canonical missing, relative URL resolved wrongly, canonical points to a redirecting or noindexed URL |
| Noindex | Page returns 200 with `noindex` in meta robots or the `X-Robots-Tag` header. | Page is also blocked in robots.txt, so crawlers never see the directive |
| Consolidate | Merged pages redirect to the combined page. The combined page contains the merged content. | Content lost during the merge, old internal links left in place |
| Improve | Word count, unique body text and internal links increase on the affected template. Body hash no longer matches siblings. | Only boilerplate grew, so the main content is still thin |
The robots.txt failure in the Noindex row is worth remembering. A crawler cannot read a noindex on a URL it is not allowed to fetch. If a page you meant to noindex shows as blocked in the recrawl, the directive is not doing its job.
Automate the comparison
With more than a handful of URLs, check expectations in code. This script joins an expectation table to the recrawl and marks each URL as pass or fail. It runs as written.
import pandas as pd
plan = pd.DataFrame({
"url": [
"https://example.com/shoes?color=red",
"https://example.com/old-shoes",
"https://example.com/tag/sale",
"https://example.com/missing-from-crawl",
],
"fix": ["canonical", "redirect", "noindex", "redirect"],
"target": [
"https://example.com/shoes",
"https://example.com/shoes",
"",
"https://example.com/shoes",
],
})
after = pd.DataFrame({
"url": [
"https://example.com/shoes?color=red",
"https://example.com/old-shoes",
"https://example.com/tag/sale",
],
"status": [200, 301, 200],
"redirect_target": ["", "https://example.com/shoes", ""],
"canonical": ["https://example.com/shoes", "", ""],
"meta_robots": ["index,follow", "", "noindex,follow"],
})
def check(row):
if row["fix"] == "redirect":
ok = row["status"] in (301, 308) and row["redirect_target"] == row["target"]
elif row["fix"] == "canonical":
ok = row["status"] == 200 and row["canonical"] == row["target"]
elif row["fix"] == "noindex":
ok = row["status"] == 200 and "noindex" in row["meta_robots"].lower()
else:
ok = False
return "pass" if ok else "fail"
merged = plan.merge(after, on="url", how="left")
merged = merged.fillna({"status": 0, "redirect_target": "", "canonical": "", "meta_robots": ""})
merged["result"] = merged.apply(check, axis=1)
print(merged[["url", "fix", "result"]])The last URL fails because the recrawl did not reach it. That is a useful result: a URL that is absent from the recrawl is not verified. Either it is no longer linked, or the crawl scope changed. Investigate before you count it as fixed.
Exact string comparison is deliberate. A redirect to https://example.com/shoes/ is not a pass when the plan says https://example.com/shoes, because it may add a second hop later. If you want to tolerate small differences, normalize both sides with the same function you used for analysis, rather than loosening the comparison by hand.
Confirm the duplicate groups actually shrank
Per-URL checks show that your signals are in place. They do not show that the duplicate problem is smaller. For that, recompute the same group counts you used at the start.
import pandas as pd
before = pd.DataFrame({
"url": ["/a", "/b", "/c", "/d"],
"status": [200, 200, 200, 200],
"body_hash": ["h1", "h1", "h2", "h3"],
})
after = pd.DataFrame({
"url": ["/a", "/b", "/c"],
"status": [200, 301, 404],
"body_hash": ["h1", "", ""],
})
def duplicate_groups(df):
ok = df[df["status"] == 200]
counts = ok.groupby("body_hash")["url"].count()
return int((counts > 1).sum())
print("duplicate groups before:", duplicate_groups(before))
print("duplicate groups after:", duplicate_groups(after))
merged = before.merge(after, on="url", how="outer",
suffixes=("_before", "_after"), indicator=True)
lost = merged[(merged["status_before"] == 200) &
(merged["status_after"].fillna(0) != 200)]
print(lost[["url", "status_before", "status_after", "_merge"]])Duplicate groups drop from 1 to 0, which is the intended result. The second table lists every URL that returned 200 before and does not now. Some of those are intended, such as /b, which now redirects. Others are not. /c returns 404 and /d has disappeared from the crawl, and neither was part of the duplicate group. Compare this list with your plan. Anything that appears here and is not in the plan is a side effect.
Remember that a canonical or noindex fix does not change the body hash. Duplicate groups made of canonicalized URLs will still exist in the crawl. Count those groups as handled only if every member points to the chosen preferred URL, and report them separately from groups removed by redirects.
Look for side effects
Fixes can break things outside the group you targeted. Check these after every batch:
- New redirect chains and loops. A new redirect whose target itself redirects creates a chain. Filter for any URL with more than one hop.
- Internal links to redirected URLs. Navigation and body links still pointing at old URLs waste crawl effort and send conflicting signals. Update them to the preferred URL.
- Sitemap entries. The XML sitemap should list only indexable, 200-status, canonical URLs. After consolidation, check that no redirected or noindexed URL remains in it.
- Orphaned pages. Removing a pagination or filter path can leave valuable pages with zero inlinks. Compare inlink counts before and after.
- Canonical conflicts. A page that is noindexed but canonicalized to another page sends mixed signals. A page whose canonical points to a redirecting URL has the same problem.
- Traffic pages hit by mistake. Cross-check any URL you removed or redirected against organic landing page data. If a page that earned traffic was in scope, confirm that the target received an equivalent page.
Monitor after the recrawl passes
When the technical checks pass, move to outcome monitoring. Work from the search engine's own reports rather than from guesses.
- Spot-check with URL inspection. For a sample of fixed URLs, compare the search engine's selected canonical with the one you declared. A mismatch means the engine disagrees with your hint, and you should look for conflicting signals such as internal links or sitemap entries.
- Watch index coverage counts. Entries such as "duplicate without user-selected canonical" and "crawled, currently not indexed" should shrink for the fixed groups. Expect a gradual change over weeks, not a step.
- Track the preferred URLs. Impressions and clicks that used to be split across duplicates should gather on the preferred URL.
- Schedule recurring crawls. New parameters, new templates and CMS changes recreate these problems. A monthly crawl of the same scope, run through the same checks, catches regressions early.
Record the result of each batch: date deployed, date verified, checks passed, and anything left open. The record shows which fixes held and which regressed.
Common errors
- Verifying only the old URLs. Also fetch the targets. A redirect to a page that returns an error passes the redirect check and still fails the user.
- Comparing crawls with different settings. Different rendering, user agent or crawl depth produces differences unrelated to your fix.
- Treating a canonical as a guarantee. A passing canonical check means the hint is correct. It does not mean the engine followed it.
- Declaring success from a sample. A fix tested on three URLs may still fail on a template edge case. Run the check over the full affected list.
- Reading a cached or CDN response. If a recrawl shows no change, check whether a cache is serving the old response before you suspect the fix.
Exercise
You deployed a noindex on 400 tag pages and recrawled. Your check script reports "pass" for 380 of them and "fail" for 20. For the failing URLs, the recrawl shows status 200 and no noindex in meta robots, but a spot check in a browser shows the tag in the page source. Name two likely causes you would test first, and say how a crawl setting could explain the difference.
Show answer
First, a rendering or user-agent difference. If the noindex is added by JavaScript, a raw HTML crawl will not see it, and a browser will. Check that the recrawl uses the same rendering mode as the baseline and as the site's intended behavior. Second, caching or per-template differences: a CDN may serve a stale copy of those 20 pages, or those pages may use a different template that lacks the tag. Fetch the failing URLs with a plain HTTP request, compare the headers and HTML, and also check for an X-Robots-Tag header. If the directive is only added by JavaScript, move it to the server-rendered HTML so crawlers do not depend on rendering.