How to Increase the WordPress Upload File Size Limit

Hit a maximum upload size error? Raise the upload file size limit using functions.php, .htaccess, php.ini or your hosting panel so large media files upload.

*Niya Digital operates as a reseller in partnership with multiple ICANN-accredited registrars.

WordPress upload limits are fundamentally controlled by your server’s PHP configuration, not by WordPress itself. When you see the error “The uploaded file exceeds the upload_max_filesize directive,” the server’s PHP settings are limiting your file uploads. Understanding this architecture and learning to adjust these settings across different hosting environments is essential for content creators, photographers, agencies, and any WordPress site managing substantial media libraries.

Table of Contents

Understanding Where Upload Limits Originate

WordPress has no hardcoded upload file-size ceiling. Instead, the WordPress core function wp_max_upload_size() queries two PHP configuration directives, upload_max_filesize and post_max_size, and returns whichever value is smaller. This dual-directive design reflects HTTP request architecture: one setting governs individual files, while the other governs the entire request payload. Understanding this distinction matters because misconfiguring either one causes upload failures, and the failures behave differently.

Why PHP Defaults Became Obsolete

The PHP defaults are upload_max_filesize = 2 MB and post_max_size = 8 MB across all standard PHP installations. These conservative values originated in the early 2000s when protecting shared servers from resource exhaustion was a primary concern and file sizes were substantially smaller. Today’s smartphones routinely capture photos ranging from 4–8 MB each, and short video clips frequently exceed 100 MB. For any modern WordPress site handling media beyond simple text illustrations, these defaults are functionally inadequate.

Shared hosting providers often leave these defaults unchanged or only marginally increase them to 16–64 MB, citing server resource constraints. Managed WordPress hosting services typically pre-configure more generous limits, ranging from 64 MB to 256 MB, removing this friction from the upload experience. Understanding your current limit and whether it aligns with your content strategy is therefore the essential first diagnostic step before attempting any configuration changes.

How WordPress Reports Your Actual Upload Ceiling

WordPress provides the fastest built-in diagnostic through Tools > Site Health > Info > Media Handling, where WordPress displays your effective maximum upload size derived from the wp_max_upload_size() function. This section also shows a detailed breakdown of upload_max_filesize, post_max_size, max_file_uploads status, and file_uploads enablement. If Site Health reports “Max size of a file upload: 8 MB,” your post_max_size directive is capping the limit despite potentially higher upload_max_filesize settings.

A secondary check appears directly in the WordPress media uploader. Navigate to Media > Add New in your dashboard, and the bottom of the upload form displays “Maximum upload file size: X MB.” This value reflects what WordPress considers safe to accept based on the current server configuration. If this number doesn’t accommodate your typical files, one of the configuration methods in this guide applies to your hosting environment.

WordPress Pricing Plans

Choose the WordPress hosting plan that fits your website needs, with reliable performance, security, storage, backups, and tools to help your site grow.

WordPress Basic

$8.99 per month

A great way to get started.

  • 1 website
  • 10 GB NVMe storage
  • Unmetered bandwidth
  • Free SSL Certificate *
  • WordPress pre-installed
  • Weekly backups
  • Web Application Firewall
  • Daily malware scans
  • One-time malware removal
WordPress Basic

WordPress Deluxe

$11.99 per month

Improve your site performance with Cloudflare CDN.

  • 1 website
  • 20 GB NVMe storage
  • Unmetered bandwidth
  • Free SSL Certificate *
  • WordPress pre-installed
  • Daily backups
  • Web Application Firewall
  • Daily malware scans
  • One-time malware removal
  • Up to 2x faster performance with global Cloudflare CDN **
  • Enhanced security with DDoS protection
  • Staging site
WordPress Deluxe

WordPress Ultimate

$15.99 per month

Add online marketing with more sites, storage and security.

  • 1 website
  • 30 GB NVMe storage
  • Unmetered bandwidth
  • Free SSL Certificate *
  • WordPress pre-installed
  • Daily + on-demand backups
  • Web Application Firewall
  • Daily malware scans
  • Unlimited malware removal
  • Up to 2x faster performance with global Cloudflare CDN **
  • Enhanced security with DDoS protection
  • Staging site
  • WordPress code optimizer
  • Smart WordPress plugin manager
  • Sell online with WooCommerce
WordPress Ultimate

The PHP Configuration Hierarchy: Establishing Proper Size Relationships

