Deleting wp_ewwwio_image_optimize_batch records from wp_options table

Share this:

If you stumbled upon this post, you too must have been checking out your WordPress database and wondering why your wp_options tables is so huge! I did exactly that recently for another WordPress-based site that I help to manage and discovered that the site had a total of 21548990 bytes (that is 21MB!!!) of data that being loaded on every page load. Something was amiss for sure. For me, it turned out to be thousands of wp_ewwwio_image_optimize_batch records in the wp_options table.

Wordpress wp_options table

WordPress wp_options table

I started to look into this when we discovered that our MySQL server was serving pretty large outbound transfers. It was averaging around 80-100MB/s. It was obviously not normal. This hadn’t been a problem before as we co-located the WordPress web server and its database on the same VM. But we recently decided to host them separately so that we can scale out the web and database tier independently. After monitoring the database stats a little, I started to suspect something must be amiss with the wp_options table. A quick few Google searches later, I stumbled onto this post here which explains pretty well what’s going on.

The SQL statement below is what I used to calculate the total data size as per advised here.

SELECT SUM(LENGTH(option_value)) as autoload_size FROM wp_options WHERE autoload='yes';

This was where I started to notice that there were thousands of rows of records with the option_name starting with wp_ewwwio_image_optimize_batch. Furthermore, we had already disabled the EWWW Image Optimizer on the site!

So I decided the delete all those records from the wp_options table.

DELETE FROM wp_options WHERE option_name LIKE '%ewwwio_image_optimize_batch%'

The result was significant. After the deletion, it came down to just 400kb after that!

It’s impact to the server bandwidth stats was significant as well. As you can see, the graph drops from between 80+Mbps down to 4-5Mbps after I deleted all the bulk left over by the EWWW Image Optimizer plugin.

server bandwidth graph

After deleting the unnecessary records from the wp_options table, the site continues to load as per normal. In fact, it seems a little faster too! So I guess you don’t really have to worry about deleting them. But still, I would encourage you to at least make a backup before deleting anything from your database. It is simply just the sane thing to do.

Also, if it turns out that what’s clogging your wp_options table is not the same as what I found, just do a SELECT * and browse the records. See what’s really clogging it and you will eventually figure it out. Hope this helps!

Share this:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.