How to change the PHP Upload Limit

- by

Usually your hosting package limits the amout of data you can upload to 2MB, which isn’t enough for most of us. It’s good for that 200k photo, but say you’re uploading a 4MB audio clip, a video or a large PDF, you’re stuck.

Fret not my friends, for help is at hand! Put the following code in your .htaccess file and smoke it:

php_value upload_max_filesize 100M
php_value post_max_size 100M

Instead of “100M” you can choose any limit you like, say 5M, 10M or whatever limit you like.

If you can’t find the .htaccess file, it might either be that

  • your FTP client doesn’t display hidden files; make sure that it does
  • or it doesn’t exist (in which case, create a plain text file, upload it and name it .htaccess)

If you’re having trouble, just download this file. Then simply unZIP it and upload the contents into your WordPress directory. Once it’s on the server, rename it to .htaccess and you’re done.

Good luck 😉



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

23 thoughts on “How to change the PHP Upload Limit”

  1. I’m sure you hosting company can increase this for you – if not via .htaccess then maybe there’s another way. Having said that, shared hosting is a finely tuned ecosystem so I do understand that they want to keep the caps on how much RAM each user can use. Who are you hosting with? Unlimited is probably referring to disk space rather than system memory 😉

    You can upload larger files via FTP and then link to them manually. It’s not as convenient as uploading them from the WordPress backend, but works with files as large as your web space allows. Search for FileZilla, that’s a free FTP client. Upload your files to wp-content/uploads for example and access them like this: http;//yourdomain.com/wp-content/yourfile.mp3

    Hope this helps 😉

  2. Thank you Jay! I’ve been searching the internet for a solution. Editing the .htaccess file did not work for me either (I got the internal error message). I don’t know why I did not think to just upload it via an FTP program, but this makes perfect sense!

Leave a Reply to Jay VersluisCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.