Upload success depends on a properly structured hierarchy of PHP memory and size settings, where each level must accommodate the one below it. The correct pyramid structure is: memory_limit > post_max_size > upload_max_filesize. If any level is misconfigured or too small, the upload fails even if the directive below it appears large enough. Understanding this hierarchy is fundamental to fixing upload problems permanently.

Here is the reasoning behind each level. When PHP receives a file upload, it must allocate RAM to buffer the incoming request data, process the file, and handle WordPress’s media processing routines. If memory_limit is smaller than the file size plus PHP’s internal overhead, the request terminates immediately with an “allowed memory exhausted” error. Similarly, if post_max_size is smaller than upload_max_filesize, post_max_size becomes the de facto ceiling because PHP enforces the smaller limit. Many site administrators raise upload_max_filesize to 200 MB but overlook post_max_size, then experience continued failures at 64 MB, the old post_max_size value. This is the most frequent misconfiguration in WordPress deployments.

The Critical Relationship Between post_max_size and upload_max_filesize

post_max_size must always equal or exceed upload_max_filesize without exception. A common configuration error sets upload_max_filesize = 100M but leaves post_max_size = 64M. In this scenario, uploads are capped at 64 MB regardless of the larger upload_max_filesize setting because PHP enforces the smaller limit. The essential rule is straightforward: add 10–25% buffer above upload_max_filesize when setting post_max_size to account for form fields, metadata, and HTTP protocol overhead. For instance, if you need to support 100 MB file uploads, set upload_max_filesize = 100M and post_max_size = 125M minimum. This buffer prevents edge-case failures from borderline file sizes.

Supplementary Time Directives: Execution and Input Timeouts

Beyond the three-level hierarchy, two additional PHP directives control how long the server waits for upload completion. max_execution_time, which defaults to 30 seconds, limits the total wall-clock time a PHP script can run; max_input_time, which defaults to 300 seconds, limits specifically how long PHP accepts input from the network connection. For large file uploads traveling over typical internet connections, 30 seconds of execution time is insufficient. Increase max_execution_time to 300 seconds and max_input_time to 300–600 seconds. Without adequate timeout values, a 200 MB upload over a standard residential connection may timeout mid-transfer, leaving the file incomplete and the upload failed.

PHP Directives’ Roles in Upload Limits

PHP Directive Default Value Function Typical Safe Value Impact on Upload Success
upload_max_filesize 2M Max size of a single file 128M–256M Primary limit for individual file size
post_max_size 8M Max size of entire POST request 128M–256M (≥ upload_max_filesize) Secondary limit; silent failure if exceeded
memory_limit 128M Max RAM per PHP script 256M–512M Prevents “memory exhausted” errors
max_execution_time 30 sec Max script execution time 300 sec Prevents timeout on large transfers
max_input_time 300 sec Max input read time (uploads only) 300–600 sec Prevents timeout during upload reception

Checking Your Current Upload Limit Without Configuration Changes

Before modifying server configuration, you should know your exact current limit and understand whether Site Health and the Media Library agree on this value. This baseline guides your configuration target and helps you avoid over-provisioning or under-provisioning.

Using the Media Library Upload Form

The simplest quick check requires no dashboard navigation beyond Media. Log in to your WordPress admin, click Media in the sidebar, then click “Add New.” The file uploader displays a small text line at the bottom stating “Maximum upload file size: X MB.” This is the limit WordPress currently recognizes. If this number suffices for your needs, no configuration change is necessary. If not, note this value as your starting point.

Accessing Site Health’s Detailed Breakdown

For a comprehensive technical view, navigate to Tools > Site Health, then click the “Info” tab. Scroll to the “Media Handling” section. This section lists the exact values of upload_max_filesize, post_max_size, max_file_uploads, and file_uploads setting in a structured table format. WordPress’s display of “Max size of a file upload” in this section is calculated from wp_max_upload_size() and represents the actual effective limit. If Site Health and Media Library show different values, there is a discrepancy in how WordPress is reading the configuration, a sign that a configuration reload may be pending.

Creating a Diagnostic PHP File for Raw Values

For administrators with direct server access, creating a temporary PHP diagnostic file provides absolute confirmation of what PHP itself believes its configuration is. Using your hosting’s file manager or an FTP client, create a file named upload-check.php in your WordPress root directory (same level as wp-config.php). Paste this code:

