wp_sitemaps_enabled
Filters whether XML Sitemaps are enabled or not.
When XML Sitemaps are disabled via this filter, rewrite rules are still in place to ensure a 404 is returned.
Usage
add_filter( 'wp_sitemaps_enabled', 'wp_kama_sitemaps_enabled_filter' );
/**
* Function for `wp_sitemaps_enabled` filter-hook.
*
* @param bool $is_enabled Whether XML Sitemaps are enabled or not.
*
* @return bool
*/
function wp_kama_sitemaps_enabled_filter( $is_enabled ){
// filter...
return $is_enabled;
}
- $is_enabled(true|false)
- Whether XML Sitemaps are enabled or not.
Default: true for public sites
Changelog
| Since 5.5.0 | Introduced. |
Where the hook is called
wp_sitemaps_enabled
wp-includes/sitemaps/class-wp-sitemaps.php 104
return (bool) apply_filters( 'wp_sitemaps_enabled', $is_enabled );