I came across an interesting issue in WordPress that I haven’t seen before; a clients site was loading very slowly and was getting a white screen when trying to login to the dashboard (i.e. the person wasn’t seeing any text or fields at /wp-admin/). I’ve seen similar issues in the past when some security plugins are used in WordPress but this website wasn’t running any security plugins.
In troubleshooting I logged into the webhost Cpanel and then to phpMyAdmin to check the database tables. The wp_options table was at 348MB which is absolutely enormous and immediately starts to ‘ring alarm bells’. Inspecting the table highlighted tens of thousands of rows with a value like displayed_galleries_ and _transient_.
What causes all the displayed_galleries_ and _transient_ rows in wp_options?
I’m not certain why but for some reason the NextGen Gallery plugin added all these rows. I read somewhere that a previous version of the plugin caused these rows in the table upon upgrade. I also saw that a plugin conflict may have caused the issue. I really don’t know what the real cause was.
Can I delete the thousands of displayed_galleries_ and _transient_ rows rows?
The good news is that it’s safe to delete all the extra unwanted database table rows (please make a backup first). Deleting tens or hundreds of thousands of rows individually will take forever so here is the SQL quesry to run to quickly delete all the displayed_galleries_ and _transient_ rows in the wp_options table (enter this script into the SQL tab within phpMyAdmin).
DELETE FROM wp_options WHERE option_name LIKE '_transient_%' OR option_name LIKE 'displayed_galleries%'
If you need help in repairing your database I’m available to help at my standard rate.