Why is WooCommerce So Slow – Here is how to FIX IT!
With a Plugin Way of Doing It
We have created a plugin called WC Speed Drain. This plugin stops loading the extra items you do not need on non- WooCommerce pages or posts in your site and speeds up WordPress core admin-ajax.php file.
You can download this plugin at the link below or simply do this inside your site by being logged into your WordPress administrative area and going to PLUGINS > ADD NEW and search for WC Speed Drain.
https://wordpress.org/plugins/wc-speed-drain-repair
Without a Plugin Way of Doing It
You can take the below code and add this into the functions.php file of your active theme. If you are not sure how to do this, comment below and we will guide you through it. WE LOVE QUESTIONS!!!
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); function child_manage_woocommerce_styles() { //remove generator meta tag remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); //first check that woo exists to prevent fatal errors if ( function_exists( 'is_woocommerce' ) ) { //dequeue scripts and styles if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-add-to-cart' ); wp_dequeue_script( 'wc-cart-fragments' ); wp_dequeue_script( 'wc-checkout' ); wp_dequeue_script( 'wc-add-to-cart-variation' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-cart' ); wp_dequeue_script( 'wc-chosen' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'prettyPhoto' ); wp_dequeue_script( 'prettyPhoto-init' ); wp_dequeue_script( 'jquery-blockui' ); wp_dequeue_script( 'jquery-placeholder' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); } } }
Some Other Snippets Here:
/** Disable Ajax Call from WooCommerce */ add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_cart_fragments', 11); function dequeue_woocommerce_cart_fragments() { if (is_front_page()) wp_dequeue_script('wc-cart-fragments'); } /** Disable Ajax Call from WooCommerce on front page and posts*/ add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_cart_fragments', 11); function dequeue_woocommerce_cart_fragments() { if (is_front_page() || is_single() ) wp_dequeue_script('wc-cart-fragments'); } /** Disable All WooCommerce Styles and Scripts Except Shop Pages*/ add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_styles_scripts', 99 ); function dequeue_woocommerce_styles_scripts() { if ( function_exists( 'is_woocommerce' ) ) { if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { # Styles wp_dequeue_style( 'woocommerce-general' ); wp_dequeue_style( 'woocommerce-layout' ); wp_dequeue_style( 'woocommerce-smallscreen' ); wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); # Scripts wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-add-to-cart' ); wp_dequeue_script( 'wc-cart-fragments' ); wp_dequeue_script( 'wc-checkout' ); wp_dequeue_script( 'wc-add-to-cart-variation' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-cart' ); wp_dequeue_script( 'wc-chosen' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'prettyPhoto' ); wp_dequeue_script( 'prettyPhoto-init' ); wp_dequeue_script( 'jquery-blockui' ); wp_dequeue_script( 'jquery-placeholder' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); } } }
Hope this was helpful and GET READY FOR SOME SPEED!!!
Never again with you ask “Why is WooCommerce So Slow”.
24 Comments
Hi
I would like to remove geolocation from the main page only – how do I do that? it causes extra 5 seconds of delay and I only really need this on woocommerce pages.
We can help with a support ticket at the link below.
https://www.wpfixit.com/product/fix-it-ticket/
I have the Enfold theme, it has been slow for quite a while but more recently
the safari browser has been extremely slow to load menus and text on front and shop pages. Do you know of a fix for this.?
We can fix it with the service at the link below.
https://www.wpfixit.com/product/wp-sup/
thanks WP Fixit … if you are interested you can try our free plugin to disable all Woo styles in one click, for websites that want to keep all the styles in style.css file only (you know what I mean)
https://wordpress.org/plugins/disable-wc-styles-littlebizzy/
Thanks for the plugin suggestion!
“WooCommerce powers over 40% of the web”
Have you got a source for this?
Yes at the link below. Make sure to click on the “ENTIRE INTERNET” tab. Guess you do not believe us uh. We do not make things up here in our articles.
https://trends.builtwith.com/shop
Once I install it, do I need to do anything, or does the plugin run in the background once activated?
Thanks
Activate and forget.
Hey guys,
thanks for creating the plugin. I think it is helping speeds a bit.
The issue is now add to cart is not working on my home page.
Any ideas?
Deactivate it. Try using WP Disable plugin to defer cart fragments.
My page instantly slows down by about 8-10 seconds when Jetpack is enabled – and I need jetpack for WooCommerce. Any suggestions to help me out with this issue?
Did you know we have a special product made to get your site blazing fast and deal with speed issues? See full details at https://www.wpfixit.com/product/wp-sup/
Please on which section of function.php should the snippet be pested
Good and useful tutorial . Also cache plugins for WordPress could help to speed up WooCommerce website
This… actually worked lol, got the page load from 11s to 4s, I’ll have to look for how to get from 4 to like 1 maximum but still you guys are awesome.
Love YA!
Worked a treat. Back to 97%, was 80 before.
Awesome sauce!
Does this work with the caching issues they have?
Yes.
Hello, I have tried it and it improved my performance a lot, congratulations
Glad this worked for you!