Sitemaps: add Custom Post Type support

By default, Jetpack’s new Sitemaps module supports Posts and Pages. It also supports Jetpack’s Custom Content Types if you use them on your site.

If you’d like to add support for another Custom Post Type, you can use the jetpack_sitemap_post_types filter, like so:

function jeherve_add_cpt_sitemaps( $post_types ) {
	$post_types[] = 'your_post_type';
	return $post_types;
}
add_filter( 'jetpack_sitemap_post_types', 'jeherve_add_cpt_sitemaps' );
This entry was posted in Code snippets and tagged , , , . Bookmark the permalink.

Explore the benefits of Jetpack plans

Compare plans in detail to see how Jetpack can help you design, market, and secure your WordPress site.

Compare plans

Have a question about this article?

Comments are currently closed for this article, but rest assured we're still here to help! Send us a message and we'll get back to you.

Contact us