Remove Gutenberg Scripts From WordPress Site

Gutenberg is getting more stable than before. But still, there are some people who like to stick with the Classic Editor. If you are one of them then you should remove Gutenberg scripts from your website.

As you are not using it, it’s better to get rid of these scripts for better performance. Here is a solution for you. Just copy the following code and paste it inside your active theme function.php file. It will remove Gutenberg scripts from your site.

				
					// Remove all scripts and styles added by Gutenberg

// Remove Gutenberg scrips
add_action('wp_default_scripts', 'jltwp_adminify_remove_gutenberg_scripts', 9999);
function jltwp_adminify_remove_gutenberg_scripts($scripts)
{
    add_action('wp_enqueue_scripts', 'jltwp_adminify_remove_block_scripts_action');
    remove_action('enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles');
}

// Dequeue all scripts and styles added by Gutenberg
function jltwp_adminify_remove_block_scripts_action()
{
    wp_dequeue_style('wp-block-library');
    wp_dequeue_style('wc-block-style');
}

				
			

Perhaps, WP Adminify plugin users don’t need to work with this coding stuff. Just navigate to WP Adminify > Tweaks > Performance from your dashboard. You will see a option named “Remove Gutenberg Scripts”. Just enable it and save settings.

Remove Gutenberg Scripts
August 28, 2021
Performance
Was this article helpful?

© 2021-2024 - Adminify | All rights reserved

WP Adminfy accepted payment methods