wp_sitemaps_max_urls
Filter HookDescription
Filters the maximum number of URLs displayed on a sitemap.Hook Information
File Location |
wp-includes/sitemaps.php
View on GitHub
|
Hook Type | Filter |
Line Number | 90 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$max_urls
|
The maximum number of URLs included in a sitemap. Default 2000. |
string
|
$object_type
|
Object type for sitemap to be filtered (e.g. 'post', 'term', 'user'). |
Usage Examples
Basic Usage
<?php
// Hook into wp_sitemaps_max_urls
add_filter('wp_sitemaps_max_urls', 'my_custom_filter', 10, 2);
function my_custom_filter($max_urls, $object_type) {
// Your custom filtering logic here
return $max_urls;
}
Source Code Context
wp-includes/sitemaps.php:90
- How this hook is used in WordPress core
<?php
85 * @since 5.5.0
86 *
87 * @param int $max_urls The maximum number of URLs included in a sitemap. Default 2000.
88 * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
89 */
90 return apply_filters( 'wp_sitemaps_max_urls', 2000, $object_type );
91 }
92
93 /**
94 * Retrieves the full URL for a sitemap.
95 *
PHP Documentation
<?php
/**
* Filters the maximum number of URLs displayed on a sitemap.
*
* @since 5.5.0
*
* @param int $max_urls The maximum number of URLs included in a sitemap. Default 2000.
* @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/sitemaps.php
Related Hooks
Related hooks will be displayed here in future updates.