• Resolved Scott Fennell

    (@scofennellgmailcom)


    Hello, I’m investigating some performance issues and I see that Yoast tends to run some very long-running queries. Here is an example:

    SELECT DISTINCT wp_users.ID
    				FROM wp_users LEFT JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id )  LEFT JOIN wp_usermeta AS mt1 ON ( wp_users.ID = mt1.user_id )  LEFT JOIN wp_usermeta AS mt2 ON ( wp_users.ID = mt2.user_id )  LEFT JOIN wp_usermeta AS mt3 ON ( wp_users.ID = mt3.user_id AND mt3.meta_key = 'wpseo_noindex_author' )  LEFT JOIN wp_usermeta AS mt4 ON ( wp_users.ID = mt4.user_id )
    				WHERE 1=1 AND wp_users.ID IN ( SELECT DISTINCT wp_20_posts.post_author FROM wp_20_posts WHERE wp_20_posts.post_status = 'publish' AND wp_20_posts.post_type IN ( 'post' ) ) AND (
      (
        (
          wp_usermeta.meta_key = '_yoast_wpseo_profile_updated'
          AND
          (
            ( mt1.meta_key = 'wp_20_user_level' AND mt1.meta_value != '0' )
            AND
            (
              ( mt2.meta_key = 'wpseo_noindex_author' AND mt2.meta_value != 'on' )
              OR
              mt3.user_id IS NULL
            )
          )
        )
        AND
        (
          mt4.meta_key = 'wp_20_capabilities'
        )
      )
    )
    				ORDER BY wp_usermeta.meta_value+0 DESC
    
    From [www.example_domain.com/sitemap_index.xml] in [/nas/content/live/example_env/wp-content/plugins/wordpress-seo/inc/sitemaps/class-author-sitemap-provider.php:12

    What is this query doing and is there a way to opt out of it? it seems to have something to do with author sitemaps.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @scofennellgmailcom,

    Thanks for reaching out about those SQL queries. Quick question: Are you on a multisite setup?

    Yes, the query is related to author sitemaps. Is it a single author website?

    Thread Starter Scott Fennell

    (@scofennellgmailcom)

    Thanks for the response!

    Yes, this is a multisite install.

    No, this blog has 13 authors.

    Plugin Support Maybellyne

    (@maybellyne)

    Can you temporarily disable author archives in WordPress > Yoast SEO > Settings > Advanced > Author Archives? Then monitor the queries again.

    I await your feedback.

    Thread Starter Scott Fennell

    (@scofennellgmailcom)

    Hmmmm, I’m not keen on that, no. I’m picturing my customers emailing in with screenshots from their inbox: “Google Search Console: New Issues Prevent Your Site From Being Indexed” followed by a laundry list of author archive 404s.

    Thread Starter Scott Fennell

    (@scofennellgmailcom)

    So, anything else to add here?

    Plugin Support Maybellyne

    (@maybellyne)

    You could try this on a staging site. But if you are not able to, we’ll need to take a look at your setup. However, we are unable to do it here as this is a public forum. So, if you could consider purchasing a Yoast SEO Premium subscription since it comes with email support, we can investigate the issue further directly on your setup privately.

    Thread Starter Scott Fennell

    (@scofennellgmailcom)

    Is there a way to just disable author sitemaps without also disabling author archives? Perhaps via a filter?

    Plugin Support Maybellyne

    (@maybellyne)

    You may find some pointers in the Yoast SEO XML Sitemaps: API documentation

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Yoast Performs Slow SQL Queries’ is closed to new replies.