New Bookstore! Save 20% on books with discount code: LAUNCH
Web Dev + WordPress + Security

WordPress Plugin: Enable WP Database Tools

[ Enable WP Database Tools ] Here is a lightweight WordPress plugin that enables you to optimize and repair InnoDB and MyISAM database tables. It uses WordPress’ built-in database optimization tools to get the job done. There are lots of great database optimization plugins out there, but this one is aimed specifically at easily optimizing and repairing InnoDB tables. Although it also works on other types of tables, such as MyISAM.

Update: Grab the Plugin

I wrote this article some years ago, but never got around to submitting the code to be hosted at WordPress.org, which is beneficial for users because of auto-updates, among other things. So during my recent plugin development marathon, I included Enable Database Tools in the mix. And so now you can get the official plugin from WordPress.org. We now continue with the originally scheduled article. </update>

I want to optimize and repair InnoDB tables

Using database management tools such as phpMyAdmin, it is easy to optimize and repair MyISAM database tables. Just select your tables and click “repair”. For database tables of the InnoDB type, however, it is not possible to optimize and repair using phpMyAdmin and/or similar tools. If you try, you’ll get an error that looks like this:

“The storage engine for the table doesn’t support repair.”

Of course, maintaining a well-optimized database helps to improve site performance. So it’s kind of a pain that it’s not possible to optimize/repair InnoDB-type tables using tools like phpMyAdmin. Fortunately, WordPress provides some simple database-optimization tools that can do the job. Here is a screenshot:

Enable WP Database Tools

To enable these repair and optimization tools, you need to add a line to your site’s wp-config.php file:

define('WP_ALLOW_REPAIR', true);

..and then access the tools via your browser at the following URL:

http://example.com/wp-admin/maint/repair.php

The tool is simple and effective, but it can be a bit of a chore to edit wp-config.php whenever you want to optimize or repair your database. So I created a quick plugin to do the job, you can find the download link below.

Download

For download, documentation, support, and more, visit Enable WP Database Tools at the WordPress.org Plugin Directory.

How to use this plugin:

  1. Activate plugin
  2. Visit plugin settings page
  3. Enable DB Tools
  4. Click link to open DB Tools
  5. Use the tools as needed
  6. Disable DB Tools when you are finished

And that is it. No fuss, no muss. Very straightforward, lightweight and simple. Just upload, activate, and optimize/repair your database as needed. Really saves some time for those of us who like to run a tight ship with optimized database tables :)

Important: Remember to disable the database tools when you are finished using them! You can disable the tools via the plugin settings page.

You can learn more about using WP’s built-in tool to optimize and repair database tables over at WP-Mix.com.

Jeff Starr
About the Author
Jeff Starr = Designer. Developer. Producer. Writer. Editor. Etc.
Blackhole Pro: Trap bad bots in a virtual black hole.

2 responses to “WordPress Plugin: Enable WP Database Tools”

  1. This looks like a simple, straightforward, and useful plugin. Thanks for sharing!

    ~Mike

  2. In all my years using WordPress I never knew this feature existed. Worked a treat on my InnoDB tables. Thanks for sharing.

Comments are closed for this post. Something to add? Let me know.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
Blackhole Pro: Trap bad bots in a virtual black hole.
Thoughts
There is no way that Marvel can serve up anything better than what they've already done with Infinity saga/Endgame. Knowhere to go but down, sadly.
I built a new search launchpad to make my life easier. So I can search multiple engines quickly and easily.
Updating all muh plugins for WP 5.5 imminent release! Wut August :)
Book updates complete! DigWP, .htaccess, Tao-WP, and WP Themes books all updated and current with all the latest.
Stop giving so much juice to social media. Get a site and OWN your content.
I would give my left testicle for macOS Finder to remember column widths.
The chemical name for titin (the largest known protein) has 189,819 characters and takes several hours to pronounce.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.