Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP 5.9 adds default Duotones before closing the body #38299

Closed
mkkeck opened this issue Jan 27, 2022 · 99 comments · Fixed by #38681, #48995 or #49103
Closed

WP 5.9 adds default Duotones before closing the body #38299

mkkeck opened this issue Jan 27, 2022 · 99 comments · Fixed by #38681, #48995 or #49103
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@mkkeck
Copy link

mkkeck commented Jan 27, 2022

Description

I've updated my WP to 5.9. Now there is new junk added before </body>, some SVG's and Style's.
This does not make sense, because I'm not using FSE and have disabled duotone and gradients.

Step-by-step reproduction instructions

  1. View html code of a page rendered with 5.8
  2. View html code of the same page rendered with 5.9
  3. In 1.) there are no SVG and Styles before closing body but in 2.)

Screenshots, screen recording, code snippet

No response

Environment info

  • Wordpress 5.9 with its Gutenberg
  • Own non-FSE theme
  • theme.json with dutotone:[], and customDuotone: false

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@johnstonphilip
Copy link
Contributor

I am seeing this too:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" ><defs><filter id="wp-duotone-dark-grayscale"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB" ><feFuncR type="table" tableValues="0 0.49803921568627" /><feFuncG type="table" tableValues="0 0.49803921568627" /><feFuncB type="table" tableValues="0 0.49803921568627" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" ><defs><filter id="wp-duotone-grayscale"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB" ><feFuncR type="table" tableValues="0 1" /><feFuncG type="table" tableValues="0 1" /><feFuncB type="table" tableValues="0 1" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" ><defs><filter id="wp-duotone-purple-yellow"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB" ><feFuncR type="table" tableValues="0.54901960784314 0.98823529411765" /><feFuncG type="table" tableValues="0 1" /><feFuncB type="table" tableValues="0.71764705882353 0.25490196078431" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" ><defs><filter id="wp-duotone-blue-red"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB" ><feFuncR type="table" tableValues="0 1" /><feFuncG type="table" tableValues="0 0.27843137254902" /><feFuncB type="table" tableValues="0.5921568627451 0.27843137254902" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" ><defs><filter id="wp-duotone-midnight"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB" ><feFuncR type="table" tableValues="0 0" /><feFuncG type="table" tableValues="0 0.64705882352941" /><feFuncB type="table" tableValues="0 1" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" ><defs><filter id="wp-duotone-magenta-yellow"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB" ><feFuncR type="table" tableValues="0.78039215686275 1" /><feFuncG type="table" tableValues="0 0.94901960784314" /><feFuncB type="table" tableValues="0.35294117647059 0.47058823529412" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" ><defs><filter id="wp-duotone-purple-green"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB" ><feFuncR type="table" tableValues="0.65098039215686 0.40392156862745" /><feFuncG type="table" tableValues="0 1" /><feFuncB type="table" tableValues="0.44705882352941 0.4" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" ><defs><filter id="wp-duotone-blue-orange"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " /><feComponentTransfer color-interpolation-filters="sRGB" ><feFuncR type="table" tableValues="0.098039215686275 1" /><feFuncG type="table" tableValues="0 0.66274509803922" /><feFuncB type="table" tableValues="0.84705882352941 0.41960784313725" /><feFuncA type="table" tableValues="1 1" /></feComponentTransfer><feComposite in2="SourceGraphic" operator="in" /></filter></defs></svg><script src='http://mydomain.com/wp-includes/js/hoverintent-js.min.js?ver=2.2.1' id='hoverintent-js-js'></script>

Looks to be related to duo tone things, which I am not using.

@johnstonphilip johnstonphilip added the [Type] Bug An existing feature does not function as intended label Jan 27, 2022
@lwangdu
Copy link

lwangdu commented Jan 27, 2022

I am seen the seem issue. I have reported this issue before but nothing happened.
Screen Shot 2022-01-27 at 2 55 59 PM
.

@gziolo gziolo added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Jan 28, 2022
@mkkeck
Copy link
Author

