Delete or remove transient options to reduce and optimize the size of database. Use WP Optimize WordPress plugin to delete all transient options in your database with one click.It will not affect on your website and database.Before do this task, backup your database, if needed.
WordPress rebuild the cache after transient options deleted. Except WordPress themes, plugins and images (stored in wp content folder), all the other data will store in Database.Transient option are actually built in WordPress cache system,Which helps in speeding your site,It stores the requested data of WordPress Database for a time period so that it can be used if someone requests the same data in that time period.
How to Delete Transient Options in WordPress :
1.Install WP-Optimize Plugin.
2.Click on Activate and select Optimizer option.
3.Check remove transient options as shown in image.
4.Check Optimize database tables options too and click on process button.
5.That's it. Now your WordPress database didn't have any transient options and WordPress will rebuild fresh cache.
Recommended WP Optimize settings to reduce database Size:
Check :Clean all post revisions
Uncheck : Clean all auto draft posts and posts in trash
Check :Remove spam comments and comments in trash
Uncheck :Remove unapproved comments
Check :Remove transient options
Uncheck :Remove pingbacks
Uncheck : Remove trackbacks
To remove pingbacks and trackbacks in WordPress, add the following code to your current theme's functions.php file.
//remove pings to self
function no_self_ping( &$links ) {
$home = get_option( 'home' );
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, $home ) )
unset($links[$l]);
}
add_action( 'pre_ping', 'no_self_ping' );