Skip to content
Sign in

Easy SVG

Upload SVG files safely: every file is cleaned before it is stored.

Not scanned yet WordPress plugin 40k installs

Install in

No install steps yet

Follow the steps on the source page.

Need more icon sets, templates and integrations? Easy SVG Pro builds on this plugin.

Built for developers: the documentation covers every feature, and the API reference explains functions, hooks and the REST API.

Easy SVG lets you upload SVG files to WordPress safely and use them like any other image. On WordPress 7.1 and newer it is also your icon library for the Icon block.

SVG files stay sharp at every size and are tiny on disk. WordPress still refuses them, and for a good reason. SVG is not a picture format like PNG or JPEG. It is XML, and an SVG file can carry scripts, event handlers and links to other servers.

Easy SVG cleans every file with the maintained enshrined/svg-sanitize library before it is stored, and a file that cannot be cleaned is refused. Then you use SVGs like any other image: in the block editor, as a featured image, in galleries and in custom fields.

Add your own icons once, pick them in the Icon block, or print them with a shortcode or one line of PHP. The icons live in the plugin, not in your theme, so they stay when you change theme or page builder.

Easy SVG has run on WordPress sites since 2017 and is active on more than 40,000 of them. It sends nothing to other servers, tracks nothing and loads no scripts on your front end.

Safe uploads, on every way in

  • Cleaned before it is stored. Scripts, event handlers, javascript: links and references to other servers are removed. A broken or empty file is refused.
  • Every way a file arrives. The media uploader, the block editor, the REST API, WP-CLI wp media import, media_sideload_image() and importers. XML-RPC uploads are accepted only when the file is already clean.
  • A safety net. Every new SVG attachment is checked once more when it is created. A file that cannot be cleaned is removed again.
  • The server decides the file type. What the browser claims does not count, so a renamed file cannot slip through.
  • Real sizes in the media library. Width and height are read from the file, also when it only has a viewBox, so an SVG never shows as 0 by 0.
  • A size limit. Up to 2 MB per file, or less when your server’s upload limit is lower.
  • Multisite aware. On a network, SVG is offered only where the network’s “Upload file types” setting includes it.

SVG uploads, cleaning and the size limit are always on. They are the safety, not features you switch off.

Your own icons in the Icon block

The icon library is off until you switch on “Manage icons” under Easy SVG, Settings. A fresh install adds only safe SVG uploads.

  • Add icons your way. Choose files or drop up to 100 at once, pick SVGs from the media library, or paste SVG code and see a preview and a list of what will be removed before you save.
  • Pick them in the Icon block. On WordPress 7.1 and newer your icons appear in the Icon block under “Easy SVG”, next to the icons WordPress brings.
  • Use them anywhere. Copy an icon as PHP, shortcode or block. easy_svg_icon() and the [easy_svg_icon] shortcode print it in templates and content, 1em square by default, so it follows the text around it.
  • Keep the library tidy. Search, rename, switch off, download and delete icons, one at a time or several at once. A renamed icon keeps its address, so pages that use it do not break.
  • Hardened on every page. An icon is cleaned when it is added, and hardened again each time it is printed into a page.
  • Accessible. A decorative icon is hidden from screen readers. An icon with a meaning is announced with its name. The screens work by keyboard.
  • Icons stay visible. When an add-on that placed icons on your pages is switched off, those icons keep showing.

Small and quiet

  • One Easy SVG menu with Icons, Tools and Settings.
  • No tracking, no external requests, no scripts on your front end.
  • A support report under Easy SVG, Tools, ready to paste into a support request. Keys, tokens and e-mail addresses are left out.
  • Translation-ready, with German included.

Easy SVG Pro

Everything above is free and stays free. Easy SVG Pro is a paid add-on by UnleashWP for agencies and freelancers who build sites for clients. It keeps one icon set per client that works in every theme and plugin and moves to the next site in one click. It adds an icon field for PHP-only blocks, brings your icons into ACF, Meta Box, Elementor, WPBakery, Avada and other builders, and exports a set as a file, a link or a plugin. It needs WordPress 7.1 and PHP 8.2.

See Easy SVG Pro and its prices

For developers

The sanitizer removes every tag and attribute that is not on its allow-list. Two filters let you extend that list for your site. Only add what you need: every addition is something an uploaded file may then contain.

Allow additional tags with esw_svg_allowed_tags:

add_filter(
    'esw_svg_allowed_tags',
    function ( $tags ) {
        $tags[] = 'feDropShadow';
        return $tags;
    }
);

Most drawing elements are already on the list, so you rarely need this. feDropShadow, the shadow some design tools export, is one that is not. Never add script, foreignObject, or the animation elements (animate, set, animateTransform, animateMotion): the list only decides which names may appear, it does not check what their attributes point at, so those elements can put back the very things the sanitizer is there to remove. style is allowed by default: in an uploaded file shown as an image its CSS stays inside the SVG, remote references in it are removed, and icons placed inline in a page lose it. Do not print an uploaded SVG’s markup into a page yourself; use easy_svg_icon() so it is hardened first.

Allow additional attributes with esw_svg_allowed_attributes:

add_filter(
    'esw_svg_allowed_attributes',
    function ( $attributes ) {
        $attributes[] = 'focusable';
        return $attributes;
    }
);