<?php
echo ‘upload_max_filesize: ‘ . ini_get(‘upload_max_filesize’) . PHP_EOL;
echo ‘post_max_size: ‘ . ini_get(‘post_max_size’) . PHP_EOL;
echo ‘memory_limit: ‘ . ini_get(‘memory_limit’) . PHP_EOL;
echo ‘max_execution_time: ‘ . ini_get(‘max_execution_time’) . PHP_EOL;
echo ‘max_input_time: ‘ . ini_get(‘max_input_time’) . PHP_EOL;
?>

Visit yoursite.com/upload-check.php in your browser. The output shows PHP’s actual settings. Compare these raw values to what Site Health displays. They should match. After confirming, delete upload-check.php for security; it reveals configuration information that could assist attackers.

Configuration Method: Apache with .htaccess Files

If your hosting uses Apache with mod_php (which you can confirm in Tools > Site Health, where PHP SAPI shows “apache2handler”), you can raise upload limits directly in the .htaccess file in your WordPress root directory. This is the quickest configuration path for most users because .htaccess changes apply immediately on the next HTTP request without requiring server restarts or downtime.

Editing .htaccess Step-by-Step

  1. Access your site via FTP or your hosting control panel’s File Manager application.
  2. Navigate to your WordPress root directory (the folder containing wp-config.php, wp-content, and wp-admin folders).
  3. Locate the .htaccess file. If hidden files are not visible, enable “Show Hidden Files” in your file manager settings.
  4. If .htaccess does not exist, create it by uploading a new text file named .htaccess (note the leading period).
  5. Open .htaccess in a text editor (Notepad, VS Code, or your control panel’s built-in editor).
  6. Add or modify the following lines, adjusting values to suit your needs:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
  1. Save the file and re-upload it to your server (if editing offline) or save in-place (if editing via control panel).
  2. Wait 2–3 seconds for the server cache to clear.
  3. Navigate to Media > Add New in your WordPress dashboard and verify the displayed maximum has increased.

Changes take effect instantly. No server restart is required, and no site downtime occurs. You can increase values if needed or lower them if your limits become too generous.

Avoiding Common .htaccess Mistakes

Do not place these php_value directives at the very beginning of .htaccess if WordPress’s built-in rewrite rules already exist in that file. Instead, insert the directives above the <IfModule mod_rewrite.c> block or after the closing </IfModule> tag. Placing directives in the wrong position can disrupt WordPress routing. If WordPress breaks after editing .htaccess, restore the original file from your hosting backup, verify the structure, and try again. Also, because upload_max_filesize and post_max_size have the PHP_INI_PERDIR changemode, you can’t change them in PHP code; .htaccess works because Apache parses it before any PHP code runs.

Configuration Method: Direct php.ini File Editing

For users with SSH terminal access or hosting plans that provide direct server administration, editing the main php.ini file offers the most permanent solution. The php.ini file controls PHP behavior server-wide and takes precedence over .htaccess configurations. Changes to php.ini require a server restart or PHP process reload but apply universally to every PHP application on that server, preventing the need to modify .htaccess for each individual site.

Locating Your Active php.ini File

The first step is identifying which php.ini file your server actually loads. Different systems store this file in different locations, and editing the wrong file produces no effect. Connect to your server via an SSH terminal and run:

php -i | grep -i “Loaded Configuration File”

The output will display the full path to your active php.ini, typically something like /etc/php/8.1/cli/php.ini or /etc/php.ini. Write this path down; it is the file you must edit. Some systems have multiple PHP versions installed, so confirm you are modifying the version your WordPress site actually uses by checking Tools > Site Health > Server section for the PHP version.

Editing php.ini Safely

Create a backup of the original file before making any changes:

sudo cp /etc/php/8.1/cli/php.ini /etc/php/8.1/cli/php.ini.backup

Open the file in a terminal text editor:

sudo nano /etc/php/8.1/cli/php.ini

(Replace 8.1 with your actual PHP version.)

  1. Use Ctrl+W to search for upload_max_filesize. When found, change the value from 2M to your desired size (e.g., 128M).
  2. Search for post_max_size and increase it to equal or exceed upload_max_filesize (e.g., 128M).
  3. Optionally, search for memory_limit and increase it to provide adequate buffer (e.g., 256M).
  4. Search for max_execution_time and increase it to accommodate large transfers (e.g., 300).
  5. Press Ctrl+O to save the file, then Ctrl+X to exit nano.
  6. Reload PHP to apply changes. For PHP-FPM:

