What I Wanted to Do

Register an Astro site hosted on Cloudflare Pages with Google Search Console.

Steps

1. Start Ownership Verification in Search Console

  1. Open https://search.google.com/search-console
  2. Enter your site URL under “URL prefix” → “Continue”
  3. Select “HTML file” as the verification method
  4. Download the verification HTML file

2. Place the File in the public Folder

your-project/public/googleXXXXXXXXXXXXXXXX.html

Place it in public/, not src/.

3. Push and Deploy

git add .
git commit -m "add google search console verification"
git push

4. Verify in Search Console

After the deployment completes, click “Verify”.

5. Submit Sitemap

Left menu: “Sitemaps” → enter sitemap-index.xml → “Submit”

Common Pitfalls

  • The HTML file must go in public/ — placing it in src/ won’t work
  • Clicking “Verify” before the deployment completes will fail
  • Don’t delete the verification file after confirming — Search Console checks it periodically

After verification, generate and submit a sitemap with Generate sitemap.xml and robots.txt in Astro.

  • Fiverr - Find freelance developers and tech experts