Wordpress plugins
Delete Expired Transients

Delete Expired Transients

Version : 2.0.6
Tested up to : 4.7.6
Number of download : 32610
Author : WebAware
Average rating : 5 / 5 on 10 votes 10 votes, 5 avg.rating

Screenshots

Delete Expired Transients
Delete Expired Transients
Delete Expired Transients
Delete Expired Transients

Delete old, expired transients from the WordPress options table (wp_options), to prevent them from bloating your database and even slowing down your website. Unless you are using an object cache (like memcached), WordPress stores transient records in the options table. Many transients are given an expiration time, so in theory they should disappear after some time. In practise, because old transients are only deleted when requested again after they’ve expired, many transients stay in the database. After a while, there can be thousands or even millions of expired transients needlessly taking up space in your options table, depending on what your plugins are doing. Delete Expired Transients schedules a daily task to delete any expired transients from the options table. It performs this operation with a single SQL query, and then runs a second query to find any orphaned expiration records and deletes them too. There are a few other plugins around that clean up expired transients. This one is written for fast performance, set-and-forget scheduled housekeeping, and maximum compatibility. It uses the PHP time to determine whether transients are expired, not the database time (which can be different). It does only one job, and it does it well with the minimum of resources. Now optimised for WordPress Multisite. Translations Many thanks to the generous efforts of our translators: English (en_CA) — the English (Canadian) translation team English (en_GB) — the English (British) translation team French (fr_FR) — the French translation team Hungarian (hu_HU) — the Hungarian translation team Norwegian: BokmÃ¥l (nb_NO) — neonnero Norwegian: Nynorsk (nn_NO) — neonnero Russian (ru_RU) — the Russian translation team Spanish (es_ES) — the Spanish translation team If you’d like to help out by translating this plugin, please sign up for an account and dig in. Contributions Translate into your preferred language Fork me on GitHub Useful SQL queries Here’s a few useful SQL queries to run in MySQL when you are trying to debug what’s happening with transients. -- transients that are not autoloaded (should be all with expiration times) select option_name, option_value from wp_options where option_name regexp '^(_site)?_transient_.*' and autoload='no' order by option_name; -- transient expirations select option_name, option_value, from_unixtime(option_value) as expiry_time from wp_options where option_name regexp '^(_site)?_transient_timeout_.*' order by option_value desc; -- transient expirations with paired transients (inc. orphans) select t1.option_name, t2.option_name, t1.option_value, from_unixtime(t1.option_value) as expiry_time from wp_options t1 left join wp_options t2 on t2.option_name = replace(t1.option_name, '_timeout', '') where t1.option_name regexp '^(_site)?_transient_timeout_.*' order by t1.option_value desc; -- expired transient expirations with paired transients (inc. orphans) select t1.option_name, t2.option_name, t1.option_value, from_unixtime(t1.option_value) as expiry_time from wp_options t1 left join wp_options t2 on t2.option_name = replace(t1.option_name, '_timeout', '') where t1.option_name regexp '^(_site)?_transient_timeout_.*' and t1.option_value < unix_timestamp() order by t1.option_value desc;

Download now