Perishable Press

Month

July 2009

1 post

A 500KB wp_options Table is Too Much

After my server crashed, I found myself restoring my site’s WordPress database. While there, I decided to dig around a bit and make sure everything was up to snuff. While looking through the wp_options table, I was surprised to discover that WordPress seems to cache around 400KB of “Planet WordPress” dashboard feeds (among other things). That’s a little extreme if you ask me, so I decided to clean things up and reduce my overall database size by around half a megabyte. Here’s how I did it using my archaic 2.3 version of WordPress and phpMyAdmin.

Step One: Take Some Notes

Before doing anything, copy and paste a few text snippets from your dashboard feeds. This will enable you to easily locate the oversize options fields for removal in Step Three. Note: permalinks from the various feed entries make for good search candidates.

Step Two: Kill the Feed

Place this in your theme’s functions.php file (props to Michael Shadle for the code):

function remove_dashboard_feeds() {
remove_action(‘admin_head’, ‘index_js’);
}
add_action(‘admin_head’, ‘remove_dashboard_feeds’, 1);

Step Three: Clean up Your wp_options Table

Once that is done, you may clean up your database by doing a quick search for some of the text snippets (permalinks work great) that you copied from the dashboard feeds in Step One. The field(s) that you find should be named something like “rss_123abc…”, where the “123abc…” is some long, apparently random alphanumeric string. Once you have disabled the feed via functions.php, feel free to reduce the size of your database by deleting the field(s) used to store data for the dashboard feed.

Doing this saved me an extra ~400KB of space, which is much-needed as the size of my Perishable Press database continues to grow.

Jul 9, 20098 notes
Next page →
2009 2010
  • January 1
  • February 1
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2008 2009 2010
  • January 2
  • February
  • March 1
  • April 2
  • May 3
  • June
  • July 1
  • August 2
  • September 1
  • October
  • November 1
  • December
2008 2009
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September 3
  • October 13
  • November 4
  • December 3