Snippet for disabling regenerate cache when running wp all import
-
Hello, I am using the plugin for caching a YMM (year/make/model) Taxonomy filter on my site.
I found that when I trying to indexing the product YMM taxonomy via Wp all import. The plugin seems to regenerate the cache every time when a record is imported. It causes the database overload and broken while the import. But if I disable the plugin before I import the product. The import process will be OK.
I got this code below from the wp all import support. They said placing this code into the wp all import function editor in order to stop the woocommerce terms counting while the import. And It may help reducing pressure for the database.
<?php
add_filter(‘wp_all_import_recount_terms_after_import’, ‘wpai_wp_all_import_recount_terms_after_import’, 10, 2);
function wpai_wp_all_import_recount_terms_after_import($is_recount_terms, $import_id){
return false;
}
?>I wonder if you would help me write a function to stop the cache generate while the import process? So I dont have to disable the plugin before the import.
Thank a lot!
- The topic ‘Snippet for disabling regenerate cache when running wp all import’ is closed to new replies.