WP Options table(s) bloated with _transient junk

Here's a question for the WPMU pros out there - and maybe an enlightening moment for anyone who hasn't peeked too far under the hood yet.

I am working on a cloning tool in php that will take any specified blog id and clone it to any target blog id including theme, plugins, posts, all settings, etc.

In the process I'm looking at the sql output and noticing a LOT of data bloat and garbage in the wp_*_options table (even with my relatively young wpmu installation). They're _transient_feed entries and I definitely don't want to clone them along with the useful data.

From what I gather, it's stuff that is fed into the dashboard from WP planet and whatever. Even more concerning is the idea that every single blog has copies of all this garbage (http://mu.wordpress.org/forums/topic/14504) and even after excluding from a clone programmatically it will just start to fill up again. With hundreds or even thousands of sites, this would add significantly to database size, backup time / size, performance.

So, for those that know about this, is there a way to turn this off - to prevent the options tables from getting stuffed with all that clutter? To delete any current clutter? Maybe something simple I am missing?

And if not - does anyone run any routine scripts to keep those entries cleaned out?


  • ClvrTv
    • Site Builder, Child of Zeus

    Thanks for the reply. I thought this might be one type of response - and you might be totally right. But I'm having a hard time accepting that it isn't a big deal. Here's why:

    The attached sql dump is straight from the query:

    SELECT * FROM wp_7_options WHERE option_name like '%transient_feed%' OR option_name like '%transient_rss%'

    piped to an export to generate INSERT statements...

    and saved with an html extension. It's nearly 500K... open it in a browser and all the image links and embedded html will resolve. Scroll all the way down just to humor me. There's all kinds of pictures and crap from some built-in WP dev feed that I don't care anything about - especially not across all my sites... ooops just realized the upload limits below. so nevermind on the attachment. If anyone gets curious enough you can just run that query yourself in phpMyAdmin on a wp_#_ of your choosing, export, and save as html to see what I'm talking about.

    Maybe I'm just an organizational freak, but space is space. And when your setting things up to scale massively... well, drag is drag. I'm sincerely not trying to be cantankerous, but there's got to be a better answer. I don't want any of that data cached - I've hidden the dashboard feeds, but is there anyway to keep it out of there in the first place? I really just want to understand exactly what's going on so I can control it better (but my cursory google attempts didn't turn up much of anything except that link above.

    This brings me to wonder what you all who are hosting blogs through wpmu are doing with your admin areas - to you leave all the feeds on their for your users? Particularly interested in environments where there's some level of global and consistency management (not just free-for-all blogs implementations).

    Anyway, any other takers?

  • Goddess
    • Flash Drive

    Personally, I'm changing the feeds with the plugin here to my own. I don't see any need to promote WP stuff with my own projects. My setup is very young yet, so haven't moved on to longer term implications of these choices.

    I think your cloning tool sounds especially interesting...with the stuff I'm doing, I know at some point, that level of automation would be a tremendous benefit.

    And I have only begun to look under the hood more - I was very disturbed when I saw the number of dead options left over after uninstalling a cart plugin I didn't end up using. Hundreds of fields in the blog options I had to clean up manually.

    I don't have answers but you ask some interesting questions.

  • Aaron
    • CTO

    Ditto on replacing the feeds. And it's true many poorly designed plugins and themes fill up the options table instead of using arrays as is best practice.

    Honestly though I wouldn't worry too much about it unless you are the one developing the plugin or theme causing it. The only thing it might affect is the speed of your mysql backups. It's easy to get paranoid about your options table (I've been there). I do think it is good practice to know what a theme or plugin will be doing though before installing there are many out there that can be a big performance problem.

  • Marty Thornley
    • Site Builder, Child of Zeus

    @ClvrTv - been working on a similar plugin myself. And I was just as shocked when I pulled all the options and printed it to the screen to see what was there. SO much stuff.

    This cloning an exact copy of a blog is a much needed thing. I hope you will keep everyone here posted?

  • Goddess
    • Flash Drive

    I didn't expect the additional options to mess with performance in particular, but I don't like having tons of dead options in my admin. It just makes managing options I'm using more bothersome and it's messy. The sloppiness irks me.

    This thread has been informative.. I didn't know what all the transient seeds were and wasn't aware of plugin best coding practices (since I don't code 'em.) Some things I know, of course - forcing js or css on every page even when it's not used, code that doesn't validate, etc. But now I have a new parameter to judge plugin code quality. :slight_smile:

  • Kirk Ward
    • Syntax Hero

    Okay folks, please clue me in.

    I'm just getting ready to start recruiting bloggers in my niche, and although I don't expect a lot of them for awhile, I don't want to bloat up the db as #1, I'm starting this thing on shared hosting and if I take too much space, they'll either bump me to a higher cost plan, or #2, performance will be dgraded significantly.

    So, what can I turn off to disable this incoming garbage, and where do I find it?

    Cheers and all that rot,

  • Goddess
    • Flash Drive

    @Kirk - This is small bits text information stored in a database; it will add very little to the overall size of your database and I'd be shocked if there was any measurable impact on performance. My beef with too many options is that it makes managing the blog options more tedious with lots of scrolling and I don't like leftover info from plugins I've specifically deleted. But in terms of impact on your server requirements or site performance as a whole, I'd lay money you won't see any for the transient seeds on feeds.

    Thanks for the link, Aaron! Some of those I knew, but learning some new stuff.

  • ClvrTv
    • Site Builder, Child of Zeus

    Thanks everyone! I've been crazy busy and just haven't had much time, but there are some really good nuggets here. Will check out that post link when I get a chance, Aaron - thanks!

    And I'll try to keep you all posted on my progress @Marty. I was pretty shocked there wasn't really anything out there already ready to drop in and go. There are a couple older bits floating around for purchase, but they weren't going to do exactly what I needed anyway.

  • tayloegray
    • Design Lord, Child of Thor

    I just wanted to add that I went into my DB and ran the following SQL

    select *, length(option_value) as length from wp_options where autoload = 'yes' order by length desc

    I found all kinds of junk that was autoloaded on every page. Some clients of ours have plugins that put 100,000 characters of autoload into their db

    Most of this data does not need to be autoloaded since it is only used on one page or in the admin. You can just change that value to no or delete the plugin and the data

    I even found old plugins that did not clean up after themselves and left huge options auto loads behind

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.