WordPress Upload Size Limits
The {CODICTS} Upload Size Limits plugin lets administrators restrict file upload sizes on a per-user-role basis, with separate limits for images and videos. Control exactly how large a file each role can upload — for example, allow Administrators to upload up to 128 MB while limiting Subscribers to 2 MB.
Installation & Activation
Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.
After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.
Once activated, navigate to Settings → {CoDicts} Upload Size Limits to configure upload limits for each user role.
What This Plugin Solves
WordPress uses your hosting provider’s PHP configuration to determine the maximum upload size, and this limit applies equally to all users regardless of their role. There’s no built-in way to give Administrators a higher limit than Subscribers, or to set different limits for images versus videos.
This plugin solves that by letting you set independent upload size limits for each user role, with separate caps for image files and video/other files.
Important: This plugin can only set limits equal to or below your server’s maximum upload size. It cannot increase the server limit. If you need a higher server limit, contact your hosting provider to increase PHP’s
upload_max_filesizeandpost_max_sizevalues.
Key Features
| Feature | Description |
|---|---|
| Per-Role Limits | Set unique upload size limits for each WordPress user role (Administrator, Editor, Author, Contributor, Subscriber, and any custom roles). |
| Separate Image & Video Limits | Configure independent size caps for image files and video/other files per role. |
| Flexible Size Units | Choose between kB, MB, or GB for each limit. |
| Server Limit Display | Shows your hosting provider’s maximum upload size for reference so you know the upper bound. |
| Upload Blocking | Files that exceed the configured limit are rejected before processing, with a clear error message. |
| One-Click Reset | Reset all fields back to the server’s default maximum with a single click. |
How It Works
When a user uploads a file anywhere on your WordPress site (Media Library, post editor, frontend forms, etc.), the plugin intercepts the upload before WordPress processes it:
1. It detects whether the file is an image (JPEG, PNG, GIF, WebP, etc.) or a video/other file (MP4, PDF, ZIP, DOCX, etc.).
2. It looks up the uploading user’s WordPress role.
3. It checks the file size against the configured limit for that role and file type.
4. If the file exceeds the limit, the upload is blocked and the user sees an error message: “File size must be smaller than 10mb” (with the actual limit shown).
5. If the file is within the limit, the upload proceeds normally.
Note: The “Videos” limit applies to all non-image files, not just videos. This includes documents (PDF, DOCX), archives (ZIP), audio files, and any other file type.
Configuring Upload Limits
Navigate to Settings → {CoDicts} Upload Size Limits in the WordPress admin.
Server Maximum
At the top of the settings page, you’ll see your hosting provider’s maximum upload size (for example, 128 MB). This is the upper bound — you cannot configure any role’s limit higher than this value.
Per-Role Limits
The settings page lists every registered user role on your site. For each role, you configure four values:
| Field | Description |
|---|---|
| Images — Size | Maximum upload size for image files (accepts decimal values, e.g., 2.5). |
| Images — Unit | Size unit: kB, MB, or GB. |
| Videos — Size | Maximum upload size for video and all other non-image files. |
| Videos — Unit | Size unit: kB, MB, or GB. |
Example Configuration
| Role | Image Limit | Video/Other Limit |
|---|---|---|
| Administrator | 128 MB | 128 MB |
| Editor | 10 MB | 50 MB |
| Author | 5 MB | 20 MB |
| Contributor | 2 MB | 5 MB |
| Subscriber | 1 MB | 2 MB |
In this example, Administrators have full access up to the server maximum, while Subscribers are restricted to small files.
Save and Reset
Click “Save Settings” to apply your configuration. If you need to start over, click “Reset” to restore all fields to the server’s default maximum, then click “Save Settings” to persist the reset values.
How File Types Are Categorized
| Category | Uses This Limit | Examples |
|---|---|---|
| Images | Image size limit | JPEG, PNG, GIF, WebP, SVG, BMP, TIFF |
| Everything Else | Video size limit | MP4, MOV, AVI, PDF, ZIP, DOCX, MP3, CSV, and any other non-image file |
The plugin checks the file’s MIME type to determine whether it’s an image. Any file that isn’t an image uses the “Videos” limit.
Custom User Roles
The plugin automatically detects all registered user roles on your site, including custom roles created by themes or other plugins (such as Voxel’s custom roles, WooCommerce’s “Customer” and “Shop Manager” roles, etc.). Each role appears on the settings page with its own configurable limits.
Logged-Out Users
The plugin only applies limits to logged-in users. If a logged-out user can upload files (through a frontend form, for example), WordPress’s default server limits apply. To restrict uploads from logged-out users, use a separate form validation or restrict uploads to logged-in users only.
Troubleshooting
Upload Limits Not Taking Effect
| Cause | Solution |
|---|---|
| Settings not saved | Click “Save Settings” after configuring limits. Check for any error messages at the top of the settings page. |
| User’s role not configured | If the uploading user’s role doesn’t have a limit configured, WordPress defaults apply. Make sure all relevant roles have limits set. |
| User is logged out | The plugin only applies to logged-in users. Logged-out uploads use WordPress/server defaults. |
| Plugin conflict | Another plugin may be overriding the upload filter. Temporarily deactivate other plugins to test. |
“Can not set a maximum file size greater than hostings maximum file size limit”
This error appears when you try to set a limit higher than your server allows. The plugin cannot increase the server’s PHP limits. To raise the maximum, contact your hosting provider and ask them to increase upload_max_filesize and post_max_size in PHP.
Server Maximum Shows an Incorrect Value
| Cause | Solution |
|---|---|
| PHP values cached | Some hosts cache PHP settings. Restart PHP-FPM or Apache after changing upload_max_filesize or post_max_size. |
| Overrides in .htaccess or php.ini | Check your .htaccess, local php.ini, or wp-config.php for PHP ini overrides that may differ from the server defaults. |
Wrong Limit Applied to a User
The plugin uses the user’s primary role (the first role in their roles list). If a user has multiple roles, the limit for their primary role is applied. To verify which role is being used, check the user’s profile in Users → All Users.
Uploads Still Failing Below the Configured Limit
Even if the plugin allows the upload, the server’s own PHP limits still apply. If your server’s upload_max_filesize is 8 MB and you set a plugin limit of 10 MB, uploads between 8–10 MB will still fail at the server level. The plugin limit must be equal to or below the server maximum to work correctly.
Settings Page Not Appearing
Only users with the manage_options capability (typically Administrators) can access the settings page. Check that you’re logged in as an Administrator and look under Settings → {CoDicts} Upload Size Limits.
For further support, visit codicts.com or contact us at support@codicts.com.