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:
Delete Expired WordPress Transients using WPCLI
To delete only expired transients use:
wp transient delete --expired
To delete ALL transients use:
wp transient delete --all
Delete Expired WordPress Transients using SQL
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.
Delete Expired WordPress Transients using a plugin
After installing the plugin navigate to Tools > Transients and remove expired transients by simply clicking the ‘Delete’ button.