WP Manifestindependent plugin directory
manifest / media / wp-conditional-media-folder

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

Download source zip No release zip yet

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.zip
No 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

  1. Clone this repository into wp-content/plugins/.
  2. Run composer install (if dependencies are added later).
  3. Activate via WP Admin.

Configuration

Go to Settings > Conditional Media Folder.

  1. Custom Folder Path: Enter the absolute path (e.g., /var/www/static_assets/special).
  2. Custom Folder URL: Enter the public URL (e.g., https://cdn.mysite.com/special).
  3. Add Criteria: Add as many rule sets as needed.

License

MIT