Title: Autoptimize breaks inline SVG
Last modified: August 30, 2016

---

# Autoptimize breaks inline SVG

 *  [davitz](https://wordpress.org/support/users/davitz/)
 * (@davitz)
 * [11 years ago](https://wordpress.org/support/topic/autoptimize-breaks-inline-svg/)
 * I’ve put some very simple SVG-Images right into the CSS (to reduce server-calls),
   these get broken when Autoptimize is running – they disappear. Otherwise, all
   seems to be working fine and performs very well…
 *     ```
       a#mobile-menu-btn{
           display: block;
           position: absolute;
           right: 0;
           width: 30px;
           height: 22px;
           margin: 0 30px 0;
           padding: 0;
           background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="9.125" height="9.137" viewBox="4.437 4.431 9.125 9.137"><path d="M9.282 8.712h4.125c.12 0 .155.047.155.168v.252c0 .12-.035.154-.155.154H9.282v4.127c0 .12-.036.155-.156.155h-.252c-.12 0-.156-.037-.156-.156V9.286H4.593c-.12 0-.156-.035-.156-.154V8.88c0-.12.036-.168.156-.168h4.125V4.585c0-.107.037-.154.156-.154h.252c.12 0 .156.05.156.156v4.126z"/></svg>') 0 0 no-repeat;
           background-size: contain;
           text-decoration: none;
           text-indent: -9999em}
       ```
   
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years ago](https://wordpress.org/support/topic/autoptimize-breaks-inline-svg/#post-6291816)
 * and do you have the option “Generate data: URIs for images” active? If so, can
   you disable and report back if that solves the issue (still a bug, mind you, 
   but helps me pinpoint it).
 * frank
 *  Thread Starter [davitz](https://wordpress.org/support/users/davitz/)
 * (@davitz)
 * [11 years ago](https://wordpress.org/support/topic/autoptimize-breaks-inline-svg/#post-6291819)
 * Good Morning, Frank
    Thanks mich die the quick reply!
 * No, this Option isn’t active…
 * Regards
 * David
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years ago](https://wordpress.org/support/topic/autoptimize-breaks-inline-svg/#post-6291828)
 * Morning David;
    I’m leaving on holiday today, but I’ll look into this upon my
   return.
 * kind regards,
    frank
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/autoptimize-breaks-inline-svg/#post-6292049)
 * Sorry this took this long David, busy times … 🙂
 * After doing some tests I can confirm this is a bug in the CSS minifier component
   AO uses for which [I created a ticket on the GitHub page of said component](https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/issues/25).
 * As a temp workaround you could exclude the CSS that has the inline SVG (you could
   move that specific code inline in the HTML or into a seperate file, so you’d 
   only have that excluded).
 * frank

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Autoptimize breaks inline SVG’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [inline svg](https://wordpress.org/support/topic-tag/inline-svg/)

 * 4 replies
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/autoptimize-breaks-inline-svg/#post-6292049)
 * Status: not resolved