1. Home
  2. Knowledge Base
  3. Getting Started Questions
  4. How to increase Your Upload File Size Limits

How to increase Your Upload File Size Limits

Unfortunately some hosting companies set certain file upload limits on uploading files via WordPress to your website.  This guide will show you how to increase these limits.

Beginners Note: This guide is a little technical in nature, so if you are not sure what to do, please contact our support team instead with your site URL, your WordPress Administrator logins, and your FTP details and we will happily install OptimizePress on your site for you.

Some web hosts just will not allow some php variables to be changed. If you try changing them through your php.ini, php5.ini or .user.ini and you still find that they do not change, we would suggest reaching out to your web host to find out how to best make these changes.

Also, before attempting any changes on your own, we would advise backing up any files that you intend to edit just in case you do something wrong and need to restore it.

Method 1: Editing PHP.ini file (Not always the best method)

If you have a PHP.ini file installed in the root of your hosting directory you can edit this file (in cPanel it would be public_html folder in most cases).

There are to variables that should be edited

upload_max_filesize AND post_max_size

For best results, we suggest changing the limits to at least 32MB, so this is how they should look when you edit them:

upload_max_filesize = 32M
post_max_size = 32M

Note that in most cases, making changes directly to the php.ini file may take some time – or might not even update until the server is rebooted, so it is not always the best method to change this file.

Method 2: Creating a .user.ini file (works in most cases)

Most hosting companies these days are compatible with another type of file that you can create for your server username called a .user.ini file (note that there is a “.” before each part).

You can create this file through FTP or a file manager (such as cPanel). After you create the file, just edit the file and include these two lines:

upload_max_filesize = 32M
post_max_size = 32M

Important note: In some cases you may need to clear your site cach (if you have a caching plugin) and then logout of your wp-admin, clear your browser cache, and log back in before you see the changes. We have seen some hosts take a few minutes also before the changes show.

Method 3: Using your .htaccess file to modify php variables

If the above methods don’t work, you can try one last thing. You can edit your .htaccess file (please take a backup of this file first).

Just add the following to your .htaccess file:

php_value upload_max_filesize 32M

php_value post_max_size 32M

Please note that if your host doesn’t allow these to be changed in the .htaccess file your site may show “500 internal server error” when trying to view the site after doing this. If that happens simply remove those lines from your .htaccess file and your site should come back live shortly.

If you still have problems with the upload limits after trying these then we would suggest reaching out to your web host for further help as this is a server setting and is not something we can change from our side if these methods do not work for your hosting account.

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
Contact Support