wp_sitemaps_enabled WordPress Filter Hook

The wp_sitemaps_enabled hook allows you to enable or disable sitemaps for your site. This can be useful if you want to disable sitemaps for a specific post type or taxonomy.

apply_filters( 'wp_sitemaps_enabled', bool $is_enabled ) #

Filters whether XML Sitemaps are enabled or not.


Description

When XML Sitemaps are disabled via this filter, rewrite rules are still in place to ensure a 404 is returned.

Top ↑

See also


Top ↑

Parameters

$is_enabled

(bool)Whether XML Sitemaps are enabled or not. Defaults to true for public sites.


Top ↑

Source

File: wp-includes/sitemaps/class-wp-sitemaps.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.