• Resolved auhome

    (@auhome)


    Hi.
    I have a site with 800k post. Some times a day when I go to the admin console one task run in background (the site map generation I guess). The problem is that run a lot of queries to de DB and as many processes as php allows (150 in my case). Those queries only bring 100 post at a time, which means that it can run more than 8000 times.
    Is there any parameter to get more records in each query? Or which would be the way to optimize this process (memory is not a big problem)?

    The query executed :

    SELECT l.ID, post_title, post_content, post_name, post_parent, post_author, post_modified_gmt, post_date, post_date_gmt
    			FROM (
    				SELECT wp_posts.ID
    				FROM wp_posts
    		WHERE wp_posts.post_status = 'publish'
    			AND wp_posts.post_type = 'post'
    			AND wp_posts.post_password = ''
    			AND wp_posts.post_date != '0000-00-00 00:00:00'
    				ORDER BY wp_posts.post_modified ASC LIMIT 100 OFFSET 254900
    			)
    			o JOIN wp_posts l ON l.ID = o.ID
Viewing 5 replies - 1 through 5 (of 5 total)
  • While we’re unable to confirm whether your provided query run by our plugin or not, we know that you can easily change the Max entries per sitemap 100 to 1000 directly from the Yoast SEO -> XML Sitemap -> General (tab).

    Thread Starter auhome

    (@auhome)

    “Max entries per sitemap” is set to 1000 in my site. Specifically this query appear wp-content/plugins/wordpress-seo/inc/sitemapsclass-post-type-sitemap-provider.php arround line 482. The 100 limit is hard coded in class class-post-type-sitemap-provider.php line 201.

    @auhome, some of your smaller sitemaps do not have this error so it’s likely your server cannot handle the current max entries per sitemap for the larger post sitemaps. Please reduce the number to an amount your server can handle. I’d start with 500 (the default is 1000). You can try more or less if needed.

    Admin > SEO > XML Sitemaps > Max entries per sitemap

    Thread Starter auhome

    (@auhome)

    @suascat_wp, Im sure that is not the problem, the server can handle more than 1000 post at the time. The problem is that the way the plugin do the job is not efficient due to the large number of records (I mean , get 100 to 100 from database). I had to change the harcoded value to 1000 and it was a bit better, but obviously not the ideal way to do it.

    Plugin Support amboutwe

    (@amboutwe)

    Can you please submit the issue to our GitHub repository for Yoast SEO? Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Xml generation for large site’ is closed to new replies.