
Media and Safe SVG File Upload Rules by CodeCaste
v1.0.2CodeCaste · 2026年11月3日 上架
Control upload size limits, file types, image resolution, and safe SVG uploads across WordPress.
- 正在使用
- 10 以下
- 评分
- 暂无
- 累计下载
- 377
- 最近更新
- 2026年11月25日
需要 WordPress 6.0+已测试到 7.1.5PHP 7.4+
贡献者
截图
Media and Safe SVG File Upload Rules by CodeCaste lets you decide which files can be uploaded to your site and how big they can be. You set the rules once, and they are applied everywhere files can come in.
What you can do
- Set one size limit for all files. For example, nothing larger than 5 MB.
- Give a file type its own limit. For example, 2 MB for PNG, 50 MB for MP4 and 10 MB for PDF.
- Limit image resolution. Pick a preset such as HD, Full HD, QHD or 4K from a dropdown, or choose Custom to enter your own width and height. For example, no PNG larger than 1920 x 1080 px.
- Block a file type completely. Any file with that extension is refused, whatever its size.
- Allow SVG files safely. WordPress blocks SVG by default because SVG files can hide harmful code. Turn SVG on and the plugin cleans every SVG before it is saved.
- Clear error messages. When a file is refused, the person uploading sees the reason, such as the file being too large, too high-resolution, or its type being blocked.
Where the rules apply
Rules cover the Media Library, the block editor, REST API uploads and files WordPress downloads from a URL (sideloading). Uploading a plugin or theme ZIP is not affected.

