However if your WordPress database options table (wp_options) accumulates old, expired transients that didn't get automatically cleared, they could end up bloating your database and even slowing down your website.
WooCommerce has a tool that allows you to the Products' Transient Cache and all the expired transients from WordPress. You can access it under WooCommerce > System Status > Tools
However if you need to delete the expired WooCommerce Transients (or any other Transients for that matter) in an automated manner, you have to implement some kind of Cron Job. Cron is a time-based job scheduler that allows you to run repetitive tasks unattended.
A "real" Cron Job always runs on the (Linux) server side, and generally speaking if you have access to the server tools needed to set it up, is always a much preferred solution. A WordPress Cron on the other hand is rather a pseudo-cron system, that is limited by several conditions. If you would like to dive into the technicalities here is an article that explains the differences in detail:
http://www.smashingmagazine.com/2013/10/16/schedule-events-using-wordpress-cron/
Since in most cases you will not have access to those server tools, you can place the following snippet into your functions.php file and then visit your site to force it to run:
global $wpdb; $sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_%"'; $wpdb->query($sql);
I was about to modify such script to purge expired transients on a daily basis for a WooCommerce installation, but it turns out someone has already come out with a solution, the 'Delete Expired Transients' plugin. I checked its code and it seems to be well-written and optimized for performance, using few resources. You can get it here:
https://wordpress.org/plugins/delete-expired-transients/
After you install and activate the plugin, the first thing it does is to schedule a housekeeping task to delete expired transients. This means that there may not be any transients found when you visit its settings page under the tools menu right after installing the plugin, because they may have already been deleted.
I am very glad that I find your regular post here. Which seems to be very important and it made good time pass for me. I don’t actually comment and don’t like to spend time in typing the comment. But here I have to do this because this deserves a good like. Good wishes, from GrafWeb.
ReplyDeleteThanks for your valuable information.
ReplyDeleteaspdotnetstorefront ecommerce website design and development in saudi
Thank you for sharing…. It's a worth reading article.
ReplyDeleteUI Design Company Bangalore | UX Design Bangalore | Bangalore Web Design | UI Design Companies in Bangalore
Does the idea of creating and managing a website for business scare you? If yes, then WordPress Development Services is the ideal solution for you. Hire WordPress developers and they will create unique business website and blogs which are easy to manage.
ReplyDeleteNice information about wordpress development.
ReplyDeleteWordpress Development Company in Pune
To fulfill your online store design & functionality requirements Hire WordPress WooCommerce Developer who are expert in programming and helps you in reach out your business goals. You can Hire WooCommerce Developer from our company from our company in affordable price. we are renowned for best quality solutions within goven deadline so hire dedicated WooCommerce Experts India make your online marketplace a unique one that attracts everyone and grows your online sales. our company has Expert WooCommerce Programmers in India that have potential to take challanges relevant to their skills.
ReplyDeleteHi,
ReplyDeleteThanks for sharing a very interesting article about Automatically delete expired WooCommerce Transients in WordPress. This is very useful information for online blog review readers.Keep it up such a nice posting like this.
Regards,
WondersMind,
Web Design Company Bangalore
Your blog provided us with valuable information to work with. Thanks a lot for sharing. Keep blogging. Website Designing and Development Company in Bangalore | bangalore web design companies | best web design company in BangaloreWebsite Designing and Development Company in Bangalore | bangalore web design companies | best web design company in Bangalore
ReplyDeleteThe post is really good, we will use above mentioned strategy in our Web Development agency Bangalore.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHire WordPress Developer
ReplyDeleteHire Magento Developer
Hire Hubspot COS Developer
Hire SASS Designer
Hire LESS CSS Designer
Hire Divi Theme Developer
Hire Php Programmer
Hire Genesis Framework Developer
Hire WooCommerce Developer
Hei, jeg vil dele mitt fantastiske vitnesbyrd Etter å ha vært i forhold til Ektemann i årevis, brøt han med meg, jeg gjorde alt for å bringe ham tilbake, men alt var forgjeves, jeg ville ha ham tilbake så mye på grunn av kjærligheten jeg har For ham ba jeg ham om alt, jeg gjorde løfter, men han nektet. putlocker
ReplyDelete