While WordPress is running, it stores temporary information in the database known as transients. These records are used by WordPress core, themes, and plugins to temporarily cache data and improve performance.
Over time, expired or unused transients can accumulate in the database, increasing its size unnecessarily and potentially affecting performance.
This guide explains how to identify transient records stored in your WordPress database.
Important
This guide is intended for users who are comfortable working with databases. Before executing any SQL commands, create a database backup. If a command is entered incorrectly, you may need to restore your database from the backup.
After making changes, always verify that your website is functioning correctly.
Table of Contents
Access phpMyAdmin
- Log in to the mybox Panel.
- Navigate to:
Databases
- Click:
phpMyAdmin
A new browser tab will open with the database login screen.
Log In to the Database
Use the database credentials associated with your WordPress website:
- Database name
- Database username
- Database password
If you do not know these details, you can find them in the wp-config.php file located in the root directory of your WordPress installation.
Example entries:
define('DB_NAME', 'database_name');
define('DB_USER', 'database_user');
define('DB_PASSWORD', 'database_password');
define('DB_HOST', 'database_host');
The wp-config.php file is usually located in:
public_html
Open the SQL Tab
After logging in:
- Select your WordPress database from the left-hand menu.
- Click the:
SQL
tab at the top of the page.
This will open the SQL query editor.
Find Autoloaded Transients
To display transient entries currently stored in the database, execute the following query:
SELECT *
FROM `wp_options`
WHERE `autoload` = 'yes'
AND `option_name` LIKE '%transient%'
Click:
Execute
to run the query.
Understanding the Results
The query will display records from the wp_options table where:
- The option is loaded automatically by WordPress.
- The option name contains the word
transient.
These entries are temporary cached values created by:
- WordPress core
- Plugins
- Themes
- E-commerce extensions
- Session management systems
A large number of transients may indicate:
- Expired cache entries.
- Plugins that do not clean up temporary data correctly.
- Excessive database growth.
Why Remove Expired Transients?
Cleaning expired transients can provide several benefits:
- Reduced database size.
- Faster database queries.
- Improved WordPress performance.
- Reduced overhead during backups.
- Better overall website responsiveness.
Alternative Method
If you are not comfortable working directly with SQL queries, you can use WordPress optimization plugins that include transient cleanup functionality, such as:
- WP-Optimize
- Advanced Database Cleaner
- LiteSpeed Cache
- WP Rocket
These tools can automatically remove expired transient records without requiring manual SQL commands.
Summary
Transients are temporary records stored by WordPress and plugins to improve performance. Over time, these entries can accumulate and increase database size.
To identify transient records manually:
- Log in to phpMyAdmin.
- Select your WordPress database.
- Open the SQL tab.
- Run:
SELECT *
FROM `wp_options`
WHERE `autoload` = 'yes'
AND `option_name` LIKE '%transient%'
Before making any database modifications, always create a backup and verify that your website continues to function correctly after the cleanup.