PHPackages                             soderlind/vmfa-rules-engine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. soderlind/vmfa-rules-engine

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

soderlind/vmfa-rules-engine
===========================

Rule-based automatic folder assignment for media uploads

1.7.2(2mo ago)1366↑86.7%[14 issues](https://github.com/soderlind/vmfa-rules-engine/issues)[14 PRs](https://github.com/soderlind/vmfa-rules-engine/pulls)GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Jan 16Pushed 1mo agoCompare

[ Source](https://github.com/soderlind/vmfa-rules-engine)[ Packagist](https://packagist.org/packages/soderlind/vmfa-rules-engine)[ Fund](https://paypal.me/PerSoderlind)[ RSS](/packages/soderlind-vmfa-rules-engine/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (22)Versions (64)Used By (0)

Virtual Media Folders Rules Engine
==================================

[](#virtual-media-folders-rules-engine)

[![Try in WordPress Playground](https://camo.githubusercontent.com/fea5e87d0191ae2926c8a449513ed0686cf239f31b0fd24b055cbb274cf61576/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545322539362542365f5472795f696e5f576f726450726573735f506c617967726f756e642d626c75653f7374796c653d666f722d7468652d6261646765)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/soderlind/vmfa-rules-engine/main/.wordpress-org/blueprints/blueprint.json)

Rule-based automatic folder assignment for media uploads. Add-on plugin for [Virtual Media Folders](https://wordpress.org/plugins/virtual-media-folders/).

    vmfa-rules-engine.mp4    [Requirements](#requirements) | [Installation](#installation) | [Usage](#usage) | [Organizing a Photo Library](#organizing-a-photo-library)

Description
-----------

[](#description)

Turn "Default folder for uploads" into a powerful rule system. Automatically assign media to folders based on:

- **Filename patterns** — Match filenames using regular expressions (e.g., `^IMG_`, `^DSC`, `screenshot.*`)
- **MIME type** — Sort by file type (images, videos, PDFs, etc.)
- **Image dimensions** — Organize by resolution (HD, 4K, thumbnails)
- **File size** — Separate large files from small ones
- **EXIF camera model** — Group photos by device (iPhone, Canon, etc.)
- **EXIF date taken** — Organize by capture date
- **EXIF aperture, focal length, ISO, shutter speed, orientation** — Fine-grained camera settings
- **IPTC keywords, credit, caption, copyright, title** — Match any embedded metadata field
- **Upload author** — Assign based on who uploaded the file

### Features

[](#features)

- **Multiple rules with priority** — Create as many rules as needed, drag to reorder
- **Stop after first match** — Control whether to continue evaluating rules
- **AND logic** — All conditions in a rule must match
- **Automatic on upload** — New uploads are processed instantly
- **Scan existing media** — Apply rules to your existing library with preview
- **WP-CLI compatible** — Rules apply to imports via `wp media import`
- **Modern React UI** — Consistent with WordPress admin design

Requirements
------------

[](#requirements)

- WordPress 6.8+
- PHP 8.3+
- [Virtual Media Folders](https://wordpress.org/plugins/virtual-media-folders/) plugin (parent plugin)

Installation
------------

[](#installation)

Recommended: Use the [Add-On Manager](https://github.com/soderlind/vmfa) to install the add-on.

Manual installation:

1. Download [`vmfa-rules-engine.zip`](https://github.com/soderlind/vmfa-rules-engine/releases/latest/download/vmfa-rules-engine.zip)
2. Upload via `Plugins → Add New → Upload Plugin`
3. Activate via `WordPress Admin → Plugins`

Plugin [updates are handled automatically](https://github.com/soderlind/wordpress-plugin-github-updater#readme) via GitHub. No need to manually download and install updates.

Usage
-----

[](#usage)

1. Go to **Media → Rules Engine** in the WordPress admin
2. Click **Add Rule** to create your first rule
3. Configure conditions and select a target folder
4. Enable the rule and save
5. New uploads will automatically be assigned to folders based on your rules

### Scanning Existing Media

[](#scanning-existing-media)

1. Click **Scan Existing Media** to preview what changes would be made
2. Review the preview and select items to process
3. Click **Apply Changes** to assign folders

Organizing a Photo Library
--------------------------

[](#organizing-a-photo-library)

The condition type selector groups conditions into **General**, **EXIF**, and **IPTC / XMP**, making it straightforward to build rules around embedded photo metadata.

### EXIF conditions

[](#exif-conditions)

ConditionFieldExample useCamera model`exif_camera`Separate iPhone shots from DSLR shotsDate taken`exif_date`Archive by year or shoot dateAperture (f-number)`exif_aperture`Isolate wide-open portraits (f/1.4 – f/2.8)Focal length`exif_focal_length`Group wide-angle vs telephoto shotsISO sensitivity`exif_iso`Flag high-ISO / low-light images for reviewShutter speed`exif_shutter_speed`Find motion-frozen or long-exposure shotsOrientation`exif_orientation`Separate portrait vs landscape imagesAperture, focal length, ISO, and shutter speed all support comparison operators (`>`, `>=`, `
