Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nk23x/65e8d3b4809c2e19bb74a7c7ba8c5e73 to your computer and use it in GitHub Desktop.
Save nk23x/65e8d3b4809c2e19bb74a7c7ba8c5e73 to your computer and use it in GitHub Desktop.
Remove Global Styles and SVG Filters from WP 5.9.1 - 2022-02-27
// Remove Global Styles and SVG Filters from WP 5.9.1 - 2022-02-27
function remove_global_styles_and_svg_filters() {
remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
}
add_action('init', 'remove_global_styles_and_svg_filters');
// This snippet removes the Global Styles and SVG Filters that are mostly if not only used in Full Site Editing in WordPress 5.9.1+
// Detailed discussion at: https://github.com/WordPress/gutenberg/issues/36834
// WP default filters: https://github.com/WordPress/WordPress/blob/7d139785ea0cc4b1e9aef21a5632351d0d2ae053/wp-includes/default-filters.php
// add to wp-content/themes/theme/functions.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment