Skip to content

WordPress Max Upload Size Fixer for php.ini & .htaccess

Raise the upload limit with the PHP values in the right order

Runs in your browser. Nothing is uploaded.

Target
Where can you edit files?

Hosts differ in what they let you touch. Generate the format you can actually use — and if the first one silently does nothing, that usually means your host overrides it, so try the next.

Resulting upload limit

128 MB

settings

wp-config.php cannot raise upload_max_filesize or post_max_size: they are PHP settings, not WordPress ones. If your host locks PHP settings, ask them. After any change, open Tools > Site Health > Info > Media Handling: “Max effective file size” is the smaller of the two PHP limits. On multisite, the network’s upload setting can lower the real limit below that number; Media > Add Media File shows the limit WordPress itself enforces. nginx (client_max_body_size) or a CDN in front of the site can still turn larger uploads down.

About the WordPress Max Upload Size Fixer for php.ini & .htaccess

WordPress caps uploads at the smaller of upload_max_filesize and post_max_size. Get both for php.ini or .htaccess, plus client_max_body_size for nginx.

Enter the size of the largest file you want to upload. The tool writes upload_max_filesize, post_max_size and memory_limit in the right order for php.ini, .user.ini or .htaccess. For nginx it writes client_max_body_size, nginx's own limit, which you need as well as the PHP values. It also shows the limit WordPress will report once the values are live. For the full walk-through, including how to find out which of these files your host reads, see the guide to increasing the WordPress upload limit.

Worked example: allow 128 MB uploads

Input: largest file 128 MB, php.ini tab.

Largest file you want to upload (MB): 128
Where can you edit files?             php.ini

Output, from running the tool's own script in Node.js with that input on 16 November 2026. The "Resulting upload limit" box showed 128 MB.

; php.ini, or .user.ini in the WordPress folder when PHP runs as
; CGI/FastCGI (PHP-FPM). PHP re-reads .user.ini every 5 minutes by default.
; In php.ini, edit the existing lines or paste these at the END of the file:
; when a setting appears twice, PHP uses the last one.
upload_max_filesize = 128M
post_max_size = 149M
; The next three lines replace your host's values. If one is already higher
; (Tools > Site Health > Info > Server), keep the higher one. A memory limit
; of -1 or a time limit of 0 means no limit at all: keep that too.
memory_limit = 256M
max_execution_time = 300
max_input_time = 300

