Every WordPress site will have some amount of transients in their database. In case you don’t know, transients are nothing but the cached information of certain database information that is stored on your server. WordPress even offers a standardized way to store this transient data.
In fact, WordPress theme and plugin developers make use of these transients to store timely data in order to increase the speed and efficiency. For instance, a plugin or theme may want to check for updates every 24 hours. Once checked, this data is stored as a transient so that the plugin or theme doesn’t make another request everytime the page loads.
The good thing is that this transient data will automatically expire at set periods of time. However, sometimes these transients may quickly pile up and you may not see some changes you made right away. Moreover, the piled up transients may also increase the database size.
So, if you ever need, here is how to safely remove transients in WordPress to optimize and downsize the database. Before doing anything, make sure that you have a good WordPress database backup.
Remove Transients in WordPress Manually
Note: I’m assuming that you have access to phpMyAdmin. Even if you are using some other SQL manager, the SQL queries are the same.
Removing transients in WordPress is really easy. To start off, open your cPanel and then open the phpMyAdmin application. Once in the phpMyAdmin screen, select your database.
After opening the database, select the option “SQL” from the top navigation bar.
In the SQL query window, enter the below query in the field and then click on the button “Go.”
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%');
One you execute the query, you will receive a message something like the below one.
Additionally, also execute the below query.
DELETE FROM `wp_options` WHERE `option_name` LIKE ('_site_transient_%');
That’s all there is to do. You’ve removed transients in WordPress without using any plugin whatsoever.
Remove Transients Using Transients Manager
If you don’t like the manual method or if you just don’t want to mess with the SQL queries then you can use a simple plugin.
So, start off by installing the Transients Manager plugin for WordPress.
Once installed, activate the plugin, navigate to “Tools” and then select the option “Transients.”
The above action will open the Transients Manager page. Here, you can see all the transients and how long will they stay in your database. Typically, you can delete each and every transient manually by clicking on the “Delete” link next to the transient.
If you want to delete all the transients, simply click on the button “Delete All Transients” and you are good to go.
That’s all there is to do and it is that simple to remove or delete transients in WordPress. However, one thing to keep in mind is that even if you delete all the transients, some plugins and theme will automatically create them in an instant.
Also read: how to change WordPress database name
This happens because most of them depend on the transients for good reasons. Moreover, you don’t have to worry about breaking your site by deleting transients in WordPress.
If like this article then also read how to optimize WordPress site for better speed and usability.
Hope that helps. Do comment below sharing your thoughts and experiences about using the above method to delete or remove transients in WordPress.