sudo systemctl reload php8.1-fpm

For Apache with mod_php:

sudo systemctl restart apache2

Verify the changes took effect by visiting Tools > Site Health > Info > Media Handling in WordPress.

When php.ini Editing Is Preferable

Direct php.ini editing becomes the better choice when you manage multiple WordPress sites on a single server and require uniform upload limits across all sites, when your hosting provider has disabled .htaccess processing, or when you need to modify PHP directives that .htaccess cannot override due to server configuration restrictions.

Configuration Method: WordPress wp-config.php

The WordPress wp-config.php file allows you to set WP_MEMORY_LIMIT, which increases the PHP memory pool available specifically to WordPress. Adding define(‘WP_MEMORY_LIMIT’, ‘256M’) immediately before the line “That’s all, stop editing!” boosts WordPress’s internal memory allocation. However, this method doesn’t directly change PHP’s upload_max_filesize or post_max_size directives, so it’s a supplement rather than a complete solution.

What wp-config.php Actually Controls

WP_MEMORY_LIMIT ensures WordPress has enough RAM to process file uploads and handle image resizing. It is a supplement to PHP’s memory_limit directive, not a replacement. If your server’s php.ini already sets memory_limit = 256M, adding WP_MEMORY_LIMIT = 256M makes minimal additional difference. However, if your server’s memory is constrained or WordPress frequently hits its memory limit, WP_MEMORY_LIMIT provides a targeted boost for WordPress-specific operations without affecting other applications on shared servers.

To implement this method, connect via FTP or your hosting file manager and open wp-config.php. Locate the line that reads “That’s all, stop editing! Happy blogging.” Immediately before this line, add:

define(‘WP_MEMORY_LIMIT’, ‘256M’);
define(‘WP_MAX_MEMORY_LIMIT’, ‘512M’);

The first constant applies to the WordPress front end and general administration; the second applies to individual PHP request contexts, such as plugin and theme activation. Save the file. Changes take effect immediately on the next page load. Crucially, you must still configure upload_max_filesize and post_max_size via .htaccess or php.ini for uploads to function; wp-config.php does not replace those directives.

Configuration Method: Hosting Control Panels (cPanel, Plesk, etc.)

Many shared hosting providers supply graphical control panels (cPanel, Plesk, Webmin) that expose PHP configuration through a user-friendly interface. This method requires no command-line access, file editing, or SSH expertise, making it the most accessible option for non-technical users.

Adjusting Limits in cPanel

  1. Log in to your cPanel account dashboard.
  2. Locate an icon labeled “Select PHP Version,” “PHP Configuration,” or “PHP Settings” (exact label varies by host).
  3. Click the icon and select your active PHP version from the dropdown menu.
  4. Click the “Options” tab or equivalent label for configuration settings.
  5. Locate the upload_max_filesize field in the form.
  6. Change its value to your target size (e.g., 128M).
  7. Locate the post_max_size field and set it to equal or exceed upload_max_filesize (e.g., 128M or 160M for buffer).
  8. Optionally adjust memory_limit, max_execution_time, and max_input_time to values matching those in this guide.
  9. Click “Apply,” “Save,” or equivalent button (wording varies by host).
  10. Changes apply immediately; no server restart is needed.

Adjusting Limits in Plesk

Plesk uses a different interface layout but follows the same principle:

  1. Log in to the Plesk panel.
  2. Navigate to your domain via the global search or Subscriptions menu.
  3. Click “PHP Settings” from the domain configuration options.
  4. Adjust the upload_max_filesize slider or field to your desired value.
  5. Adjust post_max_size to equal or exceed upload_max_filesize.
  6. Modify memory_limit, max_execution_time, and max_input_time as needed.
  7. Click the “Apply” button.

Each control panel differs slightly in terminology and layout, but all expose the same underlying PHP directives. If your hosting provider’s control panel looks different, consult their support documentation or help portal, which typically includes screenshots for your specific panel version.

Ready to Scale Your WordPress Media Operations?

Managing substantial media uploads requires not just higher PHP settings, but also reliable hosting infrastructure built to handle resource-intensive operations like image processing, file compression, and automated backups. Niya Digital’s managed WordPress hosting comes pre-configured with enterprise-grade upload, memory, and processing settings, eliminating these configuration headaches entirely. Our infrastructure partner’s cloud platform handles the technical complexity while you focus on content creation.

