# Sitemap.xml not generated correctly

**URL:** <https://forum.ghost.org/t/sitemap-xml-not-generated-correctly/36977>\
**Category:** Developer help\
**Created:** [March 10, 2023, 9:54pm UTC](https://forum.ghost.org/t/sitemap-xml-not-generated-correctly/36977 "2023-03-10T21:54:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [March 10, 2023, 9:54pm UTC](https://forum.ghost.org/t/sitemap-xml-not-generated-correctly/36977/1 "2023-03-10T21:54:59Z")

</div>

Can anyone help me?  
I noticed that it does not generate the sitemap.xml correctly. ([https://hdsplus.co/sitemap.xml](https://hdsplus.co/sitemap.xml))

The “sitemap-posts.xml” file only shows 1 article out of 86.  
The “sitemap-tags.xml” file does not show all the tags either.

I created the Sitemap for Google News as indicated in the official tutorial ([Add your Ghost site to Google News](https://ghost.org/tutorials/create-a-google-news-sitemap/)) with the URL [https://hdsplus.co/sitemap/](https://hdsplus.co/sitemap/).

I don’t know if it has something to do with it…  
I’m using the latest version of Casper Theme & Ghost CMS.

Thanks…

EDIT 2: Now the /sitemap.xml only shows “sitemap-pagès.xml”…

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [March 10, 2023, 10:15pm UTC](https://forum.ghost.org/t/sitemap-xml-not-generated-correctly/36977/2 "2023-03-10T22:15:59Z")

</div>

You have numerous 404 errors across your site, which is likely the cause of the problem. Have you edited routes.yaml or changed the site structure in some way?

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [March 11, 2023, 12:21am UTC](https://forum.ghost.org/t/sitemap-xml-not-generated-correctly/36977/3 "2023-03-11T00:21:26Z")

</div>

Hi @mjw ,

What 404 errors do you see on my site?

My routes.yaml:

```auto
routes:
  /sitemap/:
    template: sitemap
    content_type: text/xml

/:     
    data: page.home
    template: page
    
collections:
  /:
    permalink: /{slug}/
    template: index

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

```

Thanks

---

<div class="post-metadata">

**Author:** ![Joan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joan/32/17592_2.png) [@Joan](https://forum.ghost.org/u/Joan)\
**Post date:** [March 11, 2023, 1:55am UTC](https://forum.ghost.org/t/sitemap-xml-not-generated-correctly/36977/4 "2023-03-11T01:55:06Z")

</div>

**UPDATE:** It is very strange. All my articles had been updated to “permalink” → “/p/xxxxxxxxxxxxxxxxxx”. I had to change it to “draft” and re-publish to get it to update the URL. Now the sitemap.xml works correctly too.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [March 11, 2023, 9:50am UTC](https://forum.ghost.org/t/sitemap-xml-not-generated-correctly/36977/5 "2023-03-11T09:50:12Z")

</div>

I don’t understand what changes you’ve made, but the 404 errors appear to be resolved now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [June 9, 2023, 9:50am UTC](https://forum.ghost.org/t/sitemap-xml-not-generated-correctly/36977/6 "2023-06-09T09:50:34Z")

</div>

Closed on June 9, 2023, 9:50am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
