When you delete all transients, it will briefly slow down your website because WordPress itself, and various plugins, store things in transients that are expensive to obtain. For example, WordPress stores a list of plugins that need updates in a transient, and when that transient expires, it needs to request new update information from ww.wp.xz.cn and other servers. Deleting all transients will force WordPress to fetch that straight away, and at the same time some plugins will need to rebuild information they store in plugins.
But that will pass very quickly. After deleting all transients, visit a few pages in the admin and a few pages in your website, and the necessary transients will be rebuilt.
Deleting transients will only increase your website’s speed if you have a problem with the number of transients slowing down your database. That typically means at least hundreds of thousands of transients, if not millions. If that’s you, then this plugin will help by purging old, expired transients daily.
The best fix for a website that is being slowed down by the number of transients is to use a persistent object cache like memcached or redis. If you don’t know what that is, speak to your website host about it. Transients are not stored in the WordPress options table when you use a persistent object cache.
Security: it depends. Some security-focussed plugins store information in transients. Deleting expired transients won’t affect them, because they’d never get those transients back anyway (expired transients are deleted when they are next requested). Deleting “fresh” transients could mean hiding an attack from a security plugin, e.g. if a plugin stores the number of failed login attempts from one IP address in a transient, it will “forget” that number when you delete all transients. Frankly, if you’re relying on that to prevent login attacks, you’ll eventually get hacked anyway because most login brute-force attempts I see these days are from botnets rolling through multiple IP addresses.
tl;dr: if you have a ridiculous build up of transients in your database, delete the expired ones and use this plugin to keep them under control. Deleting all transients is safe, but will briefly slow down your website. Memcached or redis is the best answer for websites with lots of transients.
cheers,
Ross