import svg-files from wxr – (upload works, import not)

Found my solution after a little more digging.

The problem lies in wordpress-importer

Found this from jan 30 on github:

https://github.com/WordPress/wordpress-importer/issues/47?_pjax=%23js-repo-pjax-container

Then later the solution here:

https://www.playnicetogether.com/2015/11/07/wordpress-importer-plugin-content-length-problem-solved/

“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.