PluginCams v4.9.5
Back to blog
TUTORIAL July 7, 2026

Speed Up a Large WordPress Database with Index WP MySQL For Speed

By Andre · PluginCams Developer

If your WordPress database is getting large, caching alone may not solve every slow query. Sites with thousands of posts, large wp_postmeta tables, many users, custom fields, WooCommerce data or continuous import jobs can make MySQL work much harder than it should.

One free plugin I recommend testing on large WordPress sites is Index WP MySQL For Speed. It does not delete data and it is not a database cleaner. It adds and updates database indexes (also called keys) so MySQL or MariaDB can find the rows WordPress asks for more efficiently.

Why It Works Well on Large WordPress Databases

WordPress stores content across relational database tables. Posts and pages live in wp_posts, custom fields and a lot of plugin data can accumulate in wp_postmeta, settings are stored in wp_options, and users and their metadata use wp_users and wp_usermeta.

On a small site, scanning or filtering a few hundred rows is usually cheap. On a large site, the same type of query may have to work through hundreds of thousands or millions of rows. A useful database index gives MySQL a faster path to matching rows instead of repeatedly searching large parts of a table.

This is why the plugin is especially interesting for heavy databases: it improves the way the database finds existing data without requiring changes to WordPress, your theme or your plugin code.

Important: this is not a magic speed button.

The biggest differences are normally seen on larger sites where database queries are already doing significant work. A small WordPress install with a few posts may show little or no visible difference.

What Tables Can It Optimize?

The plugin can add or update high-performance keys on core WordPress tables and selected WooCommerce-related metadata tables, including:

  • wp_comments and wp_commentmeta
  • wp_posts and wp_postmeta
  • wp_termmeta
  • wp_users and wp_usermeta
  • wp_options
  • Selected WooCommerce and AutomateWoo metadata tables

Your WordPress installation does not need to use the default wp_ prefix. The plugin supports non-standard table prefixes.

Before You Start: Make a Database Backup

Always make a fresh database backup before changing database indexes. Adding or changing keys is normal database maintenance, but you should never perform database work on a production site without a current backup.

On very large tables, also check free disk space on the database server. MySQL or MariaDB may need temporary space while adding indexes. If a huge table fails during the process, lack of temporary disk space can be one possible cause.

Step 1 - Install Index WP MySQL For Speed

  1. Login to your WordPress dashboard.
  2. Go to Plugins → Add New Plugin.
  3. Search for Index WP MySQL For Speed.
  4. Install the plugin by OllieJones.
  5. Activate it.

Activating the plugin alone does not add the high-performance keys. You still need to run the indexing operation.

Step 2 - Open the Index MySQL Tool

In your WordPress dashboard, go to:

Tools → Index MySQL

The tool shows the current key status of supported tables. From here you can choose the tables and use the button to add the high-performance keys.

For a normal or medium-size database, the dashboard method is the easiest option.

Step 3 - Add the High-Performance Keys

From Tools → Index MySQL, review the supported tables and click Add Keys Now.

The plugin only needs to apply these keys once. After the indexes are created, MySQL or MariaDB automatically maintains them when rows are inserted, updated or deleted.

Large Database? Use WP-CLI Instead

For sites with very large tables, I recommend WP-CLI. Running the operation from the browser can hit PHP, proxy or web-server timeouts. The plugin itself recommends command-line operation for large tables because WP-CLI avoids the normal web request timeout problem.

Connect to your server with SSH and move to the WordPress root directory:

cd /path/to/your/wordpress

First check the current status:

wp index-mysql status

To add the high-performance keys to all supported tables that do not already have them:

wp index-mysql enable --all

When it finishes, check the status again:

wp index-mysql status

Optimize One Table at a Time

On a particularly heavy site, you may prefer to work table by table. For example, to apply the high-performance keys only to wp_postmeta:

wp index-mysql enable wp_postmeta

This can be useful when one large metadata table is the main bottleneck or when you want to observe server resources while each table is processed.

If your installation uses a different WordPress table prefix, use the real table name shown by the plugin and your database.

Optional: Preview the SQL Before Running It

The plugin includes a dry-run mode that prints the SQL statements without executing them:

wp index-mysql enable --all --dryrun

For experienced server administrators, the generated SQL can also be piped directly to the WordPress database command:

wp index-mysql enable --all --dryrun | wp db query

Do not save dry-run SQL for execution much later. The generated statements are based on the current state of your tables.

How to Revert to the Default WordPress Keys

If you want to restore WordPress's standard keys, you can revert from the Index MySQL tool or use WP-CLI:

wp index-mysql disable --all

Important: simply deactivating or deleting the plugin does not remove the high-performance keys. Revert them first if your goal is to return to the default WordPress indexes.

Do the Tables Get Bigger?

They can. Database indexes use disk space because MySQL stores additional structures that make data faster to locate. On an old or very large table, the table size may increase after adding keys.

This is a normal time versus space tradeoff: you use some additional storage so the database can perform many lookups more efficiently.

Indexing Is Not the Same as Redis or Database Cleaning

These tools solve different problems:

  • Index WP MySQL For Speed: improves how MySQL or MariaDB finds rows in supported tables.
  • Redis / persistent object cache: can reduce repeated database work by serving cached WordPress objects.
  • Database cleanup: removes data you no longer need and can reduce table size.

On a large WordPress site, these approaches can complement each other. Better indexes do not replace Redis, and Redis does not fix every inefficient table lookup.

Use the Database Monitor to Find Slow Operations

The plugin also includes a Monitor Database Operations tab. You can monitor the public site, the dashboard or both, and then review captured database operations sorted by execution time.

A useful approach is to monitor for a short period while the site is receiving real traffic or while you reproduce the slow admin action. This helps identify which database operations are taking the most time instead of guessing.

My Recommended Setup for Heavy WordPress Sites

For a large WordPress database, my normal workflow is:

  1. Create a fresh database backup.
  2. Check free disk space on the database server.
  3. Install and activate Index WP MySQL For Speed.
  4. Use wp index-mysql status.
  5. Run wp index-mysql enable --all from WP-CLI.
  6. Check the status again.
  7. Test the frontend, WordPress dashboard and heavy import processes.
  8. Use the database monitor if a specific action is still slow.

Final Thoughts

Index WP MySQL For Speed is one of the first plugins I test when a WordPress site has a genuinely large database. It is especially relevant for sites with large post and metadata tables, many users, WooCommerce data or import-heavy workflows.

The reason is simple: as tables grow, database indexes matter more. Giving MySQL or MariaDB better keys can reduce unnecessary work on supported WordPress queries without rewriting your site.

For small sites, the improvement may be difficult to notice. For heavy WordPress installations, it is a practical optimization worth testing—especially with WP-CLI so large tables can be processed without browser timeouts.