[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"\u002Fblog\u002Fremove-gutenberg-css-wordpress":3,"$fnWiMVnxKdRcOTe3KpJznGLvYnH68-umH1JFWn0pffEA":258,"i-local-icon:calendar-days":261,"i-local-icon:tag":266,"i-local-icon:eye":268},{"id":4,"title":5,"body":6,"categories_slug":245,"comment_count":248,"date_published":249,"description":250,"extension":251,"meta":252,"navigation":253,"path":254,"seo":255,"stem":256,"__hash__":257},"content\u002Fblog\u002F3.remove-gutenberg-css-wordpress.md","Remove Gutenberg CSS Library from WordPress",{"type":7,"value":8,"toc":241},"minimark",[9,13,18,23,27,30,114,126,135,139,142,237],[10,11,5],"h1",{"id":12},"remove-gutenberg-css-library-from-wordpress",[14,15],"meta-card",{":categories":16,":date":17},"categories_slug","date_published",[19,20,22],"h2",{"id":21},"overview","Overview",[24,25,26],"p",{},"As web developers, in our never-ending attempt to keep Google happy with good Lighthouse scores, and to help with making your WordPress site load as fast as possible, if you are not using the Gutenberg editor (which was introduced in WordPress version 5), it is a good idea to remove the Gutenberg CSS which is automatically loaded by WordPress.",[24,28,29],{},"To see if the Gutenberg CSS block library is being loaded on your site, inspect the head section of your site and look for a stylesheet with an ID of ‘wp-block-library-css’.",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-html shiki shiki-themes github-dark","\u003Clink\n  rel=\"stylesheet\"\n  id=\"wp-block-library-css\"\n  href=\"https:\u002F\u002Fbordermedia.local\u002Fwp-includes\u002Fcss\u002Fdist\u002Fblock-library\u002Fstyle.min.css?ver=5.8.2\"\n  type=\"text\u002Fcss\"\n  media=\"all\" \u002F>\n","html","",[38,39,40,53,67,78,89,100],"code",{"__ignoreMap":36},[41,42,45,49],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"s95oV","\u003C",[41,50,52],{"class":51},"s4JwU","link\n",[41,54,56,60,63],{"class":43,"line":55},2,[41,57,59],{"class":58},"svObZ","  rel",[41,61,62],{"class":47},"=",[41,64,66],{"class":65},"sU2Wk","\"stylesheet\"\n",[41,68,70,73,75],{"class":43,"line":69},3,[41,71,72],{"class":58},"  id",[41,74,62],{"class":47},[41,76,77],{"class":65},"\"wp-block-library-css\"\n",[41,79,81,84,86],{"class":43,"line":80},4,[41,82,83],{"class":58},"  href",[41,85,62],{"class":47},[41,87,88],{"class":65},"\"https:\u002F\u002Fbordermedia.local\u002Fwp-includes\u002Fcss\u002Fdist\u002Fblock-library\u002Fstyle.min.css?ver=5.8.2\"\n",[41,90,92,95,97],{"class":43,"line":91},5,[41,93,94],{"class":58},"  type",[41,96,62],{"class":47},[41,98,99],{"class":65},"\"text\u002Fcss\"\n",[41,101,103,106,108,111],{"class":43,"line":102},6,[41,104,105],{"class":58},"  media",[41,107,62],{"class":47},[41,109,110],{"class":65},"\"all\"",[41,112,113],{"class":47}," \u002F>\n",[24,115,116,117,125],{},"You can also see that ",[118,119,124],"a",{":target":120,"href":121,"rel":122},"\\_blank","https:\u002F\u002Fdevelopers.google.com\u002Fweb\u002Ftools\u002Flighthouse",[123],"nofollow","Google Lighthouse"," marks it as a render-blocking resource, which is why if you are exclusively using the WordPress classic editor, it is a good idea to stop this unused CSS from loading on every page.",[24,127,128],{},[129,130],"img",{"alt":131,"className":132,"src":134},"Gutenberg render-blocking image",[133],"blog-image","\u002Fimages\u002Fblog\u002Fgutenberg-css\u002Fgutenberg-css-01.jpg",[19,136,138],{"id":137},"solution","Solution",[24,140,141],{},"Add the following code to your WordPress themes function.php file:",[31,143,147],{"className":144,"code":145,"language":146,"meta":36,"style":36},"language-php shiki shiki-themes github-dark","\u002F\u002F Stop Gutenberg block library CSS from loading.\nfunction remove_wp_block_library_css() {\n    wp_dequeue_style( 'wp-block-library' );\n    wp_dequeue_style( 'wp-block-library-theme' );\n    wp_dequeue_style( 'wc-block-style' ); \u002F\u002F Remove WooCommerce block CSS\n}\nadd_action( 'wp_enqueue_scripts', 'remove_wp_block_library_css', 100 );\n","php",[38,148,149,155,167,181,192,207,212],{"__ignoreMap":36},[41,150,151],{"class":43,"line":44},[41,152,154],{"class":153},"sAwPA","\u002F\u002F Stop Gutenberg block library CSS from loading.\n",[41,156,157,161,164],{"class":43,"line":55},[41,158,160],{"class":159},"snl16","function",[41,162,163],{"class":58}," remove_wp_block_library_css",[41,165,166],{"class":47},"() {\n",[41,168,169,172,175,178],{"class":43,"line":69},[41,170,171],{"class":58},"    wp_dequeue_style",[41,173,174],{"class":47},"( ",[41,176,177],{"class":65},"'wp-block-library'",[41,179,180],{"class":47}," );\n",[41,182,183,185,187,190],{"class":43,"line":80},[41,184,171],{"class":58},[41,186,174],{"class":47},[41,188,189],{"class":65},"'wp-block-library-theme'",[41,191,180],{"class":47},[41,193,194,196,198,201,204],{"class":43,"line":91},[41,195,171],{"class":58},[41,197,174],{"class":47},[41,199,200],{"class":65},"'wc-block-style'",[41,202,203],{"class":47}," ); ",[41,205,206],{"class":153},"\u002F\u002F Remove WooCommerce block CSS\n",[41,208,209],{"class":43,"line":102},[41,210,211],{"class":47},"}\n",[41,213,215,218,220,223,226,229,231,235],{"class":43,"line":214},7,[41,216,217],{"class":58},"add_action",[41,219,174],{"class":47},[41,221,222],{"class":65},"'wp_enqueue_scripts'",[41,224,225],{"class":47},", ",[41,227,228],{"class":65},"'remove_wp_block_library_css'",[41,230,225],{"class":47},[41,232,234],{"class":233},"sDLfK","100",[41,236,180],{"class":47},[238,239,240],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .s4JwU, html code.shiki .s4JwU{--shiki-default:#85E89D}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":36,"searchDepth":55,"depth":55,"links":242},[243,244],{"id":21,"depth":55,"text":22},{"id":137,"depth":55,"text":138},[246,247],"development","wordpress",null,"2021-12-20","If you’re not using the Gutenberg editor (introduced in WordPress version 5), it is a good idea to remove the Gutenberg CSS which is automatically loaded.","md",{},true,"\u002Fblog\u002Fremove-gutenberg-css-wordpress",{"title":5,"description":250},"blog\u002F3.remove-gutenberg-css-wordpress","XkI2cKUylfQ6t06TLfNhVUK1chQQ0JLG1JftOdLWCMY",[259],{"id":69,"name":254,"count":260},4443,{"left":262,"top":262,"width":263,"height":263,"rotate":262,"vFlip":264,"hFlip":264,"body":265},0,24,false,"\u003Cpath\n    fill=\"none\"\n    stroke=\"currentColor\"\n    stroke-linecap=\"round\"\n    stroke-linejoin=\"round\"\n    stroke-width=\"1.5\"\n    d=\"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12zM12 15h.008v.008H12zm0 2.25h.008v.008H12zM9.75 15h.008v.008H9.75zm0 2.25h.008v.008H9.75zM7.5 15h.008v.008H7.5zm0 2.25h.008v.008H7.5zm6.75-4.5h.008v.008h-.008zm0 2.25h.008v.008h-.008zm0 2.25h.008v.008h-.008zm2.25-4.5h.008v.008H16.5zm0 2.25h.008v.008H16.5z\" \u002F>",{"left":262,"top":262,"width":263,"height":263,"rotate":262,"vFlip":264,"hFlip":264,"body":267},"\u003Cg\n    fill=\"none\"\n    stroke=\"currentColor\"\n    stroke-linecap=\"round\"\n    stroke-linejoin=\"round\"\n    stroke-width=\"1.5\">\n    \u003Cpath\n      d=\"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.1 18.1 0 0 0 5.224-5.223c.54-.827.368-1.908-.33-2.607l-9.583-9.58A2.25 2.25 0 0 0 9.568 3\" \u002F>\n    \u003Cpath d=\"M6 6h.008v.008H6z\" \u002F>\n  \u003C\u002Fg>",{"left":262,"top":262,"width":263,"height":263,"rotate":262,"vFlip":264,"hFlip":264,"body":269},"\u003Cg\n    fill=\"none\"\n    stroke=\"currentColor\"\n    stroke-linecap=\"round\"\n    stroke-linejoin=\"round\"\n    stroke-width=\"1.5\">\n    \u003Cpath\n      d=\"M2.036 12.322a1 1 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178c.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178\" \u002F>\n    \u003Cpath d=\"M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0\" \u002F>\n  \u003C\u002Fg>"]