Hi! Sitemap.xml should only have URL that are not marked with no-index. At the moment, if I add “” to a certain page or post, this URL still appears in sitemap.
This is something that all other publishing platforms (including WordPress, which Ghost calls itself better) do automatically.
Why is this happening, and how we can get noindex-URL’s removed from sitemaps?
So Ghost doesn’t add a url to the sitemap if there’s a canonical URL available. (You can set the canonical URL in the right side menu - scroll down for metadata.)
Last time I tried it (it’s been maybe a month), setting a post’s canonical URL to itself caused the post to disappear from the sitemap.
Glad to have helped, Mari. It’s possible the behavior that’s fixing your problem is actually unintended. Hopefully the Ghost team will eventually address this need in a way that’s not kludgy. Meanwhile, you could start a post in the Ideas forum explaining this need (if there isn’t one already), or vote for an existing idea.
the page itself is removed from the sitemap (even if it is a collection page), when you use this hack with canonical URL
however, one entry for this page remains on the sitemap due to its entry in the routes.yaml
This means that Ghost sitemap creates per default two sitemap entries: one based on the route in the routes.yaml and one for the page itself. The entry for the page itself can easily be excluded via the canonical URL in the meta config.
Any idea how to get rid of the other entry that comes from the routes.yaml?