/ โ† Migration Audit Fixes / Sitemap After Migration
In this guide
  1. What drift looks like after launch
  2. Staging protection that survives launch
  3. Rebuilding the sitemap for the new site
  4. Platform notes
  5. The fix, step by step
  6. The old domain: what to leave in place
  7. Stopping drift on the next release
  8. Questions and answers

What drift looks like after launch

"Drift" is the gap between what the two files say and what the new site actually is. It appears because both files are usually generated by the platform, copied from staging, or hand-written once and never revisited. The table lists the patterns that turn up most often after a move.

SymptomTypical causeEffect
Disallow: / on the live siterobots.txt copied from staging, or a platform "discourage search engines" setting left onCrawlers stop fetching pages; new URLs are not discovered and old ones are not recrawled.
Sitemap lists old addressesA static file carried over, or an export taken before URLs changedEvery listed URL redirects; search engines treat the sitemap as low quality and rely on it less.
Sitemap uses the staging hostBase URL set to the staging domain in the generatorSearch Console rejects the URLs as not belonging to the property.
Sitemap: line points at the old domainrobots.txt edited by hand before the moveCrawlers fetch an old file, which may be missing or out of date.
Old domain blocks everythingSomeone "closed" the old site with Disallow: /Crawlers cannot fetch old URLs, so they never see the redirects.
Sitemap includes noindex or canonicalised pagesGenerator lists every published item regardless of settingsMixed signals; the Page indexing report fills with exclusions.

The Site Migration Audit's indexing and lost-URL checks often point here first: a sudden drop in crawled pages, or large numbers of "Blocked by robots.txt" and "Page with redirect" statuses, usually trace back to one of these rows.

Staging protection that survives launch

Staging sites are rightly hidden from search engines, but the protection can use several layers, and each one has to be removed separately. Check for all of these on the live site:

curl -s https://www.example.co.uk/robots.txt
curl -sI https://www.example.co.uk/ | grep -i "x-robots-tag"
curl -sI https://www.example.co.uk/sitemap.xml | grep -i "^HTTP\|x-robots-tag\|content-type"

Remember that robots.txt and noindex do different jobs. A robots.txt block stops crawling, so a search engine may never fetch the page and therefore never sees a noindex tag on it. If you need a page out of the index, it has to be crawlable so the noindex can be read.

โš ๏ธ Google generally caches robots.txt for up to a day, so a corrected file may not take effect immediately. Do not keep editing it in the meantime; check the robots.txt report in Search Console to see which version Google last fetched.

Rebuilding the sitemap for the new site

The sitemap should be a list of the new site's canonical, indexable pages, and nothing else. The safest source is the new platform's own generator, because it updates as pages are published. A one-off export works for small static sites but drifts as soon as content changes.

What every listed URL must be

Size and structure

A single sitemap file may hold up to 50,000 URLs and 50 MB uncompressed. Larger sites use a sitemap index that lists several files. Splitting by section, such as products, categories and articles, also makes the Search Console reports more useful, because you can see which section is being indexed slowly.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.example.co.uk/sitemaps/products.xml</loc>
    <lastmod>2026-09-26</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://www.example.co.uk/sitemaps/articles.xml</loc>
    <lastmod>2026-09-27</lastmod>
  </sitemap>
</sitemapindex>

lastmod after a migration

Google uses lastmod when it is consistently accurate and ignores priority and changefreq. A common migration mistake is stamping every page with the launch date, because the import touched every record. Carry the real last content change across from the old CMS if you can. If you cannot, leave lastmod out rather than filling it with a date that is not true.

Platform notes

PlatformSitemaprobots.txt
WordPressCore serves /wp-sitemap.xml; SEO plugins such as Yoast and Rank Math replace it with their own index, usually /sitemap_index.xml. Only one should be submitted.WordPress generates a virtual file unless a real robots.txt exists in the web root, in which case the real file wins. Check which one you are editing.
ShopifyGenerated automatically at /sitemap.xml and cannot be edited directly.Edited through the robots.txt.liquid theme template; the default is sensible for most shops.
Next.js and other frameworksThe App Router supports a sitemap.ts file that builds the XML at request or build time; make sure it reads the production base URL.A robots.ts file does the same; it often switches rules on an environment variable.
Static sites and custom buildsGenerated by the build tool or a script; regenerate on every deploy.A plain file in the web root; include it in the deploy, not only on the server.

