Plugin / Transient Cleaner

David Artiss



As of version 4.9 of WordPress, transient housekeeping now takes place automatically – this plugin is therefore no longer required!

Housekeep 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 the housekeeping problems this 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.

Technical specification…

  • Licensed under GPLv2 (or later)
  • Designed for both single and multi-site installations
  • PHP7 compatible
  • Fully internationalized, ready for translations. If you would like to add a translation to this plugin then please head to our Translating WordPress page
  • Gutenberg ready

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 wasn’t totally mad, and for the cleaning code.

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 which of the various housekeeping you’d like 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 housekeeping functions…

  • housekeep_transients – this will clear down any expired transients
  • clear_all_transients – this will remove any and all transients, expired or otherwise


21 reviews

Rating breakdown

Details Information



First Released

27 Nov, 2012

Total Downloads


Wordpress Version

4.6 or higher

Tested up to:


Require PHP Version:

5.3 or higher





The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.