Hi Sannin,
The file sizes are admittedly large, but as we are using the algolia instant search and autocomplete libraries – it is unavoidable at the moment – we are looking into alternatives to see how to make it better, but there isn’t a quick fix.
If you are only using the instant search for WooCommerce shop and not autocomplete or instant search for the base plugin then you can dequeue the script for the base plugin with the following code.
add_action('wp_print_scripts','cm_07072022_dequeue_scripts');
function cm_07072022_dequeue_scripts(){
wp_dequeue_script('cm-typesense-frontend');
wp_deregister_script('cm-typesense-frontend');
}
However – please keep in mind this will disable the base plugins functionality.
Hope this helps.
Thread Starter
sannin
(@sannin)
So the js file of woocommerce addons just adds the instant search functionality?
If i just use the autocomplete, can i safely remove it?
Hi Sannin,
Are you replacing WordPress search with Typesense search ? Or are you replacing WooCommerce search with Typesense WC Search ?
If it’s the first – then yes you can safely remove WooCommerce js files.
If it’s the second – you would need to replace SWT js files.
I hope that makes sense.
All in all – please do test before implementing.