External references, for example a stylesheet, image or font loaded from another server, are removed by default. A site that needs them can keep them with esw_svg_remove_remote_references:

add_filter(
    'esw_svg_remove_remote_references',
    '__return_false'
);

Add-ons can call easy_svg_sanitizer() to clean markup exactly the way the site does. See the FAQ for details.

Credits

Easy SVG is built on these open source projects. Thank you.

Written by Joobi from the project's own listing. See the source page

icon-blockiconssanitizeSVGsvg upload
25 Nov 2026
Version 5.0.1 released. Not scanned yet.

5.0.1 (2026-11-25)

  • Changed: the plugin is called Easy SVG everywhere.
  • Changed: in a set, the icons in use come first.
  • Changed: the library’s notice leaves after 3 seconds and stays while the pointer or the keyboard focus is on it. After a delete it could stay on screen for good.
  • Security: an icon on the page and in the preview loads nothing from another server, also through fill, mask, filter or marker.
  • Security: icons whose name could break the copied code get no copy buttons.
  • Performance: icons kept from a switched-off add-on load as one cached file instead of inline CSS on every page.
  • For developers: a size that has no effect says why in the debug log (WP_DEBUG).
  • Docs: the FAQ shows how to protect the icon files on nginx.
  • Updated: DOMPurify 3.5.0.

5.0.0 (2026-11-25)

  • New: an icon library for the Icon block (WordPress 7.1 and newer). Upload SVGs, drop them onto the library, paste SVG code or pick them from the media library. Every icon is cleaned on the way in, exactly as an upload is.
  • New: one Easy SVG menu with Icons, Tools and Settings.
  • New: search, rename, switch off and delete icons, also several at once. A renamed icon keeps the address a template already uses.
  • New: deleted icons go to a Trash in the library. Restore them there or delete them for good, which leaves nothing on the server.
  • New: easy_svg_icon() and a shortcode print an icon anywhere, 1em square by default and sized with size or --easy-svg-icon-size. The icon takes the colour of the text around it.
  • New: easy_svg_icon() also draws icons from WordPress’s own icon registry.
  • New: the editor says so when an Icon block points at an icon that is no longer there.
  • Security: an uploaded SVG loses expression(), behavior, -moz-binding and any url() that is not a link into the file, a relative path or http(s), such as javascript: and data:, in its styles.
  • Security: title and description inside an SVG are checked in any letter case, so markup hidden in them is removed.
  • Security: an icon is hardened again each time it is printed, and a style in it keeps only how the drawing is painted, so a stored icon cannot bring a script onto the page or be styled to cover it.
  • Security: a refused SVG leaves no file in the uploads folder, and icon folders cannot be listed.
  • Changed: External references in uploaded SVGs are now removed by default; filter esw_svg_remove_remote_references restores the old behavior.
  • Changed: the icon library is off until you switch it on under Easy SVG, Settings. Safe SVG uploads are always on.
  • Changed: on multisite, SVG is offered only where the network’s “Upload file types” includes it, and the icon library follows the same list.
  • Fixed: an SVG that only has a viewBox gets its real width and height in the media library and the Image block instead of 0x0.
  • Fixed: icons drawn with strokes show in the Icon block instead of an empty box.
  • Fixed: two copies of the same icon on one page no longer share a filter or a gradient.
  • Accessibility: the screens work by keyboard, show a focus ring everywhere, and screen readers read each setting’s description.
  • German: formal, Austrian and Swiss sites get the German translation too.
  • Note: updating does not re-check SVGs already in your media library. Re-upload anything added before this version if you are unsure about it.
  • For add-on authors: easy_svg_sanitizer(), EASY_SVG_API, EASY_SVG_PANEL_API and EASY_SVG_ICONS_API, with the hooks documented in the FAQ.

4.2.2

  • Security: SVG files are sanitized on every upload path, including REST uploads of raw data, WP-CLI, XML-RPC and importers.

4.2.1

  • Maintenance release so the 4.2 security update reaches every site through the WordPress update check. No code changes.

4.2

  • Security: the bundled sanitizer (enshrined/svg-sanitize) is updated to 1.1.1. It fixes a stored XSS via DTD entities, a crash on DTD attribute declarations and a mixed case xlink:href bypass of the <use> nesting check, among the published advisories GHSA-9rjx-3jch-6vjf, GHSA-m9xh-6747-9r6f, GHSA-v383-3rw5-q8rf, GHSA-qhmf-972w-m957 and GHSA-3vh3-jf65-656w.
  • Security: SVG files with an internal DTD (custom entities) are refused. A standard DOCTYPE is still removed and the file is accepted.

4.1

  • Security: server-side SVG file type detection; every genuine SVG upload is sanitized, and spoofed uploads are rejected.
  • Updated SVG sanitizer.
  • Code quality improvements for the WordPress plugin guidelines.

4.0

  • Updated SVG sanitizer.
  • Compatibility with the current WordPress version.

3.9

  • Updated SVG sanitizer and license.
  • Compatibility with WordPress 6.8.

3.8

  • Security fix for the image uploader. Props to Francesco Carlucci and Wordfence.
  • Requires PHP 8.0 and WordPress 6.0 or newer.

Older versions: see the “Advanced View” of this plugin on WordPress.org.

28 Nov 2017Listed on Joobi from WordPress.org.

Follow this listing's changes (Atom feed)