Sitemaps: Only include images attached to published and public pages
When using the image sitemap, it currently includes all of the images in the media library. Since sometimes people upload images meant for future posts or are not meant for public consumption (though not locked down), we should investigate only including images that are attached to published and public pages.
Thoughts?
p7DVsv-3I9-p2 Related: #7333
There's currently a way to do it using a filter. But I agree, we need to work on this.
This issue has been marked as stale. This happened because:
- It has been inactive in the past 6 months.
- It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
1427530-zen - Notified customer of pending patch in 10194 and general timeline if accepted.
This can result in errors when the image sitemap is attempting to direct someone to a non-public page.
Hi @kraftbj and @jeherve:
This problem came up for a WordPress.com user and an MGS search led me here. 8291431-zd-a8c (starting from 28 June 2024)
It's my understanding from this closed GH issue that Jetpack Sitemaps should no longer be showing images which are not actually part of a published post.
Their image sitemaps shows all images in their media library, as does the image sitemap on my test site.
Has this problem reappeared?
Support References
This comment is automatically generated. Please do not edit it.
- [ ] 1427530-zen
- [ ] 8291431-zen
Has this problem reappeared?
I don't believe so. The problem outlined here was a bit different: we wanted to ensure that if an image was part of a post that was not published yet, it would not be part of the sitemap.
We could, however, consider excluding images that are not attached to any post as well, images that were uploaded under Media > Library instead of through the post editor. I worry this may exclude too many images though, since there may be many unattached images that folks want to be public. Images uploaded via third-party services (like the mobile apps) can sometimes be unattached, for example.
The problem outlined here was a bit different: we wanted to ensure that if an image was part of a post that was not published yet, it would not be part of the sitemap.
OK! That is not how I interpreted the outline of the problem by @kraftbj.
We could, however, consider excluding images that are not attached to any post as well, images that were uploaded under Media > Library instead of through the post editor.
So I guess this would be a feature request, and for now I can tell the user to use a filter?
Or that they need to delete any images from their Media Library that they don't want on their image sitemap? (I'm not sure if they're not technically savvy enough to enable a filter.
I guess this would be a feature request, and for now I can tell the user to https://github.com/Automattic/jetpack/issues/7333#issuecomment-343550386?
Right, this may be the best approach for now.
I have shared both options with the user. Closing this issue again.