Back to plugin directory
#57 rankedTier S

Safe SVG

By 10up

View on WordPress.org
Active installs1M+
WP Rank score94.0
Rating4.9 / 5
Reviews79
Version2.5.2
Last updatedOct 26, 2026

Overview

This plugin sanitizes SVGs on common WordPress upload routes and adds previews in the Media Library. Uploads through custom routes may not receive the same sanitization, so sites should account for how their themes and plugins handle files.

Safe SVG is ranked #57 among WordPress.org plugins by WP Rank with a score of 94.0. It has 1,000,000+ active installs and 14,833,648 total downloads. Users rate it 4.9 out of 5 across 79 reviews. It was downloaded 445,519 times in the last 15 days. The latest release (2.5.2) was published on Oct 26, 2026. It is tested up to WordPress 7.1.4 and requires PHP 7.4.

Install Trend

Based on the last 15 days of WordPress.org download stats.

445,519 downloads (15d)
10-2310-2410-2510-2610-2710-2810-2910-3010-3111-0111-0211-0311-0411-05
Safe SVG

Compatibility

Requires WordPress6.9
Tested up to7.1.4
Requires PHP7.4
AddedJul 3, 2015

Description

SVG sanitization covers standard WordPress upload paths

Safe SVG sanitizes SVGs on common WordPress upload and sideload routes, but not every route a site may use.

It hooks into standard upload actions to sanitize files before they are accepted. WordPress also allows plugins and themes to create custom upload actions, which Safe SVG cannot cover in advance.

The plugin does not globally enable SVG uploads because doing so could allow SVGs through paths that bypass sanitization. Sites using custom upload routes should check whether those routes sanitize SVGs; otherwise, unsafe files could reach the site.

Media previews, upload permissions and SVG handling options

Safe SVG adds practical media-library controls, with several behaviors managed through filters.

  • Media Library previews: SVGs appear in all Media Library views, helping users identify files before selecting them.
  • Upload permissions: Choose which users can upload SVGs, or allow uploads from anyone; restrict access if SVG uploads should be limited to trusted users.
  • SVGO optimization: Optimization is off by default and can be enabled with the safe_svg_optimizer_enabled filter.
  • Allowed tags and attributes: The svg_allowed_tags and svg_allowed_attributes filters let developers adjust which SVG elements and attributes are permitted.
  • Inline SVG styling: SVGs containing their own `` element use a shadow root to isolate those styles from the page. Inherited properties and CSS custom properties still work, but theme stylesheets cannot reach into the shadow root. The safe_svg_inline_use_shadow_dom filter disables isolation, with the trade-off that SVG styles may affect the rest of the page.

A widely adopted plugin with an important upload-path caveat

Safe SVG is a strong fit for sites that need SVG uploads and clear previews in the Media Library, especially when uploads follow standard WordPress routes.

Its adoption is among the highest in the directory, its rating is excellent across a moderate number of reviews, and it was updated within the last week. There are no open support threads. The main trade-off is coverage: sites with custom upload actions should verify those paths are secured before relying on SVG uploads.