wp_sitemaps_max_urls
Filters the maximum number of URLs displayed on a sitemap.
Usage
add_filter( 'wp_sitemaps_max_urls', 'wp_kama_sitemaps_max_urls_filter', 10, 2 ); /** * Function for `wp_sitemaps_max_urls` filter-hook. * * @param int $max_urls The maximum number of URLs included in a sitemap. * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user'). * * @return int */ function wp_kama_sitemaps_max_urls_filter( $max_urls, $object_type ){ // filter... return $max_urls; }
- $max_urls(int)
- The maximum number of URLs included in a sitemap.
Default: 2000 - $object_type(string)
- Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
Changelog
Since 5.5.0 | Introduced. |
Where the hook is called
wp_sitemaps_max_urls
wp-includes/sitemaps.php 90
return apply_filters( 'wp_sitemaps_max_urls', 2000, $object_type );