Upload works - Import from wxr not

We're updating several sites with a new page, imported from a wxr file. Page, included form, jpg, png - all work fine but SVG not so much.

I've checked scripts that add svg to allowed mime, ($mimes['svg'] = 'image/svg+xml';$mimes['svg'] = 'image/svg'; etc)

I've testet plugins (safeSvg, Disable Real MIME Check)

I've even added define( 'ALLOW_UNFILTERED_UPLOADS', true ); into wp-config!

Same result - every time: "unable to import."

But regular upload works.

Any Ideas how to solve this?


1 Answer 1


Found my solution after a little more digging.

The problem lies in wordpress-importer

Found this from jan 30 on github:


Then later the solution here:


"the WordPress Importer plugin is not compatible with remote servers that use HTTP compression."

For WordPress v4.6 and above, please use the following:

add_filter( 'http_request_args', function( $r, $url ) { $r['headers']['Accept-Encoding'] = 'identity'; return $r; }, 10, 2 );

This solved the upload issue, and the plugin "SafeSvg" made the svg's show up in the media library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.