Line by line:

  • The lines starting with ; are comments. PHP reads .user.ini only when it runs as CGI or FastCGI, which includes PHP-FPM, and it checks the file again every 300 seconds by default. Wait five minutes before you decide it did not work.
  • A php.ini file usually sets these five values already: PHP's own php.ini-production does. When a setting appears twice, PHP uses the last one, so change the lines that are there or paste the block at the end of the file. Pasted near the top, it changes nothing.
  • upload_max_filesize = 128M is the largest single file PHP will accept.
  • post_max_size = 149M is the largest whole request. The PHP manual says it must be larger than upload_max_filesize. The request also carries the form around the file, so it is a little bigger than the file itself. The tool adds 10% plus 8 MB. If a request is bigger than this, PHP leaves $_POST and $_FILES empty, so WordPress never receives the file.
  • memory_limit = 256M does not cap uploads from the Media Library or the block editor. The PHP manual says it should generally be larger than post_max_size, and WordPress needs the memory to make the resized copies of a large image. The tool never writes less than 256M.
  • A line in php.ini or .user.ini replaces your host's value even when the host's value is higher, and so do the time limits below. The second comment block says so: check Tools > Site Health > Info > Server first, and keep any value that is already higher. A memory limit of -1 or a time limit of 0 means no limit, so keep those too.
  • max_execution_time and max_input_time give PHP 300 seconds to read and process the upload. That number is the tool's choice. On Linux and other non-Windows servers, PHP's default timer counts only the CPU time a script uses toward max_execution_time, not system calls or stream operations such as waiting for the network (PHP manual; thread-safe builds since PHP 8.3 count elapsed time). So if big uploads still time out on a slow connection, the web server's or proxy's own timeout is the more likely cause (the manual names Apache's Timeout directive), and these lines do not change it.

The result is 128 MB because WordPress takes the smaller of upload_max_filesize and post_max_size (its wp_max_upload_size() function, read from the WordPress 7.1.4 source). So the lower of the two is your real limit: raising only the higher one changes nothing, which is why the tool sets both.

Which tab to use

  • php.ini: on a VPS, or when your hosting panel has a PHP settings editor. The file already sets these values, so edit those lines or paste the block at the end: PHP uses the last value it reads. On PHP-FPM or CGI hosts the same lines can go in a .user.ini file in the WordPress folder.
  • .htaccess: only when Apache runs PHP as a module (mod_php). The tool wraps the lines in <IfModule> blocks for that reason. In our Apache 2.4.58 test (November 2026, on a one-line test page instead of a WordPress install), a bare php_value line on a server without mod_php made the page return a 500 error. Paste the block above the # BEGIN WordPress line; the .htaccess generator explains why custom rules go there.
  • nginx: nginx has its own limit, client_max_body_size, which is 1m by default. A larger upload gets "413 Request Entity Too Large" before PHP sees it. Raise it and the PHP values.
  • wp-config: this tab explains why it cannot work. upload_max_filesize and post_max_size can only be set per directory or in php.ini, so ini_set() cannot change them. In our test on WordPress 7.1.4 and PHP 8.3 (WordPress Playground, November 2026), both ini_set() calls in wp-config.php returned false and WordPress's limit stayed the same.

Check that it worked

Open Tools > Site Health > Info > Media Handling. "Max size of an uploaded file" and "Max size of post data allowed" show the values PHP is really using, and "Max effective file size" is the smaller of the two. On a single site with no plugin changing the limit, Media > Add Media File shows the same number as "Maximum upload file size". On a multisite network that number can be lower, because Site Health reads only the PHP settings and leaves out the network's own cap (read from the WordPress 7.1.4 source). If the numbers did not change, your host reads a different file, or sets the limit above your account.

If a file under the limit still fails to upload, look at memory and image processing next. The HTTP error on image upload guide covers both.

Limits

  • It cannot see your server. It does not know whether PHP runs as a module or under PHP-FPM, or which php.ini your host loads, so you may need to try more than one tab.
  • A host can lock these values. Settings fixed by the host (for example with php_admin_value) cannot be raised from .user.ini or .htaccess. Only the host can change them.
  • On a multisite network, the "Max upload file size" setting under Network Admin > Settings also caps uploads, and so does each site's storage quota (read from the WordPress 7.1.4 source).
  • A CDN or proxy in front of the site can have its own request size limit, which these files do not change.

Sources

Guides for this tool

FAQ

Questions

I raised upload_max_filesize and nothing changed. Why?

Because WordPress uses the smaller of upload_max_filesize and post_max_size, so the lower of the two is your real limit: raising only the higher one changes nothing. post_max_size must also be larger than upload_max_filesize, because the request carries the file plus the form around it. Then check the change took effect at all: Tools > Site Health > Info > Media Handling shows the values PHP is really using.

Can wp-config.php raise the upload limit?

No. upload_max_filesize and post_max_size are PHP_INI_PERDIR settings: PHP accepts them only from php.ini, .user.ini, .htaccess or the server config. In our test on WordPress 7.1.4 and PHP 8.3 (WordPress Playground, November 2026), ini_set() for both in wp-config.php returned false and the limit stayed the same. wp-config.php can raise WordPress's memory limits, which help it resize large images, but not the upload cap.

My host won't let me edit php.ini. What now?

If PHP runs as CGI or FastCGI (PHP-FPM counts), put the php.ini lines in a .user.ini file in your WordPress folder. PHP re-reads it every 300 seconds by default, so wait five minutes before you test. If that fails too, the limit is set above your account and only your host can change it.