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.

Have a note to contribute?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Say Hello to 200 Themes

Jetpack Professional now bundles 200+ Premium WordPress themes,
alongside business class security tools, and marketing automation.

Use code "PRO" at checkout for 50% introductory discount.