You are here:
< Back

If you’ve added a file before activating WP SVG you may still have XML headers in your SVG file.

These don’t play so well when inlined into HTML so you can use a function like the below to fix this, just add it to your functions.php file.

 

add_filter( 'wpsvg_inline_svg_markup', function ( $contents ) {
    return preg_replace( '/<\?xml.+?\?>/', '', $contents );
} );
XML Headers Appearing Inline