Viewing 1 replies (of 1 total)
  • Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    we have been able to load the XML product-sitemap successfully, however, it was a little bit slow.

    You can decrease the number of posts per sitemap (and increase the pagination) with this code (paste it to a must-use plugin or functions.php file of your child theme/theme):

    
    function sp_sitemaps_single_query($args, $cpt_key) { 
    	//Default Query 
    	//$args = array( 'posts_per_page' => 1000, 'order'=> 'DESC', 'orderby' => 'modified', 'post_type' => $cpt_key, 'post_status' => 'publish', 'meta_query' => ['relation' => 'OR', ['key' => '_seopress_robots_index','value' => '','compare' => 'NOT EXISTS'],['key'=>'_seopress_robots_index','value' => 'yes','compare' => '!=']], 'fields' => 'ids', 'lang' => '', 'has_password' => false ); 
        $args['posts_per_page'] = '500';
        return $args;
    }
    add_filter('seopress_sitemaps_single_query', 'sp_sitemaps_single_query', 10, 2);
    
    add_filter('seopress_sitemaps_max_posts_per_sitemap', 'sp_sitemaps_max_posts_per_sitemap');
    function sp_sitemaps_max_posts_per_sitemap() {
    	//default: 1000
    	return 500;
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Product Sitemap’ is closed to new replies.