How to Safely Remove Transients in WordPress to Optimize and Downsize the Database

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.

wordpress-remove-transients-select-database

After opening the database, select the option “SQL” from the top navigation bar.

wordpress-remove-transients-select-sql-tab

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\_%');

wordpress-remove-transients-execute-sql-query

One you execute the query, you will receive a message something like the below one.

wordpress-remove-transients-transients-deleted

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.

Also read: how to change WordPress database table prefix

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.

wordpress-remove-transients-download-install-transient-manager-plugin

Once installed, activate the plugin, navigate to “Tools” and then select the option “Transients.”

wordpress-remove-transients-open-transient-manager-page

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.

wordpress-remove-transients-delete-all-transients

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.