WP upload limit – This is a tutorial on how to upload large images and files on WordPress and WordPress MU – increase the upload limit.
Here’s how to blow through the top 4 limits that you need to change before you can upload a large image file to WordPress for file uploads:
4) WordPress itself which has a default upload file size of 10Mb. This is for WordPress MU only.
Standard WordPress blogs at wordpress.com had 15MB and now 25MB limits (mid-2008), not including any images you use for your templates, those limits are just for you to store your images and files, 300KB for any individual file uploads (mid-2008).
The self hosted version of WordPress that you install is similar to WordPress MU, which is what I have experience with, if you have any doubts as to which of the 3 WordPresses I’m referring to, it’s self-hosted MU by default.
WordPress MU may look similar, but is a different animal altogether on the backend. You have much more control over every aspect of your wordpress blog with WordPress MU.
WordPress MU file size upload limit: from here on I am talking about WordPress MU, but the same applies to WordPress self-hosted.
If you are using MU, then you are storing your website on a host somewhere on the internet. This applies to your hosting account. If you don’t have direct control, it’s ok, just copy and paste these requests and email them to your webhost.
1) First limit is usually 3 Mb by default and is changed in the php.ini file at the host level.
Place this in your php.ini file in your root directory of your WordPress install (usually /public_html)
memory_limit = 32M
upload_max_filesize = 100M
upload_max_filesize = 100M
post_max_size = 100M
note: 100M is entirely too much for most use, this is to enable an upload of the largest file size possible through a web page!
upload_max_filesize=5M and 20M
2) I also had to do this to get the php interpretor to recognize the change and allow large files to be uploaded by adding this to the .htaccess file also in the root directory of my webserver for WordPress:
SetEnv PHPRC /home/yourusername/public_html
A temporary way to increase PHP’s memory is to add this to your PHP script, I prefer to set it above:
You need to add the file type association (windows terminology) as a “Mime Type” (linux server terminology) to the Apache server, or IIS if you’re doing windows hosting (let’s hope you’re not, linux beats windows hosting all day, every day, so far forever)
Find out what Mime Type you need to declare your new file as. ie. myfile.psd is a photoshop file, you probably know this, but your hosting server may not! Look up your file type here, w3schools is a great reference for all website code information, I use them all the time and consider them the authority on the subject of web code and standard ways of doing things.
To do this in WordPress MU use the Admin backend:
"Site Admin"->"Options"->"Upload File Types:" just type in the file extension of the type you want to add with a space separating each extension, no periods here!
I started doing this using pjw-mime-config WordPress Plugin, which will allow you to upload a file with tons of Mime Types already declared for you. WARNING! I found that it added as many listings for each Mime Type to a critical WordPress screen:
Site Admin->Blogs->Edit->scroll down and you’ll see a setting for each mime type you’ve added, in my case I had more than 100! Do you want to crash your blog? After disabling PJW Mime types, I still have a super long Blog Edit Screen, it didn’t remove the data, each entry is non-editable for the respective extension (.tif, .psd, etc.) and says
SERIALIZED DATA. I decided to use the standard WordPress way of doing it in the future, until I know how to undo this Plugin. Please post a comment if you know how. Update, you can remove mime types to the functions.php file in wp-includes directory at about line (1069).
4) This is for WordPress MU only. Next limit is not php, but WordPress itself which has a default upload file size of 10Mb, increase this in the Admin backend:
"Site Admin"->"Options"->Blog upload space" 1000MB is 1Gb
"Site Admin"->"Options"->Max upload file size:" 100000KB is 100Mb (this is the size of any individual file upload)
After doing this you should be able to upload anything up to 100 Mb for individual files and 1Gb for total storage for any user’s blog on the entire domain of your WordPress MU install.
After doing this you will likely run up against the limit of whatever hosting company you have your user account on, which is the account that WordPress is running on. Keep an eye out, it is either limited or you may get charged for extra storage space when your monthly hosting bill is due!
After making the changes above, I’ve been running some tests and running across a new limit. First my webhost says (and many do say this) there’s a 15Mb limit for PHP HTTP uploads. That’s 15 Megabyte limit for uploading files through a webpage to your server account not using FTP. Now I’ve got up to around 170 Mb through HTTP uploading and am hitting a different limit. First one is file types, large images are no problem, large audio files depend upon the format, even though the file types have been added to the server as Mime types. Same problem with alternate image types like .psd photoshop files, the error at the end of the WordPress upload right after “crunching”, is “File type does not meet security guidelines. Try another.” Renaming the same file to .jpg mitigates that problem, however I haven’t found an easy way to rename the file back to .psd using the HTTP upload interface (the upload webpage)
php ini files are simple and easy once you have your FTP connected. Have fun!