Use code PERFMATTERS for an extra 10% off!
  1. Home
  2. Docs
  3. General
  4. How to delete WordPress transients (expired or all)

How to delete WordPress transients (expired or all)

WordPress transients provide a simple and standardized way for developers to store cached data in the database temporarily, along with a timeframe for which it will expire and be deleted.

While transients normally expire on their own, this isn’t always the case. If things go wrong (which happens more than you might think), you can easily get hundreds of thousands of transient records in your site’s wp_options table. And this can bring your site to a crawl; we’ve seen it many times.

The good news is, in almost all cases, it’s safe to delete transients as they will rebuild themselves after the fact. Check out below how our MySQL load dropped immediately after we cleared out transients on a site where the wp_options table had spiraled out of control.

Delete expired transients
Delete expired transients

Expired transients

Follow the steps below on how to delete expired transients on your WordPress site.

Important: These functions make permanent changes that cannot be reverted! Back up your database before proceeding.

Step 1

Click into the Perfmatters plugin settings.

Perfmatters settings

Step 2

Click on the “Tools” submenu.

Perfmatters tools submenu
Perfmatters tools submenu

Step 3

Click on the “Database” submenu.

Perfmatters Database
Perfmatters Database

Step 4

Toggle on “Expired Transients.” The number of expired transients found will show up to the right of it.

WordPress Expired Transients
WordPress Expired Transients

Step 5

Scroll down and click “Optimize Now.”

Perfmatters Optimize Now
Perfmatters Optimize Now

The process will run in the background. You don’t need to stay in the plugin while it’s running or worry about leaving the window open.

Perfmatters database optimization running
Perfmatters database optimization running

It will let you know when it’s finished with a notification at the top of the Perfmatters plugin settings.

Perfmatters database optimization complete
Perfmatters database optimization complete

All transients

Follow the steps below on how to delete all transients on your WordPress site.

Important: These functions make permanent changes that cannot be reverted! Back up your database before proceeding.

Step 1

Click into the Perfmatters plugin settings.

Perfmatters settings
Perfmatters settings

Step 2

Click on the “Tools” submenu.

Perfmatters tools submenu
Perfmatters tools submenu

Step 3

Click on the “Database” submenu.

Perfmatters Database
Perfmatters Database

Step 4

Scroll down and toggle on “All Transients.” The number of all transients found will show up to the right of it.

WordPress All Transients
WordPress All Transients

Step 5

Scroll down and click “Optimize Now.”

Perfmatters Optimize Now
Perfmatters Optimize Now

The process will run in the background. You don’t need to stay in the plugin while it’s running or worry about leaving the window open.

Perfmatters database optimization running
Perfmatters database optimization running

It will let you know when it’s finished with a notification at the top of the Perfmatters plugin settings.

Perfmatters database optimization complete
Perfmatters database optimization complete

Troubleshooting

You might be wondering after you delete transients why some remain. This is completely normal as the needed transients are automatically rebuilt by plugins and themes. The purpose of deleting transients is to remove old ones that are no longer needed.

Check out our documentation on WordPress database optimization for other easy ways to clean up your database with Perfmatters. You can also delete your WordPress transients on an automated schedule.

Was this article helpful?

Related Articles