Prompt to audit SEO after a site migration
This prompt asks an AI assistant to audit a migrated site against what Google documents: redirects that are permanent and short, self-referencing absolute canonical tags, a sitemap with the final URLs, no leftover noindex or robots blocks, and reciprocal hreflang pairs. It reports problems with the file and line, and fixes nothing without approval.
Last reviewed
Key facts
- Google says to use absolute URLs in rel=canonical and to include the tag on the canonical page itself.
- If two hreflang pages do not point at each other, Google ignores the tags.
- robots.txt is not a way to keep a page out of Google, and a sitemap is a hint.
- Test status: run on a real export. Titles, canonicals, lang and h1 checks worked, and it found that the export contains no robots.txt or sitemap.xml, which the prompt now reports.
The prompt
Paste this into Claude Code, Cursor, Gemini CLI or another AI coding assistant with your project folder open, and replace everything in square brackets first. See how to run it in each tool.
You are auditing a site that has just moved platforms. The build is in [BUILD_FOLDER] and the live preview is [PREVIEW_URL]. The old site is [OLD_URL].
CHECK EACH ITEM AND REPORT IT IN SEO_AUDIT.md WITH FILE AND LINE
1. Title and meta description: present, unique, not empty.
2. Canonical: every page has one rel=canonical with an absolute https URL that names the final domain, and it points at the page itself unless I said otherwise.
3. Noindex and robots: no noindex tag, no X-Robots-Tag header and no robots.txt block left over from testing.
4. Sitemap: sitemap.xml lists only final URLs that return 200, with absolute URLs, and robots.txt points at it. If either file is missing from the build, say so and write it from the page list.
5. Redirects: each URL in old-urls.txt returns 301 or 308 to its final URL in one hop.
6. hreflang: every language version lists itself and all others, with fully qualified URLs and an x-default if I use one.
7. Status codes: pages that were removed on purpose return 404 or 410, not 200.
8. Links: internal links point at final URLs, not at the old domain or at redirects.
OUTPUT
- A table with columns: check, result (pass, fail, unsure), where, how to fix.
- Group failures by severity: blocks indexing, loses traffic, cosmetic.
RULES
- Do not change files. Report only.
- If you cannot check something without live access, mark it unsure and say what I need to run.How to run it
- Prepare the lists the assistant needs: the old URLs, the build folder and a preview address.
- Send the prompt and read the failures marked blocks indexing first.
- Approve fixes one group at a time and rebuild after each group.
- Run the verify commands against the live domain after DNS changes, then submit the new sitemap in Search Console.
What each check is based on
| Check | What Google documents |
|---|---|
| Redirects | Use permanent redirects such as 301 and 308, and keep them for as long as possible, generally at least a year |
| Canonical | Use absolute URLs, include the tag on the canonical page itself, and do not use robots.txt or noindex to choose a canonical |
| Sitemap | One file holds at most 50 MB uncompressed or 50,000 URLs, and submitting it is a hint |
| hreflang | Each version must list itself and the others, and tags are ignored if pages do not point at each other |
| robots.txt | It is not a mechanism for keeping a page out of Google |
Verify the result
These commands spot-check the live domain. Run them for a few pages of each type, then ask the assistant to explain any mismatch.
curl -sI https://example.com/old-page | grep -iE "^(HTTP|location)"
curl -s https://example.com/new-page | grep -iE 'rel="canonical"|name="robots"'
curl -s https://example.com/robots.txt
curl -s https://example.com/sitemap.xml | grep -c "<loc>"- Old URLs answer 301 or 308 and land on a page that answers 200.
- Each page has exactly one canonical tag with an absolute URL on the final domain.
- No page carries a noindex tag, and robots.txt does not block the site.
- The sitemap count matches the number of pages you expect.
What can go wrong
- A staging noindex tag or robots block copied to production hides the whole site. Check this first.
- Canonical tags that still name the old platform domain. The audit searches for it.
- Treating the audit as proof of rankings. It checks setup, and rankings take weeks to settle.
Frequently asked questions
Does this replace Search Console?
No. Search Console shows what Google actually saw. The audit checks your setup before and after the move so you fix problems early.
How long until rankings settle?
Google says a small or medium site can take a few weeks for most pages to move after a site move.
Do I need special markup for AI answers?
No. Google says there are no extra requirements for AI Overviews or AI Mode, and no special schema is needed.
Which tools check these items without AI?
The Canonical Chain Auditor, Hreflang Validator, Indexability Checker and robots.txt Tester.
Official documentation
- Google Search Central: site moves with URL changes
- Google Search Central: redirects and Google Search
- Google Search Central: consolidate duplicate URLs
- Google Search Central: localized versions of your pages
- Google Search Central: build and submit a sitemap
- Google Search Central: introduction to robots.txt
- Google Search Central: AI features and your website
Free tools for this job
- Canonical Chain AuditorAudit canonical tags against redirect chains and final resolved URLs.
- Hreflang ValidatorValidate hreflang annotations, reciprocal links, and locale consistency.
- robots.txt TesterTest if a path is allowed for a specific bot using live or pasted robots.txt rules.
- XML Sitemap GeneratorGenerate a standards-compliant XML sitemap from your URL list in one click.
- Broken Link CheckerScan sitemap or URL lists and report broken links with HTTP status insights.
Start with the files
Prompts work best on a WebExport download of your site. Paste your public URL into the export form and get a ZIP. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.