mattgadient.com

Optimizing your WordPress database tables in phpMyAdmin can reduce the size!

I’ve been going through phpmyadmin doing a little database optimization throughout my sites. One big surprise was massive overhead in the “wp_comments” table for this blog.

“Overhead” usually comes into play when you’ve deleted something, whether it’s a WordPress post/comments, Joomla articles, etc. It’s space that’s basically empty in the database (since the stuff’s been deleted), but is still taking up room.

In any case, I was shocked at how much was removed the first time – quite a few megabytes. Then again, this blog’s been going on for 3 years now. To give an idea as to how much can be cleaned up, after the first clear, I emptied the spam left by Akismet, and took a screenshot:

55 spam comments deleted in WordPress

As you can see, 55 comments were deleted. This is really just a couple days worth of spam caught by Akismet. Glad I don’t have to go through them all manually!

spam-cleanup2

You’ll have to click the image for a larger version. On the right side though, you can see 814 KB of overhead. That’s almost a meg that was taken up by those 55 comments! I selected “Check All” from the bottom left, and then in the “with selected…” option list, chose “Optimize”.

Optimized wordpress table

And it’s clean. Dumping the spam really decreased the size of the table. Imagine thousands of comments over time. Yes, optimizing your databases on a regular basis is probably a smart thing to do.

Just make sure you back up first in case something goes wrong!

0 Comments

 | Leave a Comment

    Leave a Comment

    You can use an alias and fake email. However, if you choose to use a real email, "gravatars" are supported. You can check the privacy policy for more details.

    To reduce spam, I manually approve all comments, so don't panic if your comment doesn't show up immediately.