mkkeck commented Jan 28, 2022

I am seen the seem issue. I have reported this issue before but nothing happened.

That shows me again, before releasing a new Version and/or feature testing is not done carefull and complete and more and more we have to accept the dictation and forcing us using things we can not opt-out, wether what we want.

@mkkeck
Copy link
Author

mkkeck commented Jan 28, 2022

I see at the moment:
The stupied added junk breaks my page layout, there is extra spacing (blockGap) added!

WHY? WHY? WHY? WHY IS THIS DONE?!
I CAN EDIT MY THEME AT MY OWN! I DO NOT NEED WORDPRESS FEATURES BREAKING MY PAGES / AND THEMES!
PUT THESE STUPIED JUNK OF FEATURES INTO YOU OWN THEMES!

@Soean
Copy link
Member

Soean commented Jan 28, 2022

@mkkeck

That shows me again, before releasing a new Version and/or feature testing is not done carefull and complete and more and more we have to accept the dictation and forcing us using things we can not opt-out, wether what we want.

It is possible to test the release candidate and give feedback before an update. This way the whole project can benefit from it.

I DO NOT NEED WORDPRESS FEATURES BREAKING MY PAGES / AND THEMES!

No one has intentionally broken your site. The bug will surely be fixed in one of the next versions.

@Soean
Copy link
Member

Soean commented Jan 28, 2022

Related:

@mkkeck
Copy link
Author

mkkeck commented Jan 28, 2022

@Soean

It is possible to test the release candidate and give feedback before an update. This way the whole project can benefit from it.

Okay this point goes to you ;)
You are right.

No one has intentionally broken your site. The bug will surely be fixed in one of the next versions.

I've not said, that some one has intentionally broken my site ...
But for some time now, features, knitted with the hot needle without documentation, without opt-out and without the possibility of a back port in case of an error, are introduced into WordPress, which often lead to problems and are not thought through to the end. This in turn then shatters painstakingly created layouts or complete websites, makes the work of theme and plugin developers to nothing and leads again and again to frustration.

Why is WordPress now rolling out global CSS styles in the front-end, regardless of loss, ruin and infirmity? Why, and this has been criticized for months, is there no way to adjust this, sometimes seriously interfering with the content and front-end, by an opt-in or opt-out?

@skorasaurus
Copy link
Member

Hi,

Thanks for reporting;
This has been discussed and/or requested in #24684. Please share your opinion in that issue.

As a workaround, you can disable the default colors by disabling the global styles.

@skorasaurus skorasaurus added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Jan 28, 2022
@mkkeck
Copy link
Author

mkkeck commented Jan 28, 2022

Awww,

Why closing? This is really not the same thing as in #24684.

Closing this issue and your answer @skorasaurus shows again, that it does not really make sense to report issues and leave critical comments.

Ciao.

@skorasaurus
Copy link
Member

@mkkeck

If you can clarify how this issue is different, I would appreciate it so then I'd know to reopen it. On second review, you mentioned the inclusion of SVG files although that is also mentioned at #37927.

Both issues discuss that extra CSS global styles (that define colors) are included in the page even when the default color palette is disabled and that behavior is unexpected.

@bridgeport
Copy link

bridgeport commented Jan 28, 2022

@skorasaurus It seems like @mkkeck issue is different from #37927 as it appears @mkkeck doesn't want the SVG inserted at all. Not even one instance, as they're not using duotone. I don't even believe they're experiencing the duplicate issue.

The issue you cited is someone reporting multiple, duplicate STYLE and SVG insertions within the HTML. They don't seem to have any objection to the STYLE and SVG inserted, as long as there's only one proper instance.

@mkkeck appears to want some method or filter to disable the SVG footer output to keep their HTML clean. There doesn't appear to be a way to disable/deactivate this like you would other filters.

For instance, you could use something like the following to prevent the loading attribute from being used:

add_filter( 'wp_lazy_loading_enabled', '__return_false' );

But there's no equivalent for preventing the SVG HTML from being inserted into the footer of every page and post AFAIK. It's being inserted whether or not there's any block on the page that has duotone enabled.

