How to Change Yoast Seo Sitemap Frequency & Priority

Yoast Seo is the top leading WordPress plugin in 2017. It helps you to Boost your website SEO in very short period of time. It also helps you to do Digital marketing using sharing your blog website posts to social media sites.

If you are using this plugin and access sitemap, you will notice default frequency is weekly for a single post and home page is daily.

If you are like me looking to change the single post frequency to daily or hourly then following will help you.

But According to Yoast Update they remove the Priority change option. But their is still a way to change the Yoast Sitemap Priority by adding some function in function.php file.

A “filter” to change the Frequency index time of the sitemap

The filter table is going to replace  wpseo_sitemap_ ‘. $ Filter. ‘_change_freq  , where instead of the variable  $ filter  must specify whether it is the home page, an article or something else:

  1.  homepage  It depends on the last added post in homepage
  2.  blogpage  blog pages depends on blog posts per day or frequency of default pages.
  3.  author_archive  archive of authors are set to month but its good to turn them off.

If you want to change the refresh rate of the articles on the home page, then the variable  $ filter match “homepage”, if you want to change the frequency of the items in the archive of the post type “events” then  $ filter  will equal “eventi_archive “…

The types of frequency that can be associated to each filter are listed below:

  1. always
  2. hourly
  3. daily
  4. weekly
  5. monthly
  6. yearly
  7. never

Change Yoast SEO Frequency

As usual, take a backup of functions.php file

  1. Add following to end the file
add_filter"( 'wpseo_sitemap_post_single_change_freq', 'my_custom_post_freq', 10, 2 );
function my_custom_post_freq( $default, $url ) {
   return 'daily';
}

Frequency of an archive and related articles

Suppose you have created the custom post type “Videos” and we want to change the frequency of the archive is “videos” that the relevant articles. So we’re going to use  $ post_type. '_archive'  to be replaced with  'video_archive'  and  $ post_type.'_single'  to be replaced with  'video_single'.  In this case the results will be visible in the sitemap video-sitemap.xml

The guide to change the frequency rate of the Sitemap created with WordPress SEO plugin by Yoast is over.

After that you can resubmit your sitemap.xml in Google Search Console to get the new effects.

It’s always recommended to make changes in your child themes so when you update your theme you don’t loose the custom changes.

Alternatively, if you are not a beginner or don’t know how to use  child theme then you can use Insert PHP plugin to insert the code to insert the code without having any code issue.

Much better? Never thought it would be that easy to change the sitemap frequency.


Written By:

Sarmad Gardezi A blog scientist by Mind and a Passionate Blogger by heart. Sarmad is Freelancer, Entrepreneur and Google Apps Scripts Developer from Islamabad, Pakistan.

Subscribe to Email Newsletter