WP-CLI » Delete Expired WordPress Transients 🚮

Delete Expired WordPress Transients 🚮

WordPress uses transients to temporarily store data for its plugins and themes. By managing transients you can optimize your website for speed and make sure your website is always functioning properly.

Here are a few methods how to safely delete expired WordPress transients:

To delete only expired transients use:

wp transient delete --expired
image 4 - Delete Expired WordPress Transients 🚮

To delete ALL transients use:

wp transient delete --all

If you have access to the database you can run the following command to remove all transients from the database:

DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient_%');
DELETE FROM `wp_options` WHERE `option_name` LIKE ('_site_transient_%');

NOTE: Replace wp_ with your table prefix.

image 5 - Delete Expired WordPress Transients 🚮

The Transients Manager plugin was originally developed by Pippin Williamson and provides a way to easily view, search, edit, and delete transients right from the wp-admin dashboard.

After installing the plugin navigate to Tools > Transients and remove expired transients by simply clicking the ‘Delete’ button.

See also  Dumping specific tables using mysqldump or WP-CLI
transients wp 1024x776 - Delete Expired WordPress Transients 🚮

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.