The platform-specific guides for WordPress, Shopify and Next.js cover the settings in more detail outside a migration context.

The fix, step by step

Step 1

Read robots.txt on every host involved

Fetch /robots.txt from the new live host, the old domain, any www or non-www variant and any subdomain that serves content such as a shop or blog. Read each one line by line. On the new host look for Disallow: / or rules blocking whole sections, CSS, JavaScript or image folders. Note the Sitemap: lines. Compare the file with the one the old site had, so rules that were deliberate are kept.

Step 2

Remove leftover staging blocks

Replace any blanket disallow with the rules the live site actually needs, then check the other layers of staging protection. Look for a noindex meta tag in the templates, an X-Robots-Tag header in the server or CDN configuration, password protection on the sitemap or media paths, and a build made with a staging environment flag. In WordPress, untick the discourage search engines setting under Settings, Reading. Confirm each fix with curl, not only a browser.

Step 3

Rebuild the sitemap from the new site

Generate the sitemap from the new platform itself rather than reusing the old file or an early export, so it lists only new addresses on the live host with https and the chosen www form. Split large sites into section files under a sitemap index, keeping each file within 50,000 URLs and 50 MB uncompressed. Carry real lastmod dates across from the old CMS if they exist, and leave the field out rather than stamping every page with the launch date.

Step 4

Clean the sitemap against live status codes

Crawl the sitemap in list mode with a desktop crawler, or run a short script, and record the status code, canonical and robots directives of every URL. Remove anything that redirects, returns 404 or 410, carries noindex or canonicalises elsewhere. Fix the generator setting that let each type in, such as tag archives, attachment pages or filtered collections, so the same URLs do not reappear on the next build. Repeat until every listed URL returns 200 and is self-canonical.

Step 5

Point robots.txt and Search Console at the new sitemap

Update the Sitemap: line in the new robots.txt to the full address of the new sitemap or sitemap index. Verify the new property in Google Search Console, submit the sitemap in the Sitemaps report, and remove old submissions that now fail or point at the staging host. Do the same in Bing Webmaster Tools. Check that the report shows the sitemap as fetched successfully with a discovered URL count close to what you expected.

Step 6

Leave the old host crawlable

On the old domain, make sure robots.txt does not block crawling, because search engines must be able to fetch old URLs to see their redirects. Serve robots.txt on the old host with a 200 and permissive rules, or redirect it along with everything else. Remove any sitemap there that lists pages as if they still exist. If you keep a temporary sitemap of old URLs to prompt recrawling of the redirects, label it clearly and remove it after a few weeks.

Step 7

Watch the reports until they settle

For the first few weeks, check the Sitemaps report and the Page indexing report in Search Console, filtered to the new sitemap, at least weekly. Look for growing counts of Blocked by robots.txt, Page with redirect and Excluded by noindex tag among submitted URLs. Rerun the Site Migration Audit to compare indexing against the old crawl. Add a check of robots.txt and the sitemap to every future deploy so the drift cannot return unnoticed.

The old domain: what to leave in place

When a domain changes, the instinct is to shut the old one down. For search engines, the old host still has an important job: every old URL must answer with a redirect for long enough that crawlers revisit it and transfer its signals.

๐Ÿ’ก For moves within one domain, such as a new URL structure, there is only one robots.txt and one sitemap, so the old-host section does not apply. The same rule still holds for individual old paths: do not disallow them while they redirect.

Stopping drift on the next release

Both files are small enough to check automatically. A few lines in the deployment pipeline catch most drift before it reaches search engines.

# fail the deploy if the live robots.txt blocks everything
curl -s https://www.example.co.uk/robots.txt | grep -qx "Disallow: /" && { echo "robots.txt blocks the site"; exit 1; }