Explore Our Managed WordPress Plans

Configuration Method: Nginx with PHP-FPM Pool Configuration

Nginx does not read .htaccess files, so the Apache .htaccess method does not apply. Instead, upload limits on Nginx must be configured in the PHP-FPM pool configuration file, typically located at /etc/php/X.Y/fpm/pool.d/www.conf. This is the most common setup on modern, high-performance hosting platforms and developers’ local environments.

Editing the PHP-FPM Pool Configuration

  1. Connect to your server via SSH terminal.
  2. Open your pool config file:

sudo nano /etc/php/8.1/fpm/pool.d/www.conf

(Replace 8.1 with your actual PHP version.)

  1. Add or modify these lines. Critically, use php_admin_value rather than php_value so these settings cannot be accidentally overridden at runtime:
php_admin_value[upload_max_filesize] = 128M
php_admin_value[post_max_size] = 128M
php_admin_value[memory_limit] = 256M
php_admin_value[max_execution_time] = 300
php_admin_value[max_input_time] = 300<
  1. Save the file (Ctrl+O, then Ctrl+X in nano).
  2. Reload PHP-FPM to apply changes:

sudo systemctl reload php8.1-fpm

  1. Test in WordPress by navigating to Media > Add New and confirming the maximum upload size displays your new value.

The difference between php_value and php_admin_value matters for security and stability. php_value settings can be overridden by .user.ini files or PHP code, potentially allowing accidental or malicious modifications. php_admin_value locks the setting at the server level, preventing any runtime override. For production WordPress sites, always use php_admin_value in PHP-FPM configurations.

Configuration Methods Comparison Table

Configuration Method Server/Hosting Type Who Can Use It Time to Apply Requires Restart
.htaccess File Edit Apache with mod_php Users with FTP/File Manager Immediate (2-3 sec cache clear) No
php.ini Direct Edit Any (requires SSH) Server administrators After reload (10-30 sec) Yes, reload required
WordPress wp-config.php Any All WordPress users Immediate (next page load) No, supplement only
Control Panel (cPanel/Plesk) Shared hosting with panel All account holders Immediate (automatic reload) Usually automatic
PHP-FPM Pool Config Nginx + PHP-FPM Server administrators (SSH) After reload (10-30 sec) Yes, reload required

Verifying Changes Took Effect

After adjusting your upload limits via any configuration method, always verify the changes actually applied. Don’t assume success based on the configuration steps alone; verification prevents wild-goose-chases later.

Three Essential Verification Checks

First, check the Media Library display. Navigate to Media > Add New in your WordPress dashboard. Scroll to the very bottom of the upload form and locate the line “Maximum upload file size: X MB.” This should display your new value. If it still shows the old limit, your configuration change did not propagate; return to the configuration steps, verify accuracy, and retry. For .htaccess changes, wait 5–10 seconds for server cache to clear, then hard-refresh your browser (Ctrl+Shift+R or Cmd+Shift+R).

Second, cross-reference Site Health. Go to Tools > Site Health, click “Info,” and scroll to “Media Handling.” The line “Max size of a file upload” should match your Media Library display and reflect your new configuration. If this value is lower than expected, post_max_size is still too small, or the configuration reload did not complete. Also verify that upload_max_filesize and post_max_size values shown in Site Health match what you configured.

Third, test with an actual file upload. Create a test file between your old limit and your new limit, for example, if you raised from 64 MB to 128 MB, create a 100 MB test file using any video or image tool. Attempt to upload this file to the Media Library. If the upload succeeds, your configuration is live. If it fails with the same error as before, review your configuration steps carefully, ensure all three directives (memory_limit, post_max_size, upload_max_filesize) follow the hierarchy, and contact your hosting provider if the problem persists.

Common Configuration Pitfalls and Resolution Strategies

post_max_size Smaller Than upload_max_filesize

This is the most frequent misconfiguration and causes particularly frustrating silent failures. A site owner raises upload_max_filesize to 200M but forgets to raise post_max_size, leaving it at 8M or 64M, resulting in silent upload failures where $_FILES arrives empty because PHP rejected the POST body before WordPress code executes. The user sees no error message, only a failed upload with no explanation.

