
mFilter
Faceted filtering for MODX 3 with SEO URL support


Tools for maintaining and optimizing mFilter.
Rebuilds filter indexes and cache.
When to use:
Action:
Maintenance → ReindexRemoves filter result cache.
When to use:
Action:
Maintenance → Clear cacheRecreates slugs for all filter values.
When to use:
Action:
Maintenance → Regenerate slugsUpdates URL router cache.
When to use:
Action:
Maintenance → Rebuild router| Metric | Description |
|---|---|
| Filter sets | Number of active sets |
| Bindings | Number of resource bindings |
| Slugs | Total slug count |
| SEO templates | Number of templates |
| Word forms | Number of word forms |
| Metric | Description |
|---|---|
| Cache entries | Cached result count |
| Cache size | Data size |
| Expired entries | Entries past TTL |
Runs via cron or on first request:
// Plugin on OnWebPageInit or cron script
$mfilter = $modx->services->get('mfilter');
$mfilter->cleanExpiredCache();| Setting | Description |
|---|---|
mfilter.cache_enabled | Enable caching |
mfilter.cache_ttl | Cache lifetime (seconds) |
Ensure all required indexes exist:
SHOW INDEX FROM modx_mfl_slugs;
SHOW INDEX FROM modx_mfl_cache;$mfilter = $modx->services->get('mfilter');
// Verify services load
$filter = $mfilter->getFilter();
$slugManager = $mfilter->getSlugManager();Enable debug for diagnostics:
System → System settings → mfilter.debug = YesLogs go to core/cache/logs/error.log.
Back up before maintenance:
-- Filter sets
SELECT * FROM modx_mfl_filter_sets INTO OUTFILE '/tmp/filter_sets.csv';
-- Slugs
SELECT * FROM modx_mfl_slugs INTO OUTFILE '/tmp/slugs.csv';
-- SEO templates
SELECT * FROM modx_mfl_seo_templates INTO OUTFILE '/tmp/seo_templates.csv';LOAD DATA INFILE '/tmp/filter_sets.csv' INTO TABLE modx_mfl_filter_sets;mfilter.cache_enabled// Enable profiling
$modx->setOption('mfilter.profile', true);
// After request, check time
$mfilter = $modx->services->get('mfilter');
$profile = $mfilter->getProfiler()->getReport();