As it is explained here
'wpseo_sitemap_' . $filter . '_change_freq'
the $filter
should be replaced with post type that you want to change, you can replace it with:
homepage
,
blogpage
,
$post_type . '_archive'
,
$post_type . '_single'
,
$c->taxonomy . '_term'
,
author_archive
.
while the $post_type
variable based on WordPress Codex can be replaced with:
- Post (Post Type: ‘post’)
- Page (Post Type: ‘page’)
- Attachment (Post Type: ‘attachment’)
- Revision (Post Type: ‘revision’)
- Navigation menu (Post Type: ‘nav_menu_item’)
at the end for single post your code should look like:
add_filter( 'wpseo_sitemap_post_single_change_freq', 'my_custom_post_freq', 10, 2 );
function my_custom_post_freq( $default, $url ) {
return 'hourly';
}
After adding this to your theme functions go back to Yoast Seo plugin back-end, disable XML sitemap functionality, save it, then re-enable and reload www.yoursite.com/post-sitemap.xml