How to Allow SVG Uploads in WordPress (Safely)

How to Allow SVG Uploads in WordPress (Safely)

WordPress blocks SVG uploads by default. Here is a copy-paste PHP snippet that allows SVG for admins only, fixes the “not allowed” error and shows SVG previews in the Media Library.

Let's build something great

Have a Project in Mind?

Send a quick inquiry and I'll get back to you as soon as possible — usually within a day.