Resolution: Always set post_max_size ≥ upload_max_filesize. A safe practice adds 25% buffer: if upload_max_filesize = 100M, set post_max_size = 125M or higher. This prevents edge-case failures from files near the exact boundary and accounts for form fields and HTTP overhead. Verify both values in Site Health after configuration.

Editing the Wrong Configuration File

Systems often have multiple php.ini files or multiple PHP versions installed. Editing a local .user.ini or a custom php.ini in the public_html folder while a global system php.ini takes precedence produces no effect. Use php -i | grep Loaded to confirm which php.ini file PHP actually loads before editing. Edit that file, not one you assume is active.

Resolution: Run php -i | grep “Loaded Configuration File” and write down the exact path. Edit only that file. If multiple PHP versions exist, confirm which version your WordPress site uses by checking Tools > Site Health > Server section.

PHP-FPM Reload Not Applied

After editing php.ini or a PHP-FPM pool config file, changes do not take effect until PHP reloads. Control panel changes often trigger automatic reloads, but command-line edits do not. Without an explicit reload command, your configuration changes remain in the file but do not execute.

Resolution: Always run sudo systemctl reload php8.1-fpm or sudo systemctl restart apache2 (depending on your setup) after editing configuration files via SSH. If using a control panel, click “Apply” or “Save” explicitly before leaving the interface. Clear your browser cache afterward to ensure you see current server responses.

Insufficient memory_limit for File Processing

A 200 MB upload requires not just 200 MB memory_limit, but additional overhead for PHP internals, WordPress code, and image processing libraries. A misconfigured memory_limit frequently causes uploads to fail mid-process with “allowed memory exhausted” errors or incomplete file processing.

Resolution: Follow the hierarchy: memory_limit should exceed post_max_size by at least 100%. A safe guideline is memory_limit = (desired upload size × 2) or 512 MB minimum. If uploading 200 MB files, set memory_limit to at least 512 MB. If image processing failures occur, increase memory_limit to 1024 MB.

Attempting Runtime Configuration Changes

The directives upload_max_filesize and post_max_size have PHP_INI_PERDIR changemode and cannot be modified after PHP starts. Code like ini_set(‘upload_max_filesize’, ‘200M’) or plugin-based configuration has zero effect. These directives must be set in php.ini, .htaccess, .user.ini, or PHP-FPM pool configuration before the request is processed.

Resolution: Do not rely on plugins, wp-config.php code, or theme functions.php modifications to change upload_max_filesize or post_max_size. Use only server-level configuration methods (php.ini, .htaccess, PHP-FPM config, or control panel).

When to Escalate: Contacting Hosting Support

If you followed the correct configuration steps for your server type and upload limits still don’t increase, one of several scenarios likely applies, and you’ll need hosting provider assistance.

Permission and Access Restrictions

Shared hosting accounts may have restricted .htaccess permissions or an incompatible PHP setup. If you edit .htaccess but Site Health still shows the old limit, your host may have disabled php_value directives or use a PHP handler that does not support .htaccess overrides (for instance, some CGI-based PHP setups ignore .htaccess). In this scenario, only a global php.ini change by the hosting provider’s support staff or a control panel adjustment will work.

Action: Contact your hosting support and request they manually increase upload_max_filesize and post_max_size to your desired values via php.ini. Provide specific target values (e.g., “please set upload_max_filesize and post_max_size to 256M”) and mention you have attempted .htaccess configuration without success.

Server-Level Hard Caps

Some budget shared hosting plans enforce absolute caps on upload size for security and resource management reasons, overriding any php.ini value you set. These hard caps are rare on managed hosting but common on extremely low-cost shared providers. If support confirms your requested limit exceeds the plan’s maximum allowable value, no configuration method will succeed.

Action: Either upgrade to a higher-tier hosting plan with higher limits or switch hosts entirely. Many mid-range managed hosting providers allow 256+ MB uploads without an upgrade.

Nginx Without Direct PHP-FPM Access

Some hosting setups use Nginx with a proprietary PHP handler or a custom control system that doesn’t expose standard PHP-FPM pool configuration. On these systems, you cannot adjust limits yourself and must ask support to modify the Nginx directive client_max_body_size or the PHP handler configuration on your behalf.

Action: Contact support and request they increase client_max_body_size to your desired value in the Nginx server configuration.

Advanced Troubleshooting Steps for Persistent Upload Failures

