Does cloudflare pages come with sitemap or do I need to manually make one and upload it to google?
Hey I just want to know if cloudflare pages hosting handles the sitemapping for me or if I need to manually make one, and if so, where should I put it?
Thanks in advance!
22 Replies
Pages won’t build a sitemap and it should be at the root of your project.
Thanks. I added a sitemap, but the problem is that it seems to not be showing the full sitemap XML file
I have this kind of format just like it says on the google dev page https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap#xml
I understand tho that this probably falls outside the scope of cloudflare
If my website only has a single root page, then would a sitemap work?
@Elodere This is a tool I use sometimes to check sitemaps. May be worth a try. https://www.xml-sitemaps.com/validate-xml-sitemap.html
Validate XML Sitemap - XML Sitemaps Generator
Validate XML Sitemap - Free Online Google Sitemap Generator. XML-sitemaps.com provides free online sitemap generator service, creating an XML sitemap that can be submitted to Google, Bing and other search engines to help them crawl your website better. It will also generate an HTML site map to allow your website visitors to navigate easier.
Interesting, the validator says that it's valid and there are no issues...
I have two suspicions, although I'm leaning more towards it being because of google:
1. could it be that the pages.dev domain is screwing up with the sitemap because technically I'm permanently redirecting
from it to my actual website domain? maybe it doesn't recognize my actual custom domain (as in, I'm doing a bulk 301 redirect from the pages.dev ending to the .com ending)
2. could it be that google just hasn't had the time yet to find my sitemap?
this is how it looks when I check my deployment, for context
Looking at your sitemap it seems to be missing the url tags.
Google's Sitemap doc example: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap#xml
Google for Developers
Build and Submit a Sitemap | Google Search Central | Documentatio...
Google supports several sitemap formats. Follow this guide to learn about formats, how to build a sitemap, and how to submit a sitemap to Google.
It's weird because when I look at my XML file
everything looks completely fine
It has all the url tags
that's why I'm suspecting it has something to maybe do with either cloudflare or with google
eg because the default url is *.pages.dev and not my custom domain .com
(although, as I mentioned, I made a bulk 301 redirect to the .com ending)
Just to make sure, is the deployment that has the updated sitemap on the production branch?
https://github.com/rikhall1515/portfolio/blob/main/public/sitemap.xml
You can have a look at the production branch right now, actually.
The file is right there
GitHub
portfolio/public/sitemap.xml at main · rikhall1515/portfolio
My portfolio website where I will list all of my past and future work. - rikhall1515/portfolio
For context I'm using Qwik for my site, so the public directory is the root
Weird, even that deployment doesn't have it... https://a6f7ee9c.rikardhallberg.pages.dev/sitemap.xml
yeah and everything looks fine when I look at the deployment details
But this is what's tripping me up
you see how it says both pages.dev and .com?
Ideally, I don't want there to be a pages.dev, although I know that is just how it is by default
Could this be the reason this isn't working??
something to do with the .pages.dev ending
I don't think so. Running a build now...
Looks like it is something to do with your Build Process. After running
pnpm build
, the dist
folder has a Sitemap, but it is empty.Looks like it is Qwik making one: https://qwik.builder.io/docs/advanced/sitemaps/#generating-sitemaps
Qwik
Generating Sitemaps | Advanced 📚 Qwik Documentation
No hydration, auto lazy-loading, edge-optimized, and fun 🎉!
Oooooooh
Yeah I should have looked at the Qwik docs. I know that Next.js also has their own way of declaring sitemaps
Is it fine if I get back to you later if I still run into problems that might be related to cloudflare?
I'll set this thread as solved once I can verify this new approach
And of course, thank you so much for the rapid help. I really appreciate it
That's fine, happy to help!