Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/features/xml-sitemaps/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,28 @@ function filter_wpseo_sitemap_urlimages_front_page( $images ) {
add_filter( 'wpseo_sitemap_urlimages_front_page', 'filter_wpseo_sitemap_urlimages_front_page' );
```

## Performance

### Disable cache priming for sitemap generation

By default, Yoast SEO primes the post, term, and featured-image caches in bulk before generating each sitemap batch. This avoids one database query per post on setups without a persistent object cache, but can occasionally interfere with custom caching layers. Use this filter to opt out of the bulk priming when needed.

```php
<?php
/**
* Disables bulk cache priming during XML sitemap generation.
*
* @param bool $disable Whether to disable cache priming. Defaults to false.
*
* @return bool
*/
function disable_sitemap_cache_priming( $disable ) {
return true;
}

add_filter( 'wpseo_disable_xml_sitemap_cache_priming', 'disable_sitemap_cache_priming' );
```

## Miscellaneous

### Alter the URL of an entry
Expand Down