Categories: Wordpress Tutorials

How to Increase Upload Max Filesize in WordPress

If you searched for “increase upload max filesize wordpress”, the fix is usually in PHP rather than in a WordPress setting. Raise upload_max_filesize, set post_max_size a little higher, and then confirm the effective limit in WordPress before trying the upload again.

The error and what causes it

WordPress uses PHP to process media, theme, plugin and import uploads. When the selected file is larger than PHP’s upload_max_filesize, WordPress can show:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

This is not normally fixed by changing a WordPress media setting. PHP also checks the size of the complete HTTP request through post_max_size. WordPress’s usable limit is effectively the smaller of those two values, so increasing only one may not change what you see in the dashboard.

The three settings to understand are:

PHP settingWhat it controlsPractical example
upload_max_filesizeThe largest individual file PHP accepts128M
post_max_sizeThe largest complete POST request, including the upload and form data160M or higher
max_execution_timeHow long a PHP script may run after it starts300 seconds

For a slow upload, max_input_time can matter too because it controls how long PHP may receive input. These values are examples, not a promise that every account can use them. Set a limit that fits the file you actually need to upload and the maximum allowed by your hosting plan.

The WordPress PHP optimisation guide explains the relationship between these limits. PHP’s own documentation also states that post_max_size must be larger than upload_max_filesize for large uploads to work.

What you need before changing the limit

Prepare these items before editing a setting:

  1. WordPress administrator access, so you can check Site Health and retry the upload.
  2. DirectAdmin access for the domain, or access to the site’s document root in File Manager or FTP.
  3. A target size. For example, a 100 MB package needs an upload limit above 100 MB, with extra room for the request itself.
  4. A recent copy of any configuration file you plan to edit.

Do not change the limit simply to a very large number. A 128 MB limit is enough for many theme, plugin and image uploads; a video, backup or migration file may need a different approach. If the file is only slightly over the current limit, a modest increase is easier to verify and maintain.

Step 1: Check your current WordPress limit

Why this matters: you need to know which limit is blocking the request and have a value to compare after the change.

  1. Sign in to WordPress.
  2. Open Tools > Site Health > Info.
  3. Expand Media Handling.
  4. Record Max size of an uploaded file, Max size of post data allowed, and Max effective file size.
  5. You can also open Media > Add New. WordPress displays the maximum upload size on that screen.

The Max effective file size is the most useful value for a normal Media Library upload. If it is lower than the file you selected, continue to the next step. If it is already large enough, the error may come from a multisite quota, a plugin-specific form limit, a timeout or a different upload problem.

Success looks like this: you have written down the current values and know the smallest setting that needs to increase.

Step 2: Change the limits in DirectAdmin

Why this matters: the hosting panel is the cleanest place to apply per-domain PHP values when your hosting account exposes them.

  1. Sign in to DirectAdmin for the domain that runs WordPress.
  2. Open Account Manager > PHP Settings. Depending on the DirectAdmin skin and PHP mode, the link may appear simply as PHP Settings under the domain.
  3. Search for upload_max_filesize, post_max_size, max_execution_time and, if available, max_input_time.
  4. Enter values suited to your upload. A reasonable example is:
upload_max_filesize = 128M
post_max_size = 160M
max_execution_time = 300
max_input_time = 300
  1. Save the changes.
  2. Make sure you changed the PHP settings for the same domain and PHP version used by WordPress. A setting for another domain will not change this site’s upload limit.

The DirectAdmin PHP options documentation notes that the available per-domain method depends on the PHP mode. If a setting is missing, disabled or capped at a lower value, use the per-directory method below if your account supports it, or ask your hosting provider to apply the account-level change.

Success looks like this: the values save without an error, and the PHP settings page shows the new values for the correct domain.

Step 3: Use php.ini or .user.ini for one site

Why this matters: a per-directory configuration file can change PHP values for one WordPress installation without changing unrelated websites on the account.

First download a copy of the existing file, if one is present. In DirectAdmin File Manager, open the WordPress document root—the folder containing wp-admin, wp-content and wp-includes—and create or edit the configuration file supported by your PHP mode.

Use php.ini when your hosting setup specifically supports a local php.ini. PHP-FPM setups commonly use .user.ini for user-controlled per-directory values. Do not create both files just to try random combinations; use the method shown by your hosting panel or provider.

Add one setting per line:

upload_max_filesize = 128M
post_max_size = 160M
max_execution_time = 300
max_input_time = 300

Save the file in the site’s document root, then return to WordPress and check Tools > Site Health > Info > Media Handling. Some PHP modes cache per-directory settings, so allow the hosting environment to reload the configuration before deciding that the change did not work.

Do not add define() statements to this file. php.ini and .user.ini use PHP configuration directives, not WordPress constants. Also avoid changing WP_MEMORY_LIMIT for this particular error; memory is a separate issue covered in our guide to increasing the WordPress memory limit.

Success looks like this: Site Health reports the new upload and POST values, and the effective size is above the file you need to upload.

Step 4: Use .htaccess only when your PHP mode supports it

Why this matters: .htaccess can apply PHP values on some Apache configurations, but PHP-FPM does not read php_value directives from .htaccess.

Download a copy of .htaccess before editing it. It is normally in the WordPress document root and may be hidden in File Manager. Add the following lines without removing the existing WordPress rewrite rules:

php_value upload_max_filesize 128M
php_value post_max_size 160M
php_value max_execution_time 300
php_value max_input_time 300

Save the file and check Site Health again. If the setting is unsupported, the site may return a server error because Apache cannot accept php_value in that PHP mode. If that happens, immediately remove the four added lines using File Manager or restore the backup, then use DirectAdmin PHP Settings or .user.ini instead.

