跳到内容

OH MY SVG

v1.5.0

Erik · 2022年7月26日 上架

Unlock the magic of your website with the SVG block. Out-of-the-box security, dual storage modes, and turbocharged speed optimization!

正在使用
200+
评分
暂无
累计下载
3,975
最近更新
2026年4月25日
需要 WordPress 5.7+已测试到 6.9.12PHP 7.1+

贡献者

截图

Svg edit capabilities
Svg edit capabilities
Svg as icon (link, alignment)
Svg as icon (link, alignment)

Enhance your WordPress website with the power of SVG images using the OH MY SVG plugin. Easily add, manipulate, and optimize SVG images directly within the Gutenberg block editor.

Unlike traditional image blocks, this plugin provides an intuitive interface that allows you to incorporate SVG icons, illustrations, or HTML snippets effortlessly. Experience the convenience of automatic markup sanitation, SVGO optimization, and a range of built-in utilities like color customization, stroke adjustments, and element stripping.

🌟 Smart Dual Storage Modes (New!)

One of the biggest issues with using SVGs in WordPress is database bloat. If you paste a heavy SVG directly into the editor, its entire XML markup gets saved into every single post revision, quickly cluttering your database. OH MY SVG solves this by offering two distinct storage modes:

  1. Inline Mode (Best for tiny icons): The SVG markup is embedded directly within the page’s HTML. This drastically reduces page load time by eliminating server requests and conserving bandwidth. Ideal for small, lightweight vectors.
  2. Media Library Mode (Best for heavy illustrations): To prevent database bloat, this mode saves the SVG behind the scenes as a custom post meta attached to the WordPress Media Library. The plugin automatically generates a lightweight PNG proxy image so you can see it in your media grid. On the front end, it renders cleanly using a data URI, keeping your post content light, your database clean, and your page performance high.

Unleash your creativity with endless possibilities—animate SVGs using CSS or JavaScript, modify inner colors, and scale infinitely without losing sharpness.

Svg are awesome because:

  • ✌️ Pixel Perfect: SVGs render sharply on any screen and resolution.
  • 🗄️ Zero Database Bloat: Choose to link heavy SVGs to the Media Library, keeping your post content and revisions lightweight.
  • 🎨 In-Editor Editing: Customize colors, add strokes, and remove fills to create variations directly in Gutenberg.
  • ⚡ Performance Boost: Use inline SVGs to save dozens of HTTP requests and reduce server download bandwidth.
  • 🛠️ Built-in Optimizer: Automatically compress and optimize markup using the integrated SVGO tool.
  • 🎉 Developer Friendly: Easy to animate with CSS and JavaScript since they render as DOM elements or standard image tags.

🔒 Security First

The OH MY SVG plugin prioritizes your website’s security. By default, WordPress blocks raw SVG file uploads due to severe XML/XSS vulnerabilities. This plugin keeps that protection intact. Instead of allowing dangerous direct .svg uploads, our plugin safely processes the SVG markup within the editor using a robust JavaScript purifier (DOMPurify). When saving to the Media Library, it creates a harmless PNG proxy file and securely stores the sanitized SVG string as an attachment metadata field. SVGs cannot be maliciously uploaded from the website “side” (e.g., frontend forms); only trusted users with editor permissions can include them.

Inspirations, links

Resources

Contribute

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it’s:

  • Reporting a bug
  • Discussing the current state, features, improvements
  • Submitting a fix 💯 or a new feature 🎉

We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.
By contributing, you agree that your contributions will be licensed under its GPLv3 License.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums