A powerful WordPress plugin that enables SVG uploads and provides advanced features for working with SVG files in WordPress.
⚠️ Development Repository NoticeThis is the latest development version of SVG Support. Code here may be unstable during active development. For production sites, please use the official release from the WordPress.org plugin repository.
The official plugin is managed via SVN as per WordPress.org standards. This GitHub repository serves as a development workspace and for issue tracking. Once changes are stable, they will be copied to the SVN repository for release.
SVG Support allows you to securely upload SVG files to your WordPress Media Library and use them like any other image, with additional features for inline rendering, styling, and animation.
- SVG Upload Support: Easily upload SVG files to your media library
- Automatic Sanitization: All SVG uploads are sanitized by default for security
- Minification Options: Reduce SVG file sizes with optional minification
- Inline Rendering: Render SVG code inline by adding the
"style-svg"
class - Role-Based Control: Restrict SVG upload capabilities to specific user roles
- Custom Target Class: Define your own CSS class for targeting SVGs
- Featured Image Support: Special handling for SVG files as featured images
- Advanced Mode: Toggle advanced features for more control
- Install through the WordPress plugin repository or upload to your
/wp-plugins/
directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to "Settings > SVG Support" to configure the plugin
Once activated, you can upload SVG files to your media library like any other image file.
To render an SVG inline (enabling CSS/JS targeting of internal elements):
<img class="style-svg" alt="alt-text" src="image-source.svg" />
Or with a custom class:
<img class="your-custom-class" alt="alt-text" src="image-source.svg" />
SVG Support takes security seriously and provides several features to ensure safe SVG handling:
- Sanitization by default (since v2.5.8)
- Role-based upload restrictions
- Optional sanitization bypass for trusted users
- Secure file handling through WordPress APIs
This is the development repository for SVG Support. The official release version is maintained on WordPress.org's SVN repository.
Want to try it out? Spin up a test site instantly: Click here to create a test site with SVG Support pre-installed
Contributions are welcome! Feel free to:
- Submit bug reports or feature requests through the issue tracker
- Create pull requests for bug fixes or new features
- Help with translations through WordPress.org's translation platform
- For general support, please use the WordPress.org support forums
- For bug reports and feature requests, use the GitHub issues
This plugin is licensed under the GPL v2 or later.
Created and maintained by Benbodhi
If you find this plugin useful, please consider: