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. Thanks! Been trawling through answers to this question for ages, all to no avail – and this worked instantly. Brilliant.

  2. Where exactly would I add that to my .htaccess

    Below is what is in there at the moment. How should it look after I add the code?

    Thank you so much.

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  3. Hi Thomas,

    Those are the WordPress rewrite rules for Pretty Permalinks, make sure you don’t erase those. Add the other code at the very top of the file (before #BEGIN WordPress) and you should be golden.

    Hope this helps 😉

Leave a Comment!

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