Hi, is there a way to disable authors and tags from being included in sitemap.xml?
Thanks in advance.
2 Likes
John
November 15, 2018, 10:29am
2
Hey Solomon! This is work is currently in-progress and can be tracked here:
opened 11:57AM - 07 Nov 18 UTC
closed 09:50AM - 08 Jan 19 UTC
server / core
api
_(refs #9866)_
This is a change for API v2 only.
The Content API should not … return authors or tags with no posts.
### Use Case
You have an administrator which organises the blog, but does not write posts.
### Things to take care of
- sitemaps service should not return these urls for v2
- sitemaps service should return these urls for v0.1
### Requirements/Underlying problem
GQL does not support filtering and couting e.g. `filter=count.posts:>0`. We first need to [finish NQL and replace GQL with NQL in Ghost.](#10105)
The sitemap service depends on the url service. And the url service is independent of API versions. The url service fetches data in bootstrap straight from the model layer. That means urls are being created independently from the API result/behaviour. e.g. v0.1 should show author urls with posts count 0 and v2 should not show them.
IMO we need to refactor the url service to request the configured (by the theme) API version. And if the theme changes the api version, we need to purge the url service and rebuild the cache. The challenge here is that we need to execute raw knex queries, because bookshelf is too slow e.g. **`api.v2.posts.all()`**
**This needs some more thoughts and architecture ideas.**
### Hacky solution
It's possible to hack this feature into V2 without resolving the requirements, but it's really ugly and hard to maintain. **See PR**: https://github.com/TryGhost/Ghost/pull/10123
### TODO
- [x] don't return authors with no posts
- [x] don't return tags with no posts
- [x] sitemap should also not list authors without posts
- [x] sitemap should also not list tags without posts
- [x] fix critical bug: controller have custom names (https://github.com/TryGhost/Ghost/pull/10333) @kirrg001
slak
November 20, 2018, 2:21am
4
Hi @John a quick question about sitemap. Is it possible to regenerate the sitemap? It was generated before I have installed SLL certificate and the links in sitemap are all non secure “http”.
In fact all I need is to add a /s/ to all non secure http links in sitemap, so if someone could tell me where file lives to make the changes manually I’d really appreciate it.
Thanks in advanced.
Sitemaps are generated dynamically! Be sure to update the URL and restart ghost
system
Closed
December 4, 2018, 5:19am
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.