WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Delete Expired Transients

delete old, expired transients from WordPress wp_options table

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;

Requires: 3.2.1 or higher
Compatible up to: 3.8.3
Last Updated: 2013-10-19
Downloads: 2,742

Ratings

5 stars
5 out of 5 stars

Support

0 of 1 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2
100,1,1 100,1,1
100,1,1