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
Cyb3r-Jak3
Cyb3r-Jak315mo ago
Pages won’t build a sitemap and it should be at the root of your project.
Elodere
Elodere15mo ago
Thanks. I added a sitemap, but the problem is that it seems to not be showing the full sitemap XML file
Elodere
Elodere15mo ago
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2022-06-04</lastmod>
</url>
</urlset>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2022-06-04</lastmod>
</url>
</urlset>
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?
Mackenly
Mackenly15mo ago
@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.
Elodere
Elodere15mo ago
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?
Elodere
Elodere15mo ago
this is how it looks when I check my deployment, for context
Mackenly
Mackenly15mo ago
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.
Elodere
Elodere15mo ago
It's weird because when I look at my XML file
Elodere
Elodere15mo ago
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)
Hello, I’m Allie!
Just to make sure, is the deployment that has the updated sitemap on the production branch?
Elodere
Elodere15mo ago
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
Elodere
Elodere15mo ago
For context I'm using Qwik for my site, so the public directory is the root
Hello, I’m Allie!
Weird, even that deployment doesn't have it... https://a6f7ee9c.rikardhallberg.pages.dev/sitemap.xml
Elodere
Elodere15mo ago
yeah and everything looks fine when I look at the deployment details
Elodere
Elodere15mo ago
But this is what's tripping me up
Elodere
Elodere15mo ago
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
Elodere
Elodere15mo ago
Elodere
Elodere15mo ago
Could this be the reason this isn't working?? something to do with the .pages.dev ending
Hello, I’m Allie!
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.
Hello, I’m Allie!
Qwik
Generating Sitemaps | Advanced 📚 Qwik Documentation
No hydration, auto lazy-loading, edge-optimized, and fun 🎉!
Elodere
Elodere15mo ago
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
Hello, I’m Allie!
That's fine, happy to help!
Want results from more Discord servers?
Add your server