WordPress Media: Increase Maximum Upload File Size

Revised: 09/18/2012
In WordPress Media Manager, the default settings for “maximum upload file size” seem to come out different for each installation, depending on the server. Most often, the max size is descent enough to live with, but after a recent install was only offering an insultingly low 2MB, I figured it’s best to be prepared to increase this value quickly & painlessly.
* Note: There’s also a chance that your hosting provider has the security for these parameters locked down pretty tight. If you try all of these steps and nothing is changed, you may need to contact your host and ask them nicely to do this for you.

This modification can be implemented from either of 2 files: php.ini & .htaccess.

My examples will be increasing the file size to 30MB, so feel free to change this numeric value to your preference.


1. Locate a file called php.ini. If you have SSH access, that’s great. You may find it with this:
php -i | grep php.ini
Otherwise, logon to your server via your FTP client and look in the root folder, as well as public_html. If it doesn’t appear to exist, you can make one yourself by creating a text file and saving it as php.ini.

2. Insert the following text into the php.ini file:

memory_limit = 100M
upload_max_filesize = 30M
post_max_size = 30M
file_uploads = On

3. Place the modified file. There are a number of locations to place the file, and different things seem to work for different people. If you modified a pre-existing file, try putting it back where you found it. Of course I recommend what worked for me, which is placing it inside the /wordpress/wp-admin folder. This may also be desirable because it will only affect that area of your site.


Some hosts, such as Rackspace, seem to prefer this method. Locate your .htaccess file, likely found in public_html or equivalent, and add these lines:

php_value upload_max_filesize 30M
php_value post_max_size 30M
php_value max_execution_time 200
php_value max_input_time 200

wp-config.php modification

Adding the following code to wp-config.php has worked for some people, but may not always be necessary.

/* Increases max file size for uploads */
define('WP_MEMORY_LIMIT', '100M');


Be sure to cover each of these bases & to experiment with the location of the php.ini. One of these four locations should work: Root folder, public_html, wordpress (your wordpress install), or wordpress/wp-admin. In some cases, the .ini file may need to be renamed to php5.ini. Try both files in each location until the WordPress Media Manager reads “Maximum upload file size: 30MB”. Like I said, your host ultimately has control over whether or not this increase will be allowed. So, if all else fails, you’ll need to ask for their assistance. Good luck!

Leave a Comment