{"id":608,"date":"2025-12-18T14:50:17","date_gmt":"2025-12-18T13:50:17","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=608"},"modified":"2026-02-05T14:22:02","modified_gmt":"2026-02-05T13:22:02","slug":"how-to-improve-the-loading-speed-of-a-woocommerce-based-store","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-improve-the-loading-speed-of-a-woocommerce-based-store\/","title":{"rendered":"How to improve the loading speed of a WooCommerce-based store?"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">WooCommerce is one of the popular plugins that will turn your WordPress website into an online store. Most popular themes offer an integrated store feature using a WooCommerce plugin. From testing the page speed control on GTmetrix and pingdom, it can often be concluded that the &#8220;wc-ajax=get_refreshed_fragments&#8221; element takes about a second to load. If you are having a problem with your WooCommerce Ajax call page speed, here are the solutions to help you solve this problem for different scenarios.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-improve-the-loading-speed-of-a-woocommerce-based-store\/#What_is_wc-ajaxget_refreshed_fragments\" >What is wc-ajax=get_refreshed_fragments ?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-improve-the-loading-speed-of-a-woocommerce-based-store\/#Admin_ajax_references_and_page_loading\" >Admin ajax references and page loading.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-improve-the-loading-speed-of-a-woocommerce-based-store\/#How_do_I_fix_the_problem_with_wc-ajaxget_refreshed_fragments\" >How do I fix the problem with wc-ajax=get_refreshed_fragments?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-improve-the-loading-speed-of-a-woocommerce-based-store\/#Disable_only_cart_fragmentation_on_the_homepage\" >Disable only cart fragmentation on the homepage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-improve-the-loading-speed-of-a-woocommerce-based-store\/#Disable_only_cart_fragmentation_on_your_homepage_and_posts\" >Disable only cart fragmentation on your homepage and posts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-improve-the-loading-speed-of-a-woocommerce-based-store\/#Disabling_all_WooCommerce_styles_and_scripts_on_all_pages_except_store_pages\" >Disabling all WooCommerce styles and scripts on all pages except store pages.<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_wc-ajaxget_refreshed_fragments\"><\/span>What is wc-ajax=get_refreshed_fragments ?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Below is a screenshot of pingdom showing the long wait time for &#8220;wc-ajax=get_refreshed_fragments&#8221; to load on the page. You can also see that this script will be listed as a render-blocking issue in Google PageSpeed Insights and find it under the waterfall chart in GTmetrix.<\/p>\n\n\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"204\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-282.png\" alt=\"\" class=\"wp-image-4582\" srcset=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-282.png 826w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-282-300x74.png 300w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-282-768x190.png 768w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-282-18x4.png 18w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/figure>\n<\/div>\n\n\n\n\n<div id=\"mybox-417727891\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">Basically, WooCommerce tries to collect the details of the cart by calling a script and it takes a lot of time. The plugin retrieves the uncached cart details on each page to show the latest cart items by calling admin Ajax.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On pages where the script appears, you can find it in the source, for example, in the following form:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Admin_ajax_references_and_page_loading\"><\/span>Admin ajax references and page loading.<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WooCommerce uses this cart slicing admin Ajax call to update the items and total in the cart without refreshing the page. Calling admin Ajax on each page will significantly delay the page loading time and also consume large server resources. Another problem is that the plugin performs this action even on a page that does not have a shopping cart or details related to the product.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, the problem exists on the &#8220;About Us&#8221; page, where there are no WooCommerce components available. So, deleting the shopping cart on the page will not help in improving the loading speed of the page. What we need is to disable cart updates, where there are no carts or products displayed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_I_fix_the_problem_with_wc-ajaxget_refreshed_fragments\"><\/span>How do I fix the problem with wc-ajax=get_refreshed_fragments?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The problem should be fixed by disabling the script by modifying the functions.php file of your theme.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can modify functions.php through the WordPress admin panel or using FTP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of modifying the file functions.php the main theme, you can create a child theme and add additional features there. This will help you keep your changes when you update the main theme.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are three options to disable the WooCommerce Ajax cart fragmentation script.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Disable only cart fragmentation on the homepage<\/li>\n\n\n\n<li>Disable only cart fragmentation on your homepage and posts<\/li>\n\n\n\n<li>Disabling all WooCommerce styles and scripts on all pages except store pages.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s discuss all three options in detail, but make sure to do only one of them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Disable_only_cart_fragmentation_on_the_homepage\"><\/span>Disable only cart fragmentation on the homepage<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Log in to your WordPress admin panel, go to &#8220;Appearance &gt; Theme File Editor&#8221; in the menu on the left, and locate the functions.php file. Add the following code at the end of the file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/** Disable Ajax Call from WooCommerce *\/\nadd_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_cart_fragments', 11); \nfunction dequeue_woocommerce_cart_fragments() { if (is_front_page()) wp_dequeue_script('wc-cart-fragments'); }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It should look like below in the editor, after pasting the code click on &#8220;Update File or Update&#8221; to save the changes.<\/p>\n\n\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"332\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-283.png\" alt=\"\" class=\"wp-image-4583\" srcset=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-283.png 828w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-283-300x120.png 300w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-283-768x308.png 768w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-283-18x7.png 18w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-283-825x332.png 825w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/figure>\n<\/div>\n\n<div class=\"translation-block translation-block-merged\">\n\n\n<p class=\"wp-block-paragraph\">If you want to use FTP, log in to your server with an FTP account. Go to &#8220;\/wp-content\/your-theme\/&#8221; and find the &#8220;functions.php&#8221; file. Edit and add the above code at the end of the file and upload the modified file back to the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the file is updated, go to the &#8220;WooCommerce &gt; Settings&#8221; menu and go to the &#8220;Products&#8221; tabs. Enable the checkbox next to &#8220;Redirect to cart when product is added.&#8221;<\/p>\n\n\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"345\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-284-1024x345.png\" alt=\"\" class=\"wp-image-4594\" srcset=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-284-1024x345.png 1024w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-284-300x101.png 300w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-284-768x259.png 768w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-284-18x6.png 18w, https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-284.png 1196w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n<div class=\"translation-block translation-block-merged\">\n\n\n<p class=\"wp-block-paragraph\">This will help the customer to go to the main cart page instead of waiting for a long time after adding an item to the cart. Otherwise, even though an item is added, your cart may not show updated details when you are on the same page because the cart fragmentation script is disabled.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Disable_only_cart_fragmentation_on_your_homepage_and_posts\"><\/span>Disable only cart fragmentation on your homepage and posts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The above code will disable the cart snippet script only on the static home page. If you want to disable the script on all posts, try adding the following code in your theme&#8217;s function.php file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/** Disable Ajax Call from WooCommerce on front page and posts*\/\nadd_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_cart_fragments', 11);\nfunction dequeue_woocommerce_cart_fragments() {\nif (is_front_page() || is_single() ) wp_dequeue_script('wc-cart-fragments');\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Disabling_all_WooCommerce_styles_and_scripts_on_all_pages_except_store_pages\"><\/span>Disabling all WooCommerce styles and scripts on all pages except store pages.<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In a situation where you want to get the best result and you don&#8217;t need store elements on other subpages or in posts, you can use the script below by adding it to functions.php on the same principle as described above.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/** Disable All WooCommerce  Styles and Scripts Except Shop Pages*\/\nadd_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_styles_scripts', 99 );\nfunction dequeue_woocommerce_styles_scripts() {\nif ( function_exists( 'is_woocommerce' ) ) {\nif ( ! is_woocommerce() &amp;&amp; ! is_cart() &amp;&amp; ! is_checkout() ) {\n# Styles\nwp_dequeue_style( 'woocommerce-general' );\nwp_dequeue_style( 'woocommerce-layout' );\nwp_dequeue_style( 'woocommerce-smallscreen' );\nwp_dequeue_style( 'woocommerce_frontend_styles' );\nwp_dequeue_style( 'woocommerce_fancybox_styles' );\nwp_dequeue_style( 'woocommerce_chosen_styles' );\nwp_dequeue_style( 'woocommerce_prettyPhoto_css' );\n# Scripts\nwp_dequeue_script( 'wc_price_slider' );\nwp_dequeue_script( 'wc-single-product' );\nwp_dequeue_script( 'wc-add-to-cart' );\nwp_dequeue_script( 'wc-cart-fragments' );\nwp_dequeue_script( 'wc-checkout' );\nwp_dequeue_script( 'wc-add-to-cart-variation' );\nwp_dequeue_script( 'wc-single-product' );\nwp_dequeue_script( 'wc-cart' );\nwp_dequeue_script( 'wc-chosen' );\nwp_dequeue_script( 'woocommerce' );\nwp_dequeue_script( 'prettyPhoto' );\nwp_dequeue_script( 'prettyPhoto-init' );\nwp_dequeue_script( 'jquery-blockui' );\nwp_dequeue_script( 'jquery-placeholder' );\nwp_dequeue_script( 'fancybox' );\nwp_dequeue_script( 'jqueryui' );\n}\n}\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that by performing one of the above actions, you are interfering with the structure of the template and store settings. If you are not sure about the actions you are taking, consult them with your webmaster.<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[25,58],"manual_kb_tag":[2822,2823,2824,2825,198,363,419,571,2820,2821],"class_list":["post-608","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-hosting","manualknowledgebasecat-web-applications-cms","manual_kb_tag-pingdom","manual_kb_tag-admin-ajax","manual_kb_tag-ajax-cart-updates","manual_kb_tag-cart-fragments","manual_kb_tag-woocommerce","manual_kb_tag-page-speed","manual_kb_tag-wordpress-plugin","manual_kb_tag-online-store","manual_kb_tag-google-pagespeed-insights","manual_kb_tag-gtmetrix"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/608\/revisions"}],"predecessor-version":[{"id":4595,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/608\/revisions\/4595"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=608"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=608"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}