Settings & Configuration
Global settings live in the media_settings singleton rendered inline across 6 tabs under Setup > Media > Settings. Storage disks, CDN templates, and responsive delivery options can also be declared in site/config.php via $config->media.
Tab 1: Storage & Disks
Section titled “Tab 1: Storage & Disks”| Setting | Type | Default | Description |
|---|---|---|---|
default_disk |
combobox |
public |
Default target storage disk for new public library uploads. |
delete_policy |
segmented |
block |
block prevents deleting assets referenced by Pages, Entries, or Tiptap; warn allows deletion after confirmation. |
disks |
blocks (media_disk_config) |
[] |
Repeatable Flysystem v3 remote disks (s3 for AWS S3/R2/Spaces/MinIO/B2, sftp, ftp/ftps) or extra local volumes. Secret keys and passphrases are write-only. |
cdn_url_templates |
keyvalue |
{} |
Optional per-disk zero-CPU CDN transform URL templates. |
Tab 2: Uploads & Privacy
Section titled “Tab 2: Uploads & Privacy”| Setting | Type | Default | Description |
|---|---|---|---|
allowed_extensions |
tags |
jpg jpeg png gif webp avif pdf ... |
Permitted file extensions for library uploads. |
allowed_mimes |
tags |
"" |
Optional explicit MIME allowlist override. |
allow_svg |
toggle |
0 |
Opt-in sanitized SVG uploads (rejects scripts, DOCTYPE/ENTITY, event handlers, and unsafe links). |
strip_exif |
toggle |
1 |
Strips GPS and camera EXIF headers from public uploads after auto-orienting pixels. |
auto_generate_crops |
toggle |
0 |
Pre-generates presets marked auto_generate immediately on upload. |
max_upload_mb |
integer |
50 |
Maximum file size per library upload (1 to 2048 MB). |
client_resize_enabled |
toggle |
0 |
Enables default browser-side image resizing before upload transfer. |
client_max_width |
integer |
2560 |
Default browser resize maximum width (320 to 8192 px). |
client_max_height |
integer |
2560 |
Default browser resize maximum height (320 to 8192 px). |
client_quality |
range |
85 |
Default browser JPEG/WebP compression quality (50 to 100%). |
client_convert_webp |
toggle |
0 |
Converts resized browser uploads to WebP before transfer. |
keep_file_revisions |
toggle |
0 |
Archives previous physical file versions under _revisions/ on replace for 1-click rollback. |
max_file_revisions |
integer |
5 |
Maximum archived revisions retained per asset (1 to 50). |
Tab 3: Naming & Paths
Section titled “Tab 3: Naming & Paths”| Setting | Type | Default | Description |
|---|---|---|---|
upload_path_mode |
segmented |
date_uuid |
Immutable date_uuid (YYYY/MM/{uuid}/{file}) or context_path (pages/... / entries/...). |
upload_folder_mode |
segmented |
field_or_root |
field_or_root (field default folder or root) or auto_context (automatic folder by template or entry type). |
rename_enabled |
toggle |
0 |
Enables automatic upload filename renaming via UploadNameFormatter. |
rename_default_format |
text |
"" |
Default filename pattern using tokens ({original}, {name}, {title}, {template}, {type}, {field}, {folder}, [Y-m-d], randstring[n], ###). |
rename_max_length |
integer |
0 |
Optional word-boundary maximum filename length (0 to 180; 0 means unlimited). |
rename_rules |
blocks (media_rename_rule) |
[] |
Ordered rules scoped by source (page, entry, library), template/type, field name, and file extensions. |
Tab 4: Crops & Watermark
Section titled “Tab 4: Crops & Watermark”| Setting | Type | Default | Description |
|---|---|---|---|
image_driver |
segmented |
auto |
Intervention Image v4.4 driver (auto: Vips -> Imagick -> GD, vips, imagick, gd). |
delayed_transforms |
toggle |
0 |
Defers crop generation until first request (status = 'pending') via 404 handler or /_media/transform/.... |
responsive_webp |
toggle |
0 |
Automatically emits <source type="image/webp"> in render() and attrs(). |
responsive_avif |
toggle |
0 |
Automatically emits <source type="image/avif"> in render() and attrs(). |
responsive_factors |
text |
0.5,1,1.5,2 |
Comma-separated scale multipliers for ratio-preserving srcset candidates. |
responsive_widths |
text |
400,800,1200,1600 |
Fallback pixel widths when no explicit target width is supplied. |
inline_lazyload |
toggle |
0 |
Injects minimal prefers-reduced-motion-aware CSS/JS fade-in only on pages containing media-lazyload images. |
watermark_asset_id |
m2o (media) |
"" |
Transparent PNG/WebP asset applied to watermark-enabled crop presets. |
watermark_position |
segmented |
bottom-right |
top-left, top-right, center, bottom-left, or bottom-right. |
watermark_opacity |
range |
50 |
Watermark opacity percentage (1 to 100). |
Tab 5: Stock Media & Labels
Section titled “Tab 5: Stock Media & Labels”| Setting | Type | Default | Description |
|---|---|---|---|
unsplash_access_key |
secret |
"" |
Server-side Unsplash API access key (write-only). |
pexels_api_key |
secret |
"" |
Server-side Pexels API key (write-only). |
pixabay_api_key |
secret |
"" |
Server-side Pixabay API key (write-only). |
color_label_names |
keyvalue |
{} |
Custom display labels for the 7 color dots (red, orange, yellow, green, blue, purple, gray). |
Tab 6: Shares & Security
Section titled “Tab 6: Shares & Security”| Setting | Type | Default | Description |
|---|---|---|---|
share_max_zip_files |
integer |
200 |
Maximum assets allowed in a public gallery ZIP download (1 to 5000). |
share_max_zip_bytes |
integer |
1073741824 |
Maximum uncompressed bytes per ZIP download (1 GiB). |
share_rate_limit |
integer |
10 |
Failed password unlock attempts allowed per IP per 15 minutes (1 to 1000). |
trash_retention_days |
integer |
0 |
Daily scheduled auto-purge window for trashed assets (0 disables automatic purge). |
Code & Environment Configuration ($config->media)
Section titled “Code & Environment Configuration ($config->media)”Declare environment-specific storage disks, CDN templates, and responsive delivery overrides directly in site/config.php without storing secrets in the database. Settings declared in $config->media take precedence over media_settings:
<?php
declare(strict_types=1);
namespace ProcessWire;
$config->media = [ 'default_disk' => 'r2_public', 'disks' => [ 'r2_public' => [ 'driver' => 's3', 'endpoint' => 'https://<account>.r2.cloudflarestorage.com', 'region' => 'auto', 'bucket' => 'media-assets', 'access_key' => (string) getenv('R2_ACCESS_KEY'), 'secret_key' => (string) getenv('R2_SECRET_KEY'), 'cdn_url' => 'https://cdn.example.com', 'is_public' => true, 'path_style' => true, 'transform_mode' => 'cdn_template', 'cdn_template' => 'https://cdn.example.com/cdn-cgi/image/width={width},height={height},fit=cover,format={format}/{path}?v={version}', ], ], 'delayed_transforms' => true, 'responsive_webp' => true, 'responsive_avif' => false, 'responsive_factors' => '0.5,1,1.5,2', 'responsive_widths' => '400,800,1200,1600', 'inline_lazyload' => true, 'csp_nonce' => '',];