# Change the Number of Links per Yoast Sitemap

> Sets how many URLs each Yoast SEO sitemap page holds. Lower it if large sitemaps time out on your server.

- Type: PHP
- Runs: Frontend only
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: yoast, sitemap, performance
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/yoast-sitemap-entries-per-page/

## Code

```php
// URLs per sitemap page.
$wpide_sitemap_per_page = 500;

add_filter( 'wpseo_sitemap_entries_per_page', function () use ( $wpide_sitemap_per_page ) {
    return absint( $wpide_sitemap_per_page );
} );
```

## Notes

Yoast's default is 1000; Google accepts up to 50,000.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Change the Number of Links per Yoast Sitemap" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
