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
- Open https://search.google.com/search-console
- Enter your site URL under “URL prefix” → “Continue”
- Select “HTML file” as the verification method
- 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 insrc/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.
Related Posts
- How to Deploy an Astro Site to Cloudflare Pages
- Generate sitemap.xml and robots.txt in Astro
- How to Add a New Page in Astro
- How to Read Cloudflare Pages Build Logs and Fix Errors
Recommended Services
- Fiverr - Find freelance developers and tech experts