WordPress filter hook · part of WordPress core

wp_sitemaps_post_types

A WordPress core filter that 7 plugins also fire themselves, running on 80+ sites between them.

“This filter is documented in wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php”

How to use wp_sitemaps_post_types

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wp_sitemaps_post_types', function( $types ) {
	// Change $types here.
	return $types;
}, 10, 1 );

Argument names come from PageOne: AI Blog Writer, Auto Posting and SEO's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

7 plugins that fire wp_sitemaps_post_types

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. AISA icon AISA60+ installs apply_filters( 'wp_sitemaps_post_types', $ct ) includes/seo/class-aisa-sitemap-settings.php:553
  2. Site-First SEO icon Site-First SEO10+ installs apply_filters( 'wp_sitemaps_post_types', get_post_types( array( 'public' => true ), 'objects' ) ) includes/class-sfs-sitemaps.php:179
  3. PageOne: AI Blog Writer, Auto Posting and SEO icon PageOne: AI Blog Writer, Auto Posting and SEO10+ installs apply_filters( 'wp_sitemaps_post_types', $types ) includes/class-pageone-sitemaps.php:447
  4. Langferry icon LangferryFewer than 10 installs apply_filters( 'wp_sitemaps_post_types', $types ) includes/class-seo.php:261
  5. REDORZO icon REDORZOFewer than 10 installs apply_filters( 'wp_sitemaps_post_types', $types ) includes/store/class-rzml-inventory.php:1140
  6. ZEISMO SEO icon ZEISMO SEOFewer than 10 installs apply_filters( 'wp_sitemaps_post_types', get_post_types(array('public'=>true),'objects') ) includes/sitemaps-next.php:5
  7. Crawlsure icon CrawlsureFewer than 10 installs apply_filters( 'wp_sitemaps_post_types', $objects ) includes/class-crawlsure-plugin.php:204

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.