Even after configuration changes, uploads can still fail. Understanding additional failure modes accelerates resolution.

File Size vs. Memory vs. Timeout Failures

Three distinct failure types look similar but have different causes and solutions. An “exceeds upload_max_filesize” error means the file itself is too large; increase upload_max_filesize and post_max_size. An “allowed memory exhausted” error means PHP ran out of RAM mid-process; increase memory_limit. A timeout without an error message means the upload took too long; increase max_execution_time and max_input_time. Identifying the error you see determines which directive to adjust.

Image Processing Failures After Successful Upload

A file uploads successfully, but WordPress cannot generate thumbnail or intermediate sizes, so it appears as a corrupted image in the library. This usually indicates the image editor (GD or Imagick) failed, not an upload limit. Navigate to Tools > Site Health > Info > Media Handling and check “active image editor.” If unavailable, no editor is installed; contact support. If available, the issue is likely insufficient memory for processing large images; increase memory_limit.

Storage and Disk Space Issues

If Site Health shows adequate limits but uploads fail after reaching a certain amount of total storage, your hosting account may be approaching disk space limits. Check your hosting control panel’s storage usage. If near capacity, you must either delete older media, upgrade your plan, or use an offload plugin to move media to cloud storage.

Get Expert Help Managing Your WordPress Media Workflow

Troubleshooting server configuration for each new WordPress project drains time from content creation and site development. Niya Digital’s managed WordPress hosting eliminates this overhead by pre-configuring optimal PHP settings for modern media-heavy sites, then handling all technical management and updates. Let our support team focus on infrastructure while you focus on your content strategy.

Talk to Our WordPress Hosting Experts

Frequently Asked Questions

How do I know if my upload limit is actually too low?

When you attempt to upload a file to Media > Add New and encounter “The uploaded file exceeds the upload_max_filesize directive” or an HTTP error, your limit is too low. Also, if a file appears to upload successfully but WordPress image processing stalls or fails, memory_limit may be too low. The most reliable method is to check Tools > Site Health > Info > Media Handling and see what limit Site Health reports, then try uploading a file larger than that limit. If it fails, the limit is genuine.

Can I increase upload limits using a plugin?

Most upload-limit plugins modify only WordPress-level settings or metadata, not the underlying PHP directives. Since PHP directives like upload_max_filesize have the PHP_INI_PERDIR changemode and cannot be modified at runtime from PHP code, these plugins are severely limited. Configure the directives via .htaccess, php.ini, control panel, or PHP-FPM pool config instead. Plugins cannot override PHP’s architectural restrictions, though some plugins can redirect uploaded media to cloud storage to bypass local size limits.

What happens if upload_max_filesize is much larger than post_max_size?

post_max_size becomes the effective upload ceiling. If upload_max_filesize = 200M but post_max_size = 64M, uploads are capped at 64 MB despite the higher upload_max_filesize setting. The smaller of the two limits always wins. This is why many troubleshooting sessions reveal misconfiguration of post_max_size, it is frequently overlooked and silently becomes the bottleneck. Always ensure post_max_size ≥ upload_max_filesize to avoid this frustrating scenario.

Does increasing upload limits slow down my WordPress site?

No. The upload limit affects only file uploads themselves, not how the site serves pages to end users. Raising upload_max_filesize and post_max_size does not change page load times or visitor experience. However, extremely large uploads (500+ MB) consume considerable server resources during the transfer process and may momentarily spike server load. Balance your limit against available server storage, available RAM, and network bandwidth to ensure sustainable performance.

My uploads still fail even after increasing limits. What should I do next?

Follow this diagnostic sequence:

(1) Verify post_max_size ≥ upload_max_filesize in Tools > Site Health; if not, adjust post_max_size.

(2) Confirm memory_limit is at least 2× your desired upload size; if not, increase it.

(3) Test with a small file (1–10 MB) to isolate whether the issue is the size limit, insufficient memory, or something else (permissions, disk space, image processor).

If small files upload successfully but larger ones fail, the size limit is your issue. If even small files fail, the problem lies elsewhere; contact your hosting provider.

Can I set different upload limits for different file types (images vs. videos)?

PHP’s upload_max_filesize applies uniformly to all file types. WordPress Media Library does not offer per-type upload limits natively in core. However, plugins like File Upload Limiter or similar tools allow you to restrict specific file types to smaller sizes within the global PHP limit. For example, you could set PHP globally to 200M but restrict videos to 100M and images to 50M via plugin rules. This uses the PHP ceiling without bypassing it, but it adds administrative overhead.