If you're not using duotone, its existence within the HTML serves no purpose.

@Kovalchik8
Copy link

add_action('init', function() {

  // remove duotone support for Gutenberg blocks
  remove_filter('render_block', 'wp_render_duotone_support');
});

@bridgeport
Copy link

@Kovalchik8 Your code doesn't remove the SVG code from the footer. The duotone SVG HTML is still inserted on every page and post.

A few days ago, someone also posted on the wordpress support forums that this filter removal no longer works:
https://wordpress.org/support/topic/disabling-gutenberg-duotone-filter/#post-15300929

@mkkeck
Copy link
Author

mkkeck commented Jan 31, 2022

@mkkeck

If you can clarify how this issue is different, I would appreciate it so then I'd know to reopen it. On second review, you mentioned the inclusion of SVG files although that is also mentioned at #37927.

This issue is another new feature, which bloats the HTML output, wether using duotone and/or blockGap or not, and has nothing to do with the other also not always needed features.

Both issues discuss that extra CSS global styles (that define colors) are included in the page even when the default color palette is disabled and that behavior is unexpected.

Yes that's correct, but it's another building site. This issue here exists since WP 5.9 only and has nothing to do with default color palette.

If I don't want and not have configured or have disabled the duotone and blockGap settings, than I don't want, that WordPress bloats the rendered HTML for the frontend with styles and SVGs, which never used, before closing the body.

Reading the reported issue and comparing with changelogs may be help, before simple closing and reporting issues are duplicate of an existing one.

@mkkeck
Copy link
Author

mkkeck commented Jan 31, 2022

Hi,

Thanks for reporting;
This has been discussed and/or requested in #24684. Please share your opinion in that issue.

As a workaround, you can disable the default colors by disabling the global styles.

I've disabled global styles :)
But it does not solve this issue.

I've also added follow lines in my functions.php to remove the wp-container- styles produced by blockGap and the duotone-styles:

remove_filter('render_block', 'wp_render_duotone_support');
remove_filter('render_block', 'wp_restore_group_inner_container');
remove_filter('render_block', 'wp_render_layout_support_flag');

But the junk SVG can not be removed at the moment, missing an action/ filter to remove them. The problem is:

// file: wp-includes/block-supports/duotone.php;
// line: #459 ... 467 
// produces the junk SVG, even if duot0ne is not used.
// Other point: Why fallbacks for stupid Safari,
// which force other browsers to load this junk?
add_action( 
  // Safari doesn't render SVG filters defined in data URIs, 
  // and SVG filters won't render in the head of a document, 
  // so the next best place to put the SVG is in the footer. 
  is_admin() ? 'admin_footer' : 'wp_footer', 
  function () use ( $svg ) { echo $svg; } 
);

@mkkeck
Copy link
Author

mkkeck commented Jan 31, 2022

The duotone and blockGap stuff should perhabs moved from the WordPress core to the Twenty-themes.

@oguilleux
Copy link

Hi @mkkeck

Try this :

function remove_global_styles() {
  remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');
  remove_action('wp_footer', 'wp_enqueue_global_styles', 1);
}
add_action('after_setup_theme', 'remove_global_styles', 10, 0);

@mkkeck
Copy link
Author

mkkeck commented Jan 31, 2022

Hi @mkkeck

Try this :

function remove_global_styles() {
  remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');
  remove_action('wp_footer', 'wp_enqueue_global_styles', 1);
}
add_action('after_setup_theme', 'remove_global_styles', 10, 0);

Thanks for your feedback.

I think, this would not remove the duotone SVGs. There's a hardcoded action in file wp-includes/block-supports/duotone.php#459 ... 467

@oguilleux
Copy link

oguilleux commented Jan 31, 2022

Oh ! Are you sure ? I have the same problem and I don't see the duotone SVGs anymore with these actions removed.

@mkkeck
Copy link
Author

mkkeck commented Jan 31, 2022

Oh ! Are you sure ? I have the same problem and I don't see the duotone SVGs anymore with these actions removed.