# fail if the sitemap mentions the staging host
curl -s https://www.example.co.uk/sitemap.xml | grep -q "staging.example.co.uk" && { echo "staging URLs in sitemap"; exit 1; }

The Robots and Sitemap Guide explains both files in full, beyond the migration case.

Questions and answers

1. Should my sitemap list old URLs after a migration?

The main sitemap for the new site should list only new, final addresses that return 200. Listing old URLs there tells search engines you want redirecting pages indexed, which is contradictory. Some teams add a separate, temporary sitemap of old URLs to encourage crawlers to revisit them and pick up the redirects sooner. If you do, keep it apart from the main sitemap, expect redirect warnings for it in Search Console, and remove it once the old URLs have dropped out of the index.

2. Why does Search Console say my sitemap URLs are blocked by robots.txt?

The robots.txt file on the new host has a rule that matches those addresses, often a blanket disallow copied from staging or a rule written for the old URL structure that now matches new paths. Open the robots.txt report in Search Console to see which version Google fetched, and test a few affected URLs with the URL Inspection tool. Correct the rule, wait for Google to refetch the file, which usually happens within a day, then resubmit the sitemap.

3. Can I block the old domain in robots.txt once the new site is live?

No, not while its URLs redirect. Robots.txt stops search engines fetching the old addresses, so they never see the redirects and cannot move the old pages' signals to the new ones. The old URLs may even stay in results, shown without a description. Leave the old host crawlable, with every URL redirecting, for at least as long as you keep the redirects, which Google suggests should be a year or more.

4. How quickly will Google read my new sitemap?

Google usually fetches a newly submitted sitemap fairly soon, and the Sitemaps report in Search Console shows when it was last read and how many URLs were discovered. Reading the sitemap is not the same as crawling or indexing every listed page, which happens gradually and depends on the size of the site and how often it is crawled. Submitting the sitemap again repeatedly does not speed this up, so submit once and watch the reports.

5. Do I need to submit my sitemap to Bing as well?

It is worth doing. Bing Webmaster Tools accepts sitemap submissions and has its own site move tool for domain changes, and Bing results also feed other search products. Bing also reads the Sitemap line in robots.txt, so a correct line there helps any crawler that follows the standard. If the new site supports IndexNow, which Bing and several other engines use, it can notify them of changed URLs directly as well.

6. My WordPress site shows two different sitemaps. Which one should I use?

WordPress has a built-in sitemap at wp-sitemap.xml, and SEO plugins such as Yoast or Rank Math usually disable it and serve their own index, often at sitemap_index.xml. After a migration both can appear if the plugin setting was not carried over. Pick one, normally the plugin's because it respects its noindex settings, make sure the other redirects or is switched off, reference the chosen one in robots.txt and submit only that one in Search Console.

7. Should lastmod be set to the migration date for every page?

No. Google uses lastmod only when it is consistently accurate, and a date that changed on every page at once because of an import tells it nothing useful. It can also lead search engines to trust the field less in future. Carry the real date of each page's last meaningful content change across from the old system if you can. If the true dates are lost, leave lastmod out until pages are genuinely updated, then let the platform record real changes.

Check crawling and indexing after your move

The Site Migration Audit compares your pre-migration crawl with the live site, checks indexing and finds lost URLs, so sitemap and robots.txt drift shows up as pages that are blocked, redirected or missing.

Open Migration Audit Fixes โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: All Migration Audit Fixes  ·  Robots and Sitemap Guide  ·  Fixing Indexation Gaps After a Migration  ·  Fixing 404s in Your Sitemap  ·  Learning Hub

About aiwebpageseo

aiwebpageseo.com is a data-driven SEO and AEO (Answer Engine Optimisation) platform providing a free suite of technical SEO tools. Rather than relying on AI-theorised assumptions, the platform analyses live URL performance, delivering objective diagnostics, page speed metrics, CLS debugging, and site crawl data alongside actionable technical tutorials.