跳到内容

SVG Enabler

v2.0.0

Optimist Hub · 2023年1月27日 上架

Safely upload SVG files to WordPress. Every SVG is sanitized to remove scripts, event handlers and remote references before it is stored.

正在使用
30+
评分
暂无
累计下载
3,462
最近更新
2026年10月5日
需要 WordPress 6.0+已测试到 7.1.5PHP 7.4+

SVG Enabler lets you upload SVG files to the WordPress media library while making sure each file is safe.

SVG is an XML format, which means it can carry JavaScript, event handler attributes, external references and XML entities. Uploading an unsanitized SVG is equivalent to allowing arbitrary HTML and JavaScript uploads. This plugin sanitizes every SVG during upload, before the file is written to your uploads directory.

What gets removed

  • <script> elements and inline JavaScript
  • Event handler attributes such as onload, onclick, onerror
  • javascript: URLs in links and attributes
  • <foreignObject> payloads
  • Remote references in <image>, <use>, href and xlink:href
  • Remote url() and @import rules inside <style> blocks
  • XML entities and DTD declarations (XXE)
  • CSS expression() and behavior: declarations

Features

  • SVG and SVGZ upload support
  • Sanitizes on upload, before the file reaches the uploads folder
  • Uses the actively maintained enshrined/svg-sanitize library (0.22.0+)
  • Correct image dimensions in the media library, editor and srcset
  • Works with the block editor, classic editor and featured images
  • Filterable allow-lists and capability requirements
  • No settings screen required, works out of the box

Plums

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

导航

说明

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

© 2026 Plums