Ok, I will give it a try, when I'm in office.
Are using WP5.9 with its shipped Gutenberg, or do you use Gutenberg as a plugin?
I'm using the shipped Gutenberg.

@oguilleux
Copy link

WP 5.9

@Soean
Copy link
Member

Soean commented Jan 31, 2022

I reopen the issue. I can reproduce it withe a new theme.

{
	"settings": {
		"color": {
			"duotone": [],
			"customDuotone": false
		}
	}
}

We have "defaultGradients": false and "defaultPalette": false but not "defaultDoutones": false

@Soean Soean reopened this Jan 31, 2022
@mkkeck
Copy link
Author

mkkeck commented Jan 31, 2022

Hi @mkkeck

Try this :

function remove_global_styles() {
  remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');
  remove_action('wp_footer', 'wp_enqueue_global_styles', 1);
}
add_action('after_setup_theme', 'remove_global_styles', 10, 0);

This removes the SVGs :)
Thanks.

I've added now to my theme functions.php:

add_action('after_setup_theme', function() {

  // remove SVG and global styles
  remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');

  // remove wp_footer actions which add's global inline styles
  remove_action('wp_footer', 'wp_enqueue_global_styles', 1);

  // remove render_block filters which adding unnecessary stuff
  remove_filter('render_block', 'wp_render_duotone_support');
  remove_filter('render_block', 'wp_restore_group_inner_container');
  remove_filter('render_block', 'wp_render_layout_support_flag');
});

@Soean Soean changed the title WP 5.9 adds junk before closing the body WP 5.9 adds default Duotones before closing the body Jan 31, 2022
@mkkeck
Copy link
Author

mkkeck commented Jan 31, 2022

It's not only adding Duotones, the styles for each wp-container-idxxxx of the blockGap feature, which is disabled in my theme, is also added. So that's why I've said "WP 5.9 adds junk before closing the body".

There should nothing overwritten, replaced or added or merged with WP global styles, which can break existing themes.
Please note: Not all users are using Twenty-xxx-themes.
And please put such things into the Twenty-xxx-themes and not to the core!

@patrickwc
Copy link

Others have already pointed this out but I wanted to reiterate the point. It seems very weird to me that the decision to output an extra ~260lines of HTML worth of SVG filters on every page, regardless of whether duotone's have been disabled in theme.json (or even if a block is used on a page!) was allowed to go live and still hasn't been fixed after months. No wonder a lot of WP sites rank badly on pagespeed insights. This is bad for hosting costs, users data, page speed scores and green credentials.

This filter removed it for me, thanks @vralle.

remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );

The SVGs were being output just after the opening tag for me - ~260 lines of HTML added to every page completely unnecessarily!

@Mamaduka Mamaduka removed the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Nov 7, 2022
@ocean90
Copy link
Member

ocean90 commented Nov 11, 2022

As noted in this blog post, you can now set "duotone": null in theme.json which removes the default duotone palette, inline SVGs, and the CSS custom properties.
Though, the JSON schema validation will report a type error but it works™.

@straightvisions-matthias-bathke
Copy link

straightvisions-matthias-bathke commented Nov 16, 2022

As noted in this blog post, you can now set "duotone": null in theme.json which removes the default duotone palette, inline SVGs, and the CSS custom properties. Though, the JSON schema validation will report a type error but it works™.

Tested and can confirm that this works now.

Update
Unfortunately, "duotone":null results in
javascript error "TypeError: Cannot reat properties of null (reading 'default') in react-dom.min.js
on Site Editor

image

@kevinlo123
Copy link

kevinlo123 commented Dec 21, 2022

