1. ThemesMatic
  2. WordPress DIY
  3. How to Increase the WordPress Maximum Upload File Size – Effective Methods

How to Increase the WordPress Maximum Upload File Size – Effective Methods

increase file size wordpress

There are often times where you need to upload larger media files to WordPress for a variety of reasons. Once of those being installing a paid WordPress theme. Most WordPress themes will be above the default size limit of the media uploader. SocialMag Pro is around 22MB in size (since it’s a Pro Theme with a lot of features). For some reason, WordPress has a default limit on the size of files you can upload which is 8MB (8 megabytes). The way you can check this is to go to:

Media > Library > Add New or Media > Add New. On the bottom left you’ll see “Maximum upload file size: 8 MB.” if it is default or whatever its set to. This will tell you your upload limit on file sizes.

Some hosting companies change the file upload sizes by default and make them higher but if your hosting company didn’t increase the file size limit. If you call your hosting provider and ask them to increase this, most can usually do this for you.

If you would like to do this yourself, there are a few DIY methods that you can use to update this setting. These are the 2 most effective methods to successfully increase the maximum upload file size of your media uploads in WordPress.

  1. .htaccess file
  2. PHP Options in cPanel

For WordPress Developers you can also increase your file sizes locally on MAMP and WAMP.

Using .htaccess File to Increase Upload File Size

One of the easiest and fastest ways to increase your Maximum Upload File Size is to edit the .htaccess file and add 4 short lines of code. The .htaccess file is located in the public_html folder in your hosting account. The .htaccess file is a hidden file by default so to view these you may have to edit your settings. In any hosting using cPanel you can click “Settings”, click the checkbox “Show Hidden Files (dotfiles) ” and click “Save”.

Note: If your using Filezilla or another FTP software you can edit the .htaccess file there as well using similar methods.

At the bottom of your .htaccess file you can add the following code and save your changes:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

This will change your upload limit from 8MB to 64MB which will cover most (if not all) of files including themes you’ll need to upload and change the time it can upload to 300 seconds (5 minutes). You can check if this works by going to Media > Add New again and it should say “Maximum upload file size: 64 MB.” If this is the case your good to go and everything worked.

Using PHP Options in cPanel to Increase Upload File Size

In cPanel there is software to select your PHP version which will also give you a few options, including updating the file upload size. Go to ‘Select PHP Version”.

On the home screen of that software select “Switch to PHP options”. Here it will tell you what version of PHP your running and a list of other options. If your running PHP version 5 it would be a good idea to upgrade to version 7+ for speed and security as long as nothing on your WordPress site depends on PHP version 5. At any time you can go back to the default settings by choosing “Switch to PHP Extensions” then select “Reset to Default”.

Set “post_max_size” to 32M or higher and set “upload_max_filesize” to something equivalent or higher. The options I have for this example running PHP Version 7.2 were:

  • post_max_size: 32M
  • upload_max_filesize: 40M

After selecting your new settings, these are saved automatically and you can check this in the Media section again to see the update. This example says 32 MB is now the new upload limit.

If you’d like to reset them to their default settings after changing them, select “Reset to Default” links under both “post_max_size” and “upload_max_filesize”.

Increase Maximum Upload File Size on MAMP for Local Development on Macs

If your using the free version of MAMP here’s the step guide on how to do it manually.

  • Find out what PHP Version your using by opening your MAMP start page in your browser: http://localhost:8888/MAMP/index.php
  • Go to Tools > PHPINFO
  • Under the PHP logo it will tell you what version your using. Example” “PHP Version 7.3.1”
  • Now you know which php.ini file to edit. In your “Applications” folder go to: MAMP > bin > php > phpx.x.x > conf > php.ini (‘x.x.x’ is the version your using. Example: php7.3.1)
  • Open the php.ini file in your Code Editor.
  • Search for and update each of the 4 lines of code individually:
memory_limit =
upload_max_filesize =
post_max_size =
max_execution_time =

Once you have found each setting, update them to this:

memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 180

This will update your Memory Limit, Upload Max File Size and Post Max Size to 64 MB and the time it takes to upload to 180 seconds (3 minutes). You can set it to 0 for unlimited run time if you want, which may be helpful if your upload speed is slow.

If you have MAMP PRO its a lot easier:

  • Open MAMP PRO
  • Stop the servers if they are running
  • Go to Menu > File > Edit Template > PHPx php ini (‘x ‘is whatever PHP version your using)
  • The php.ini file you selected will now be opened
  • Search for “memory_limit” (without quotes)
  • Update the following line of code to 32M or 64M
    • memory_limit = 8M; Maximum amount of memory a script may consume (8M)
  • Restart your servers and you should be able to upload larger files

Increase Maximum Upload File Size on WAMP for Local Development on Windows

Updating these settings is very similar to MAMP. You just have to update your php.ini file. In Windows you can find your php.ini file under WampDeveloper > Config > Php > php.ini then find and update each setting to the following.

memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 180

If this article tutorial helped you out and saved a lot of time, write us a message below to tell us how things went and keep creating great things.

Share this on:

Discussion

All emails remain private. Required fields are marked *

*

How to Setup Your Social Network Links

SocialMag has social media network icons integrated into the theme. Setting these up is really simple and takes less than a minute. The social ...

Build the WordPress Magazine thats coded for SEO, Lighting Fast and Responsive with SocialMag PRO!

Buy SocialMag PRO