Wordpress-seo: Options table uses optimisation

Created on 15 Apr 2016  路  13Comments  路  Source: Yoast/wordpress-seo

At the beginning of each request, wordpress loads all wp_options lines that have autoload set to "yes".

What is the problem:

On my websites, it load ~550 lines : ~500 are wpseo_sitemap_XXX_cache_validator like options.

Do we really need all this lines, preloaded on every request ? We could all spare some milliseconds and database usage here.

Technical info

  • WordPress version: 4.4.2
  • Yoast SEO version: 3.1.2
xml sitemap feature request

Most helpful comment

It's not fixed yet, but I am getting to it soon(ish)... I am down to like 30 unpatched sitemaps issues (hey, it was a looot more).

All 13 comments

Agreed. I think this slipped past since validator entries _are_ actually options, not transients.

I'm working with a site on the same WP and plugin versions (4.4.2, 3.1.2 respectively) that has more than 1800 cache_validator options. And I know of another site (unknown versions) with over 7700 cache_validator options.

Will an update from v3.1.2 to v3.2.4/current resolve this?

_I'm working on testing this locally, but circumstances make it a bit of an undertaking, and am hoping for a quick definitive answer :)_

It's not fixed yet, but I am getting to it soon(ish)... I am down to like 30 unpatched sitemaps issues (hey, it was a looot more).

Opened PR to kill autoload.

Though I am pretty puzzled why would this be in the hundreds. Validator is saved once _per type_.

I doubt that site got 7700 custom post _types_ or something? What does keys for it look like?

Hello @Rarst

Some more info (www.frandroid.com, 30k published posts, 15M PVs/M):

capture ecran 2016-05-06 a 16 46 18

capture ecran 2016-05-06 a 16 47 11

Thank you, now I see _few_ numeric entries in my dev install, but I don't understand what they even stand for. Will look into it.

I've asked around and the issue with creating multiple entries should have been fixed as part of ongoing work and should not happen anymore in current stable.

Please let us know if you observe the count still growing.

I updated but still see a lot of these cache validator entries. Are they safe to remove/clean up?

@archon810 yes, they are safe to remove :)

DELETE FROM wp_options WHERE option_name LIKE 'wpseo_sitemap%'

I think that the plugin ought to have code to automatically remove these, if they are no longer needed. I have apparently had over 10,000 of these slowing my site down for over a year since they became unnecessary.

overhere the same problem evertime a overload

Please move this data out of the wp_options table!

Was this page helpful?
0 / 5 - 0 ratings