CodeCaste Media and Safe SVG File Upload Rules
CodeCaste Media and Safe SVG File Upload Rules 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
CodeCaste Media and Safe SVG File Upload Rules 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.
- 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 or its type being blocked.
Where the rules apply
The same rules are used for:
- The Media Library and the “Add Media” button
- The WordPress REST API ( /wp/v2/media )
- Files added by importers and other code
- File manager plugins such as WP File Manager
- Other plugins that accept uploads in their own way, such as form builders and page builders
This means a file cannot slip past your limits just because it was uploaded through a different plugin. If you prefer not to check other plugins, you can turn that part off in the settings.
Why you might want this
- Stop very large files from filling up your hosting space.
- Stop team members or visitors from uploading file types you do not want.
- Use SVG logos and icons without opening your site to attacks.
- Keep all upload rules in one place instead of one setting per plugin.