Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 798 forks source link

Sitemaps: CPT sitemaps cause duplicate sitemap files #8308

Open jeherve opened 6 years ago

jeherve commented 6 years ago

Steps to reproduce

  1. Add a plugin that adds a CPT to your site.
  2. Add many posts to that Post Type.
  3. Whitelist that post type:
    /**
    * Add Trakt events to sitemaps.
    */
    function jeherve_add_trakt_sitemaps( $post_types ) {
        $post_types[] = 'traktivity_event';
        return $post_types;
    }
    add_filter( 'jetpack_sitemap_post_types', 'jeherve_add_trakt_sitemaps' );
  4. Flush existing sitemaps and deactivate / reactivate the module to rebuild the sitemap.
  5. When the sitemap gets rebuilt, you will see some of the sitemaps are duplicated. See some examples here: https://jeremy.hu/sitemap-index-1.xml https://jeremy.hu/image-sitemap-index-1.xml
stale[bot] commented 6 years ago

This issue has been marked as stale. This happened because:

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.