Hosting Guides

Increase Max Upload File Size in WordPress Without Plugin

You try to upload a video, a large PDF, or a high resolution theme file to WordPress, and instead of a success message you get an error. The file exceeds the maximum upload size for this site. The file is fine, your internet is fine, and WordPress is fine, but a small PHP limit is standing in the way. This is one of the most common WordPress errors, and it is also one of the easiest to fix once you understand which setting controls it.

In this guide you will learn how to increase the max upload file size in WordPress without a plugin. You will learn how to check your current limit, which PHP settings actually control it, and five working methods to raise it, including the cPanel PHP settings editor, php.ini, .user.ini, .htaccess, and Nginx. You will also learn which popular tricks do not work at all, so you can stop wasting time on them.

Which Setting Actually Controls the Upload Limit?

WordPress does not set the upload limit itself. The limit comes from PHP, the language WordPress runs on, and from your web server. Two PHP settings matter: upload_max_filesize, the largest single file PHP will accept, and post_max_size, the largest total size of all the data in one request, including the file and any form fields that travel with it.

WordPress shows you the smaller of the two values. If upload_max_filesize is 64M and post_max_size is 8M, your real limit is 8M, because the whole request cannot be larger than post_max_size. This is the detail that confuses most people. Whenever you raise one, raise the other too, and always keep post_max_size larger than upload_max_filesize.

A third setting matters as well. The memory_limit must be larger than post_max_size, because PHP needs enough memory to handle the uploaded file while it processes the request. A good rule is to set memory_limit to at least double your post_max_size. If you plan to allow 64M uploads, a memory_limit of 256M gives you comfortable headroom. You can read the official values in the PHP configuration documentation on php.net if you want to check what each setting does.

How Do I Check My Current Upload Limit?

Before you change anything, find out what your limit is right now. The fastest way is to go to Media, then Add New in your WordPress admin area. Right under the upload box, WordPress shows a line that reads Maximum upload file size, followed by the current limit. That number is the effective limit, the smaller of upload_max_filesize and post_max_size.

For the full picture, go to Tools, then Site Health, then Info, and open the Media Handling section. There you will see the exact values of upload_max_filesize, post_max_size, and memory_limit. Write those numbers down before you change them, so you can compare before and after. If you are unsure what any of the Site Health results mean, our guide that explains the WordPress Site Health check walks through every section in plain language.

Method 1: Use the cPanel MultiPHP INI Editor

This is the easiest and safest method on most shared hosting plans, and it is the one we recommend first. Log in to cPanel and open the MultiPHP INI Editor. Select your domain from the dropdown, and you will see a list of PHP settings with editable values. Find upload_max_filesize and change it to 64M, then set post_max_size to 128M and memory_limit to 256M.

Save the changes and then check Media, then Add New again. The new limit should appear immediately. If it does not, wait a minute and refresh the page, because some hosts cache PHP settings briefly. The advantage of this method is that cPanel writes the settings to the correct file for you, so there is no risk of editing the wrong php.ini or breaking the syntax.

Method 2: Edit the php.ini File

If you have access to your server php.ini file, you can edit it directly. This file lives in different places on different servers, so check your hosting documentation or ask support for its location. On many cPanel servers it sits in the public_html folder or in the domain root. Open it in a text editor and add or change these three lines, using the values that fit your needs.

upload_max_filesize = 64M
post_max_size = 128M
memory_limit = 256M

Save the file and check the Media screen again. On some servers the change takes effect at once, and on others you need to restart PHP or wait a few minutes. If the values do not change, your php.ini may not be the one PHP actually loads, which happens when a host uses a different configuration file for each domain. In that case, switch to Method 3 below. Never edit a php.ini file on a live server without a backup copy.

Method 3: Create a .user.ini File

The .user.ini file is the per directory version of php.ini, and it works on servers running PHP in CGI or FastCGI mode, which is most shared hosting today. Create a new file named .user.ini in your WordPress root folder, the same folder that holds wp-config.php, and add the same three lines you used in Method 2.

upload_max_filesize = 64M
post_max_size = 128M
memory_limit = 256M

One warning about this method is that .user.ini files are cached by PHP for five minutes by default, so do not panic if the limit does not change the second you save the file. Wait five minutes, refresh the Media screen, and check again. If nothing changes after ten minutes, your host may have disabled .user.ini files, so ask support which method they allow.

Method 4: Use .htaccess With php_value

On servers running Apache with mod_php, or on LiteSpeed servers, you can set PHP values from .htaccess using php_value lines. This method does not work on servers running PHP-FPM or CGI, which is why it fails silently for many people. If you are not sure which PHP handler your server uses, check the Server Information section in your hosting panel.

php_value upload_max_filesize 64M
php_value post_max_size 128M
php_value memory_limit 256M

Add these lines to the top of your .htaccess file, above the WordPress block, and save it. If the site immediately shows a 500 error, your server does not support php_value, and you must remove the lines at once. That is why you should always back up .htaccess before editing it. Our guide to WordPress file permissions in cPanel shows how to work with .htaccess and other site files safely.

