WP Optimization: Removing Orphaned wp_options (especially the autoload ones)

Do you have access to a SQL client program like phpmyadmin or something similar?

If so give this query

SELECT option_id, option_name, LENGTH(option_value)
  FROM wp_options
 WHERE autoload = 'yes'
   AND option_name NOT LIKE '_transient%'
 ORDER BY 3 DESC
 LIMIT 20;

You’ll see the top twenty auto loaded options in descending order of length.

Eyeball the option names. You may recognize some that were placed there by a plugin or theme you have discontinued using.

If you see one you don’t need, look at its option_id then give this SQL statement.

DELETE FROM wp_options WHERE option_id = <<the option id>>

If you do this ten times or so you’ll get rid of the biggest and ugliest orphan options.

And, if you install a persistent object cache like memcached or Redis you’ll mitigate a lot of the performance trouble caused by orphan options.

Finally, plugin and theme authors are expected to write uninstall modules to remove their options and other data upon deletion (not deactivation). But many authors ignore this part of their task.

So, you can try deleting your inactive plugins. That may or may not delete their options too.