• colinlam

    (@colinlam)


    Hi,
    I find lots of svg code in my website html with reference to buttons, blogs and social icons. I never needed svg in the past and I don’t think I need it now.

    So, on my test site I removed all the social icons and buttons and deactivated all plugins, then activated theme twentytwenty. When I view the code there is no svg code. If I then activate a block theme there is lots of svg code.

    To my limited knowledge svg is part of document markup and was always considered to be a security risk.

    I don’t see why it is necessary for website design having used jpeg and png for years with no visual issues. Vector graphics are a blessing in magazine design but simply not required for website display in my opinion.

    This additional unwanted code is reducing my “content to code” percentage and its possible the http could affect my SEO due to mixed content.

    Its a bit like bloatware hahaha.

    I would like to remove it all so do you have any information on how I could do that?

    Many thanks
    Col

    • This topic was modified 3 years ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not a Requests and Feedback topic
Viewing 4 replies - 1 through 4 (of 4 total)
  • threadi

    (@threadi)

    What you describe is a known bug in Gutenberg which actual ships in WordPress 5.9.x. There is the issue for it: https://github.com/WordPress/gutenberg/issues/38299 – there you’ll find some “solutions” you could add in your functions.php.

    Vijay Hardaha

    (@vijayhardaha)

    You can find custom code here to remove those things
    https://github.com/WordPress/gutenberg/issues/36834#issuecomment-1048923664

    Thread Starter colinlam

    (@colinlam)

    Unfortunately the custom code removes all of the styling. I had developed my website with wordpress quite a few years ago but redesigned it in an offline editor which used css and JS for much of the style and effects. When I saw the release of version 5.9 with FSE I then redesigned my website using those tools.

    If I now use those codes, in order to remove the svg bloatware, all the styling is lost?

    To be honest, my website is now pretty static with no bells and whistles unlike my more dynamic old website. I thought I was making a step forward?

    Am I missing something?

    Thanks

    • This reply was modified 3 years ago by colinlam.
    Vijay Hardaha

    (@vijayhardaha)

    You can only use svg action to remove svg after body and keep your global styles as it is.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disable SVG in wordpress and themes’ is closed to new replies.