How to remove more Woo bloat
-
How do i removed the following from non-woo pages:
<link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link as="script" rel="prefetch"> <link rel="stylesheet" id="wc-blocks-checkout-style-css" media="all"> <link rel="stylesheet" id="aws-style-css" media="all"> <script id="WCPAY_ASSETS-js-extra">var wcpayAssets = {"url":"https:\/\/rusticwatersrealty.com\/wp-content\/plugins\/woocommerce-payments\/dist\/"};</script>
I’m already running this php snippet:
function disable_woocommerce_loading_css_js() { if (function_exists('is_woocommerce')) { if (!is_woocommerce() && !is_cart() && !is_checkout()) { 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'); wp_dequeue_style('woocommerce-inline'); wp_dequeue_style('wc-block-style'); wp_dequeue_style('wc-block-vendors-style'); wp_dequeue_script('woocommerce'); wp_dequeue_script('wc-cart'); wp_dequeue_script('wc-checkout'); wp_dequeue_script('wc-single-product'); wp_dequeue_script('wc-cart-fragments'); wp_dequeue_script('wc-credit-card-form'); wp_dequeue_script('wc-chosen'); wp_dequeue_script('wc-add-to-cart'); wp_dequeue_script('wc-add-to-cart-variation'); wp_dequeue_script('wc-country-select'); wp_dequeue_script('wc-address-i18n'); wp_dequeue_script('wc-order-tracking'); wp_dequeue_script('wc_price_slider'); wp_dequeue_script('wc-quantity-increment'); 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'); wp_dequeue_script('woocommerce-cart-frontend'); } } } add_action('wp_enqueue_scripts', 'disable_woocommerce_loading_css_js', 99);
But the tags I shared still appear where they are not needed.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to remove more Woo bloat’ is closed to new replies.