Should memory_limit be higher than post_max_size?

Yes. The recommended hierarchy is memory_limit > post_max_size > upload_max_filesize. If memory_limit = post_max_size = upload_max_filesize = 128M, there is zero buffer for PHP overhead, WordPress code, database operations, or image processing libraries. A safer configuration is upload_max_filesize = 100M, post_max_size = 125M, memory_limit = 256M or 512M. This buffer prevents “allowed memory exhausted” errors during large uploads and gives WordPress’s media processing pipeline headroom.

What maximum upload size should I allow on my WordPress site?

Maximum size depends on your server resources and content strategy. Photography portfolios and video-heavy sites often allow 256–512 MB uploads. News sites and blogs typically support 64–128 MB. Shared hosting usually caps at 64–256 MB due to resource constraints. Managed WordPress hosting often supports 512 MB or higher. Check your hosting plan’s technical specifications or contact their support to learn what your specific infrastructure safely supports without degrading performance during peak usage.

Does increasing upload limits affect scheduled backups or site performance?

Upload limits do not directly control backups or page-load performance. However, on under-resourced servers, increasing memory_limit and execution timeouts can help backups complete successfully and allow faster uploads to process more smoothly. Conversely, when multiple large file uploads occur simultaneously, server CPU and disk I/O spike sharply, temporarily affecting all site operations. Balance upload limits against your server’s total capacity to avoid bottlenecks during peak admin activity.

Can I revert my changes if they cause problems?

Yes. If you edited .htaccess, remove or comment out the php_value lines and save. If you edited php.ini, restore the original values from your backup. If you used the control panel, adjust sliders back to previous values. Changes take effect after a browser refresh. Reverting carries no risk or penalty; WordPress simply falls back to the original limits. Many administrators increase limits incrementally, testing between each adjustment to find the optimal configuration for their workload.

Glossary

  • upload_max_filesize: A PHP configuration directive that specifies the maximum size of any single file uploaded through an HTTP form. Default value is 2 MB. Must be set in php.ini, .htaccess file, or PHP-FPM pool configuration. Cannot be changed at runtime using ini_set() because it has PHP_INI_PERDIR changemode.
  • post_max_size: A PHP configuration directive that specifies the total size of all data transmitted in one HTTP POST request, including all uploaded files plus form fields and HTTP headers. Default value is 8 MB. Must always equal or exceed upload_max_filesize to avoid silent upload failures where PHP discards the entire request body.
  • memory_limit: A PHP configuration directive that specifies the maximum amount of RAM a single PHP script can consume. Default value is 128 MB. Should exceed post_max_size to provide buffer for PHP internals, WordPress code, and media processing operations during file uploads.
  • .htaccess: An Apache web server configuration file placed in a web-accessible directory that allows per-directory PHP and server setting overrides using php_value directives. Changes apply immediately without server restart. Not supported on Nginx servers; Apache with mod_php handler only.
  • php.ini: The primary PHP configuration file (typically /etc/php/8.1/cli/php.ini or /etc/php.ini) that controls PHP behavior server-wide. Requires SSH or hosting support to edit on shared hosting. Changes require a server or PHP process reload. Takes precedence over .htaccess configurations.
  • PHP-FPM: PHP FastCGI Process Manager, a modern PHP application server handler commonly used with the Nginx web server. PHP-FPM settings are configured in pool configuration files (e.g., /etc/php/8.1/fpm/pool.d/www.conf) rather than .htaccess. Uses php_admin_value directives that cannot be overridden at runtime.
  • Site Health: A WordPress built-in diagnostic dashboard accessible via Tools > Site Health that reports server configuration, PHP settings, security status, and WordPress health status. The Info tab displays upload_max_filesize, post_max_size, memory_limit, max_file_uploads, and file_uploads values in the Media Handling section.
  • Media Library: The WordPress administration interface (Media menu) where site administrators upload, organize, categorize, and manage media files including images, PDFs, audio, video, and documents. Displays the current maximum upload file size at the bottom of the upload form.

Take Your Business Further with WordPress Hosting

Discover how WordPress Hosting can help you overcome challenges, improve efficiency, and achieve your business goals. Explore its features and capabilities to find smarter solutions and new ways to strengthen your digital strategy.

Related Posts