Use the code PERFMATTERS for 10% off!

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.

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
Perfmatters settings

Step 2

Click the “Extras” tab and then click “Database.”

Perfmatters Database
Perfmatters Database

Step 3

Scroll down and 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 4

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 and let you 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 the “Extras” tab and then click “Database.”

Perfmatters Database
Perfmatters Database

Step 3

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 4

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 and let you when it’s finished with a notification at the top of the Perfmatters plugin settings.

Perfmatters database optimization complete
Perfmatters database optimization complete

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