
Clean expired transients from your options table. The original and best!
“Transients are a simple and standardized way of storing cached data in the WordPress database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted.”
Unfortunately, expired transients only get deleted when you attempt to access them. If you don’t access the transient then, even though it’s expired, WordPress will not remove it. This is a known “issue” but due to reasons, which are explained in the FAQ, this has not been adequately resolved.
Why is this a problem? Transients are often used by plugins to “cache” data (my own plugins included). Because of this it means that expired data can be left and build up, resulting in a bloated database table.
Meantime, this plugin is the hero that you’ve been waiting for. Simply activate the plugin, sit back and enjoy a much cleaner, smaller options table. It also adds the additional recommendation that after a database upgrade all transients will be cleared down.
I’d like to thank WordPress Developer Andrew Nacin for his early discussion on this. Also, I’d like to acknowledge the useful article at Everybody Staze for ensuring the proposed solution made sense, and W-Shadow.com for the cleaning code.
Iconography is courtesy of the very talented Janki Rathod โฅ๏ธ
๐ Please visit the Github page for the latest code development, planned enhancements and known issues ๐
The Settings Screen
Within Administration
-> Tools
-> Transients
an options screen exists allowing you to tweak when you’d like cleaning to happen, including the ability to perform an ad-hoc run, and when you’d like the to be automatically scheduled.
You can even request an optimization of the options table to give your system a real “pep”!
Running in Lite mode
A “lite” mode is available. By activating this the options screen will no longer appear and default settings will be used. The advantage? Improved performance to Admin and, especially if you’re running multi-site, no chance of anybody “tinkering” with the settings.
To activate, use the following…
define( 'TC_LITE', true );
This should be added to your wp-config.php
file.
Using hooks
If you’re the type of odd person who likes to code for WordPress (really?) then I’ve added a couple of hooks so you can call our rather neat cleaning functions…
housekeep_transients
– this will clear down any expired transientsclear_all_transients
– this will remove any and all transients, expired or otherwise
Still works!
By Organized Themes (organizedthemes) on September 19, 2023
Had to clean the transients, rather than wait for WordPress to do it, in our multisite (site by site) and it worked great. Thank you for this plugin :).
Really useful
By Hugues (hugaud) on January 21, 2018
It worked for me!
By pmfeo on January 11, 2018
Solid plugin for cleaning expired transients
By Luke Cavanagh (lukefiretoss) on November 20, 2017
It works!
By mekmediadev on October 6, 2017
Works great
By Iamhere on April 18, 2017
AMAZING
By Kenelli on April 5, 2017
PERFECT
By Pasquale Galasso on April 3, 2017
Clean Now - awesome
By jrfoell on February 12, 2017
saved my sorry but!!!!!
By balticsamurai on January 29, 2017