Method 5: Raise the Nginx client_max_body_size Limit

If your site runs on Nginx, PHP settings alone will not fix the problem. Nginx has its own limit called client_max_body_size, which defaults to just 1M on many servers. When a file is larger than that limit, Nginx rejects the request with a 413 Request Entity Too Large error before PHP ever sees the file. No PHP change can fix that, because the request never reaches PHP.

To fix it, add a client_max_body_size line to your Nginx server block, inside the server section, and set it to match or exceed your PHP limit, for example client_max_body_size 64M. Then reload Nginx and test the upload again. On managed Nginx hosting you usually cannot edit the server block yourself, so open a support ticket and ask the host to raise client_max_body_size for your site.

What About the Cloudflare 100 MB Cap?

If your site sits behind Cloudflare, there is one more limit to know about. Cloudflare free and Pro plans cap single uploads at 100 MB, and no setting on your server can raise that cap. To upload a larger file, use FTP or your hosting file manager, which bypass Cloudflare completely, or pause the Cloudflare proxy for the upload. The official Cloudflare developer documentation lists the current upload limits for each plan.

Two Popular Tricks That Do Not Work

Many tutorials tell you to add a line to wp-config.php to raise the upload limit. It does not work. The wp-config.php file loads after PHP has already read its configuration, so by the time WordPress runs, the upload limit is already fixed. A define statement there can change WordPress constants, but it cannot change PHP ini settings.

If you see a tutorial recommending either of these tricks, skip it. The methods that actually work are the ones in this guide, because they change the configuration before PHP processes the request. If none of the methods here change your limit, the cause is almost always a host level cap that no user level file can override. Ask your host to raise the limit, or move to a plan that allows larger uploads. If you are comparing hosts, our web hosting guide explains what to look for in a plan before you sign up.

Multisite Networks Have an Extra Setting

If you run a WordPress multisite network, there is one more limit on top of everything else. The network admin can cap the upload size for all sites in the network, and that cap overrides the PHP settings. Go to My Sites, then Network Admin, then Settings, and look for the Max upload file size field. That value is in kilobytes, so a limit of 64 MB is entered as 65536.

Remember that the network setting can only lower the effective limit, never raise it above the PHP limit. If PHP allows 64M but the network setting is 10 MB, the subsites will show 10 MB. Both values must be raised together, or the limit will not change.

What Values Are Safe to Use?

Bigger is not always better. A very large upload limit lets anyone with upload access put huge files on your server, which eats disk space and can slow down backups. For most sites, 64M is plenty, because it covers large PDFs, high resolution images, and short videos. Sites that handle video courses or large design files may need 128M or 256M, and that is fine as long as the server has the disk space and memory to handle it.

  • Small blogs and business sites: upload_max_filesize 32M, post_max_size 48M, memory_limit 256M.
  • Media heavy sites and online courses: upload_max_filesize 64M, post_max_size 128M, memory_limit 256M.
  • Video heavy sites: upload_max_filesize 128M, post_max_size 256M, memory_limit 512M.
  • Never set post_max_size smaller than upload_max_filesize, or the smaller value wins.
  • Always keep memory_limit larger than post_max_size, or large uploads can fail with a memory error.

After you change the values, upload a test file that is close to your new limit and confirm it works. Then delete the test file so it does not waste space in your Media Library. Large media files also slow down your pages, so read our guide on WordPress image SEO tips to keep them fast and searchable, and our guide on how to lazy load images in WordPress without a plugin.

Frequently Asked Questions

Why is my upload limit still 2M after editing php.ini?

The usual cause is that you edited the wrong php.ini, or post_max_size is still smaller than upload_max_filesize. Check Tools, then Site Health, then Info, then Media Handling to see the real values PHP is using. If php.ini is not loaded for your domain, use the cPanel editor or a .user.ini file instead.

Can I raise the upload limit with wp-config.php?

No. The wp-config.php file loads after PHP has already set its limits, so a define statement there cannot change upload_max_filesize or post_max_size. Use the MultiPHP INI Editor, php.ini, .user.ini, or .htaccess instead.

What is the maximum upload size on Cloudflare free plans?

Cloudflare free and Pro plans cap single uploads at 100 MB, and no server setting can raise that cap. To upload a larger file, use FTP or your hosting file manager, which bypass Cloudflare, or pause the Cloudflare proxy for the upload.

How do I increase the upload limit on WordPress multisite?

Raise the PHP limits first, then go to Network Admin, then Settings, and raise the Max upload file size field, which is measured in kilobytes. The network value can only lower the limit, never raise it above the PHP limit.

Last updated: November 2026.

Hostinger - Get 20% OFF

Habib ur Rehman

Hello! I'm the founder of VU Tech Geek. As a BSCS graduate and experienced WordPress professional, I'm passionate about technology and education. My Virtual University journey has given me valuable insights and knowledge, which I love to share with fellow students.… More »

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker