Concentrate all cpt posts on a sigle sitemap
-
Hi!
I have a site where I have a little over 5000 entries of a specific CPT (book) and Yoast generates 11 files on the sitemap because I have set the limit programatically to a max pagination of 500.
Like this:
https://www.localhost.net/book-sitemap1.xml 2020-01-28 16:36 +00:00
https://www.localhost.net/book-sitemap2.xml 2020-01-31 12:10 +00:00
https://www.localhost.net/book-sitemap3.xml 2021-04-16 09:00 +00:00
https://www.localhost.net/book-sitemap4.xml 2021-11-16 10:44 +00:00
https://www.localhost.net/book-sitemap5.xml 2022-11-10 14:25 +00:00
https://www.localhost.net/book-sitemap6.xml 2023-03-16 18:20 +00:00
https://www.localhost.net/book-sitemap7.xml 2023-12-05 19:17 +00:00
https://www.localhost.net/book-sitemap8.xml 2023-12-20 14:22 +00:00
https://www.localhost.net/book-sitemap9.xml 2024-02-01 08:07 +00:00
https://www.localhost.net/book-sitemap10.xml 2024-11-14 13:16 +00:00
https://www.localhost.net/book-sitemap11.xml 2025-03-06 10:15 +00:00The thing is I only want a few books to show up on the sitemap, so I’ve excluded them from the sitemap by adding different combinations of:
update_post_meta($post->id, ‘_yoast_wpseo_meta-robots-noindex’, 1);
update_post_meta($post->id, ‘_yoast_wpseo_meta-robots-nofollow’, 1);
update_post_meta($post->id, ‘_yoast_wpseo_sitemap-html-include’, 0);
update_post_meta($post->id, ‘_yoast_wpseo_sitemap-include’, “never”);And the books disapear from the sitemaps, but instead of outputting just ONE book-sitemap.xml file it still generates 11 files with just a few books on each file…
Is there a way to prevent that? a way to make Yoast generate just one xml file?
Thanks in advance for your help and any ideas will be greatly appreciated.
Cheers
-Orallo
- You must be logged in to reply to this topic.