Show Maximum URL in Default WordPress’s Sitemap

You can change sitemap’s url limit, order, and orderby filter without any type of plugins. Paste given code in functions.php and SAVE functions.php file.

Code

add_filter(
'wp_sitemaps_posts_query_args',
function ( $post_type ) {
$args = array(
'orderby' => 'modified',
'order' => 'DESC',
'post_type' => $post_type,
'posts_per_page' => 200,
'post_status' => array( 'publish' ),
'no_found_rows' => true,
'update_post_term_cache' => false,
'update_post_meta_cache' => false,
);
return $args;
}
);

This code is not an official, So please this code carefully in your website.

How To Do

  • Open active theme‘s folder.
  • Then open functions.php file and paste given code.

Hope this code is working fine. Have any help se contact me via contact us section.