Loading...
banner plugin Image
woo-image

Safe SVG

By 10up

Description

Safe SVG is the best way to allow SVG uploads in WordPress. It gives you the ability to allow SVG uploads whilst making sure that they are sanitized to stop SVG/XML vulnerabilities affecting your site. It also gives you the ability to preview your uploaded SVGs in the media library in all views.

Current features include sanitised SVGs to prevent security holes, SVGO optimisation to save space, and the ability to restrict SVG uploads to certain users. This plugin ensures that your WordPress site remains secure while enabling the use of SVG files.

Other Notable Features

Here are a few other notable features of this free Safe SVG plugin.

check-fill
SVG uploads
check-fill
SVG sanitization
check-fill
media library

FAQ

Yes, this can be done using the svg_allowed_attributes and svg_allowed_tags filters.
They take one argument that must be returned. See below for examples:

add_filter( 'svg_allowed_attributes', function ( $attributes ) {      // Do what you want here...      // This should return an array so add your attributes to     // to the $attributes array before returning it. E.G.      $attributes[] = 'target'; // This would allow the target="" attribute.      return $attributes; } );   add_filter( 'svg_allowed_tags', function ( $tags ) {      // Do what you want here...      // This should return an array so add your tags to     // to the $tags array before returning it. E.G.      $tags[] = 'use'; // This would allow the <use> element.      return $tags; } ); 

Contributors and developers

“Safe SVG” is open source software. The following people have contributed to this plugin.

WPS
Exclamation-Image

6.99

Average

Star-Image

Ratings

4.9 out of 5 | 76
History-Image

Version

2.4.0
calendar-Image

Last updated

3 weeks ago
Star-Image

Active installations

1,000,000+
Star-Image

WordPress version

6.9 or higher
php-Image

PHP version

7.4 or higher
translate-Image

Languages

30

Tags

Media,Mime,Security,SVG,Vector