Results 1 to 1 of 1
  1. #1
    ddm
    ddm is offline Former Member
    Join Date
    July 2006
    Posts
    1,125
    Thanks
    418
    Thanked 470 Times in 287 Posts

    Default wordpress speed hacks [remove wp gutenbergblock library css + JS , and woo block css]

    Another bloat prevention

    what: "If you’re addicted to making your WordPress site load as fast as possible you may have noticed a bit of CSS from Gutenberg. Every request on your site will slightly slow down your pages so if you’re not using Gutenberg you’ll want to remove Gutenberg CSS.

    This provides support to blocks but if you are using the classic editor you most likely don’t want it loading with your pages. I noticed the “block-library/style.min.css” file loading even though I exclusively use the classic editor."

    how: - put this code in your theme/child theme functions.php



    Code:
    function smartwp_remove_wp_block_library_css(){
     wp_dequeue_style( 'wp-block-library' );
     wp_dequeue_style( 'wp-block-library-theme' );
     wp_dequeue_style( 'wc-block-style' ); // Remove WooCommerce block CSS
      
    }
    add_action( 'wp_enqueue_scripts', 'smartwp_remove_wp_block_library_css', 100 );

  2. The Following 3 Users Say Thank You to ddm For This Useful Post:

    MMM (12 August 2020), PromoteCasino (12 August 2020), universal4 (12 August 2020)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •