Having an updated sitemap is crucial for helping search engines efficiently crawl your website. By default, the popular Yoast SEO plugin sets the sitemap frequency to weekly. But for some sites, especially those with very frequent content updates, a weekly refresh rate is not enough.
In this post, I‘ll explain step-by-step how to change your Yoast sitemap settings from weekly to daily or even hourly. Optimizing this can result in pages being indexed faster by Google and other search engines.
What is a Sitemap?
A sitemap is an XML file that lists all the pages on your WordPress site. It tells search engines about new or updated content they should crawl and index.
By default, Yoast SEO generates a sitemap that refreshes on a weekly basis. This means new or edited pages might not get crawled for up to 7 days.
Why Change the Frequency?
For sites with frequently changing content, a weekly refresh rate is not frequent enough. By increasing the sitemap frequency, you allow search engines to crawl new and updated pages much faster.
For example, changing to a daily sitemap ensures content is crawled in a maximum of 24 hours. An hourly one means near instant indexing every 60 minutes.
This is extremely beneficial if your site publishes multiple new posts per day or makes content edits often.
How to Edit the Yoast Sitemap Settings
Unfortunately, there is no setting in the Yoast SEO plugin itself to change sitemap frequency. But we can edit the functions.php file of our theme to override the defaults.
Here are the step-by-step directions:
- Login to your WordPress dashboard
- Go to Appearance > Editor
- On the right side, select your theme‘s functions.php file
- Scroll to the very bottom and paste this code:
add_filter( ‘wpseo_sitemap_post_single_change_freq‘, ‘my_custom_post_freq‘, 10, 2 ); function my_custom_post_freq( $default, $url ) { return ‘daily‘; }
- To change to hourly instead of daily, edit ‘daily‘ to ‘hourly‘
- Save functions.php and refresh your sitemap
You will now see your sitemap frequency has changed site-wide to daily or hourly based on what you entered.
Benefits of Changing Frequency
Here are some of the key benefits you‘ll see after increasing sitemap frequency:
- New and updated pages get crawled and indexed faster, often within 24 hours or less
- Timelier tracking of any trending or viral content on your site
- Improved site crawler budget allocation from search engines
- Quicker confirmation in Google Search Console data of new content being indexed
I recommend tweaking between daily and hourly frequencies to test which works best for your site‘s publishing cadence.
Other Ways to Change Frequency
If editing the theme‘s functions.php file makes you nervous, there are a couple alternative options to change the sitemap settings:
- Switch to using a WordPress child theme first, then add the code snippet there instead for safer edits that won‘t impact the parent theme.
- You can also use a plugin like Insert PHP Code Snippet and enter the code there instead of functions.php.
Either option still allows changing the sitemap frequency but without direct edits to sensitive theme files.
Additional WordPress SEO Tips
Along with an optimized sitemap, here are some other essential search optimization tips:
- Enable XML sitemaps in Yoast
- Set up a robots.txt file
- Write strategic keyword-focused content
- Include structured data markup on pages
- Claim your site with Google Search Console
Combined with the faster indexing from daily/hourly sitemaps, these best practices will help improve your overall search visibility.
Let me know if you have any other questions on implementation!