WP Conditional Media Folder
This WP Conditional Media Folder Wordpress plugin automatically saves uploaded media files to custom server directories based on configurable filename or MIME type rules while ensuring full integration and accessibility within the WordPress Media Library.
★ 0stars
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/botheory/wp-conditional-media-folder/archive/refs/heads/master.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
A WordPress plugin that conditionally saves media files to a custom folder based on filename or MIME type rules.
Features
- Custom Storage Path: Save files anywhere on the server filesystem (absolute path).
- Custom URL Mapping: Ensure files are served correctly by mapping the path to a URL.
- Advanced Rules Engine:
- Logic: Rules are processed with OR logic. Conditions within a rule use AND logic.
- Conditions:
- Filename starts with
- Filename ends with
- Filename contains
- Min filename length
- Max filename length
- MIME Type (e.g., image/jpeg, application/pdf)
- Seamless Integration: Files appear in the Media Library regardless of storage location.
Installation
- Clone this repository into wp-content/plugins/.
- Run composer install (if dependencies are added later).
- Activate via WP Admin.
Configuration
Go to Settings > Conditional Media Folder.
- Custom Folder Path: Enter the absolute path (e.g., /var/www/static_assets/special).
- Custom Folder URL: Enter the public URL (e.g., https://cdn.mysite.com/special).
- Add Criteria: Add as many rule sets as needed.