Is there any danger in deleting all transients?

For development I would advise to always work with WP_DEBUG set to true and do the following:

$key = 'transient_key';
if( !WP_DEBUG && ( false !== ($transient = get_transient($key)) ){

   /* Generate transient manually */
   $expiration = 24*60*60;//How long to keep for
   set_transient($key,$transient, $expiration);
}

In general – it should be fine deleting transients, as they should never be assumed to be in the database.

Leave a Comment