• Hi,
    I have problem uploading .svg file (This file type is not allowed).

    I already added define('ALLOW_UNFILTERED_UPLOADS', true); in wp-config.php for .rar upload but it doesn’t work for .svg.

    Is there any solution without using plugin (I’d rather avoid additional plugins)?

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Don’t add that, as you re opening your site for tons of vulnarabilities. Rather use this plugin, it worked great out of the box for me.

    https://wordpress.org/plugins/svg-support/

    Thanks for suggesting my plugin @gnoric 🙂

    @darkko, I would suggest using a plugin as well, which will prevent you having to maintain the code.

    SVG Support plugin works great for uploading .svg file.

    Thanks for your support @sparxxrxs 🙂

    Thread Starter darkko

    (@darkko)

    Thank you all for plugin suggestion.
    I’ll use it if there is no other option, but I’ll rather keep numbers of plugins to minimum.

    @gnoric
    I deleted that line in my wp-config after uploading required files.

    Hi @darkko,

    There is a few things to consider when allowing uploads of SVG which is why I wrote my plugin. If you leave “Advanced Mode” off, then it runs barely any code and will not slow down your site at all… It doesn’t slow down your site with advanced mode either but you won’t need that unless you want to render the SVG code inline rather than in IMG tags, so you can keep the code base “slimmer”.

    You could also easily take the code from my plugin for just the mime type allow and put it in your functions file to avoid another plugin, but then you would need to do it for any theme you use in the future as well.

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

The topic ‘How to upload .svg file?’ is closed to new replies.