A very useful tutorial if you have a website on WordPress whose SQL table wp_options It is very large. Clean huge wp_options in SQL.
content
WordPress is a pretty light CMS for web servers. Requirements minimal hardware resources and one web server with support HTTPS to have installed: PHP, MySQL, NGINX or Apache.
Wordpress problems can occur when using various modules (plugins) that have security races or are not optimized affect the database. Most of the time the table wp_options he is the one who suffers.
Such a scenario is the one in which various modules do not delete Cache inputs or transients expired FROM MySQL. The WP_OPTIONS table reaches a very large volume in time, which causes a resource consumption CPU, Unjustified sea. Under these conditions, the loading time of a WordPress website increases a lot or can reach major functionality issues.
Over time I have identified two modules that due to the lack or incorrect operation of the CRON service, the expired SQL inputs (cache and transients) remain and populate in large numbers the database.
740 MB For the WP_options table it is very large and unjustified at the same time. In a table in which the core settings of WordPress and installed modules are normally saved.
How to clean huge wp_options in SQL
How we delete from mysql wp_options LINES wpseo_sitemap_cache_validator?
In the older versions of Yoast SEO there was a bug that made the old cache for sitemap stay in the database, in the WP_OPTIONS table, even if they were no longer current and would normally have to disappear. To be erased.
I discovered in MySQL an important number of lines wpseo_sitemap_cache_validator who were occupying an unoutil.

The deletion of these lines from the database does not represent any risk, but it is recommended that before any order executed in SQL you will make a backup.
To delete the WPSEO_SITEMAP_CACHE_VALIDATOR lines in WP_OPTIONS, it is sufficient to select the database and execute SQL command:
DELETE FROM wp_options WHERE option_name LIKE ('%\wpseo_sitemap\_%')
How we delete transients (WooCommerce Transients) Expira from SQL – wp_options
Transients (WordPress Transients) are used by plugins and themes to temporarily store information in the database. This optimizes the speed of loading of the site and makes it possible to function the correct elements.
Normally, the transients expired should automatically arouse from the database, but this does not always happen. Modules like Facebook and Woocommerce create many transients, and they are not automatically deleted, they will significantly populate the database. Scenario in which we have to intervene and handle them manually.
We go to the database, to SQL and execute the command line:
DELETE FROM wp_options WHERE option_name LIKE ('%\_transient\_%')
If a large number of transients have been deleted, we will immediately observe a higher speed of loading of web pages and a lower CPU consumption for the processes placed by SQL.