Do not put an equals sign after the directive name in this form. The .htaccess syntax is php_value setting value, while the php.ini syntax is setting = value.

Success looks like this: the site remains accessible and Site Health shows the intended values. If the values remain unchanged, remove this method and use the panel or per-directory PHP file.

Step 5: Verify the new limit with a small test

Why this matters: a saved setting is not enough; WordPress must see the value in the same runtime that processes the upload.

  1. Return to Tools > Site Health > Info > Media Handling.
  2. Confirm that Max size of an uploaded file and Max size of post data allowed are both above the file size.
  3. Confirm that Max effective file size is also above the file size.
  4. Open Media > Add New and upload a test file that is below, rather than exactly equal to, the new limit.
  5. If the test succeeds, retry the original file.

For example, with upload_max_filesize = 128M and post_max_size = 160M, test with a file smaller than 128 MB. Do not use a file that is exactly 128 MB because file-size units and multipart request overhead can make a boundary test fail.

Success looks like this: WordPress accepts the test file, creates its attachment entry, and displays it in the Media Library.

Still not working? Check these other limits

If the reported values did not change, or the new values are high enough but the upload still fails, check the limit that matches the symptom.

SymptomWhat to check
The effective size is still lowpost_max_size, upload_max_filesize, the correct domain, and the active PHP version
A slow upload stops part-way throughmax_input_time, max_execution_time, and any web-server timeout
Several files fail when uploaded togethermax_file_uploads and the combined POST size
A multisite upload is rejectedNetwork Admin’s Max upload file size and the individual site quota
The upload finishes but image processing failsPHP memory_limit, image dimensions, available storage and the file format
WordPress shows a generic upload errorThe separate HTTP error when uploading images guide

WordPress’s Site Health screen explains where the maximum post data, upload size and effective file size appear. The PHP core directives reference is useful when a value is ignored or rewritten by the hosting environment.

On shared hosting, some PHP settings are controlled at the server or account level. If DirectAdmin will not save a value, the local file has no effect, or Site Health keeps showing the old value, contact the hosting provider with the exact domain, current values and target values. This is more useful than repeatedly editing wp-config.php or installing a plugin that cannot override the server’s PHP limit.

Upload big files another way

Increasing the limit is appropriate when WordPress should manage the file in the Media Library. It is not always the best route for a very large backup, video or migration export.

  • For a WordPress export that is too large, split the export into smaller files or compress it before importing. Test the import on a copy of the site when possible.
  • For a large backup, use the self-service backup and restore tools provided by your hosting panel rather than sending the backup through the WordPress Media Library.
  • For a video or downloadable file that does not need Media Library metadata, upload it with the hosting File Manager and link to it only when you understand the file path and access permissions.
  • For a theme or plugin package, use the normal WordPress installer when the package fits the limit. If it does not, follow that product’s documented manual installation method and keep a backup before replacing files.

These alternatives do not remove the PHP limit from WordPress. They avoid sending a large file through the particular request that is failing.

FAQ

What is the maximum upload file size in WordPress?

There is no single WordPress-wide number. The effective limit is normally the smaller of PHP’s upload_max_filesize and post_max_size, with other server and WordPress rules able to reduce it further. Check Tools > Site Health > Info > Media Handling for the value your site currently uses.

Why does changing wp-config.php not increase upload_max_filesize?

upload_max_filesize is a PHP configuration directive, not a WordPress memory constant. WP_MEMORY_LIMIT can help with a separate memory or image-processing problem, but it does not raise the server’s individual-file upload limit.

What should post_max_size be for a 128 MB upload?

Set post_max_size higher than upload_max_filesize so the complete request has room for the file and form data. For a 128 MB upload limit, 160M is a practical example, provided your hosting environment allows that value.

How do I fix “uploaded file exceeds the upload_max_filesize directive”?

Check the current values in Site Health, then change upload_max_filesize and a higher post_max_size in DirectAdmin PHP Settings. If the panel supports local configuration, use php.ini or .user.ini; use .htaccess only when the active PHP mode supports php_value directives.

Why is the upload limit unchanged after editing the file?

The file may be in the wrong document root, may not be read by the active PHP mode, or may be overridden by a server-level value. Confirm the domain and PHP version in DirectAdmin, recheck Site Health, and ask the hosting provider to confirm the account-level limit if the value remains unchanged.

Samrat Ghosh

Samrat Ghosh writes hands-on guides about web hosting, WordPress, domains and email for Indian small businesses, students and freelancers - the practical documentation he wishes had existed when he set up his first website.

Share
Published by
Samrat Ghosh

Recent Posts

Zoho Mail Alternatives for Indian Businesses (2026)

Compare zoho mail alternatives for Indian businesses by rupee cost, IMAP access and mailbox limits,…

3 hours ago

Best Wix Alternatives in India for Small Businesses

Compare Wix alternatives for Indian small businesses: see 3-year rupee costs, WordPress hosting, migration limits,…

14 hours ago

Titan Email Price in India: Cost per Mailbox Explained

Titan email price in India explained with mailbox costs, features, team totals and a comparison…

20 hours ago

HostKarle vs Bluehost India: Price, Renewal and Panel

HostKarle vs Bluehost compares Indian shared hosting prices, renewal bills, email, SSL, backups, panels and…

1 day ago

Hindi Blog Kaise Banaye: WordPress Step-by-Step Guide

Learn how to write blog in hindi with WordPress, Hindi typing tools, domain and hosting…

2 days ago

Google Workspace Alternatives in India for Small Teams

Compare Google Workspace alternatives in India by yearly rupee cost, email features and migration effort…

2 days ago

This website uses cookies.