{ "version": 2, "settings": { "color": { "defaultPalette": false, "defaultGradients": false, "duotone": [], "defaultDuotone": false, "palette": [ { "name": "Dark Blue", "slug": "dark-blue", "color": "#233142" }, { "name": "Yellow", "slug": "yellow", "color": "#facf5a" }, { "name": "Blue", "slug": "blue", "color": "#0170ca" }, { "name": "Red", "slug": "red", "color": "#ff5959" }, { "name": "Green", "slug": "green", "color": "#4f9da6" }, { "name": "White", "slug": "white", "color": "#FFFFFF" }, { "name": "Grey", "slug": "grey", "color": "#f2f2f2" }, { "name": "Purple", "slug": "purple", "color": "#8c6cde" } ] } } }

My theme.json that worked for anyone running into this.

@ngdangtu-vn
Copy link

WP 6.0-RC4. I still see duotone filters in markup. I don't know how to comment on this.

remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); This hook does the trick.

Mine WP version is 6.1.1, and it works if I put it in functions.php of my theme. Thanks for the tip.

@1ucay
Copy link

1ucay commented Mar 2, 2023

Hello, I removing all --wp prefix. Im not using blocks.css :)

add_action( 'wp_enqueue_scripts', 'core_gutenberg_wp_enqueue_scripts', 11 );
function core_gutenberg_wp_enqueue_scripts() {
    if ( ! is_admin() ) {
        global $wp_styles;
        $gs = $wp_styles->registered['global-styles']->extra['after'];
        wp_styles()->add_data( 'global-styles', 'after', '' ); 
        foreach( array( 'pale-pink', 'vivid-red', 'luminous-vivid-orange', 'luminous-vivid-amber', 'light-green-cyan', 'vivid-green-cyan', 'pale-cyan-blue', 'vivid-cyan-blue', 'vivid-purple', 'very-light-gray', 'cyan-bluish-gray', 'very-dark-gray' ) as $color ) {
            $gs[0] = preg_replace('/.has-' . $color . '-(background|border)-color{.*?}/i', '', $gs[0] );
            $gs[0] = preg_replace('/.has-' . $color . '-color{.*?}/i', '', $gs[0] );
            $gs[0] = preg_replace('/--wp--preset--color--' . $color . ':.*?;/i', '', $gs[0] );
        }
        foreach( array( 'vivid-cyan-blue-to-vivid-purple', 'light-green-cyan-to-vivid-green-cyan', 'luminous-vivid-amber-to-luminous-vivid-orange', 'luminous-vivid-orange-to-vivid-red', 'very-light-gray-to-cyan-bluish-gray', 'cool-to-warm-spectrum', 'blush-light-purple', 'blush-bordeaux', 'luminous-dusk', 'pale-ocean', 'electric-grass', 'midnight' ) as $color ) {
           $gs[0] = preg_replace('/--wp--preset--gradient--' . $color . ':.*?;/i', '', $gs[0] );
           $gs[0] = preg_replace('/.has-' . $color . '-gradient-background{.*?}/i', '', $gs[0] );
        }
        wp_add_inline_style( 'global-styles', str_replace( array( '.wp-', '--wp', 'wp-' ), array( '.', '', '' ), implode( '', $gs ) ) );
        //wp_dequeue_style( 'global-styles' ); // Remove theme.json
    }
}   

@ajlende
Copy link
Contributor

ajlende commented Mar 17, 2023

We've attempted at a fix for this in #49103 which should make it into the Gutenberg 15.5 release.

The wp_global_styles_render_svg_filters is no longer used to render the SVGs so the workaround is no longer needed.

All global styles are handled by duotone block supports now instead of being part of the global styles stylesheet. It was a rather involved change, so please open an issue if you run into any unexpected side-effects of moving these styles around.

@renepf
Copy link

renepf commented Apr 19, 2023

I wrote a little script, and added it to the functions.php file of my child theme. For me this worked. Just be careful, in case you add this to your core theme that it won't get updated. So you may want to write an extra script to call this as a php file when not using a childtheme.

add_action( 'wp_footer', 'remove_wp_filters', 10 );
function remove_wp_filters() {
    ?>
    <script type="text/javascript">
        jQuery(document).ready(function($) {
            $('svg').filter(function() {
                return this.innerHTML.indexOf('wp-duotone') !== -1;
            }).remove();
        });
    </script>
    <?php
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet