October 18, 2019
October 18, 2019
Having trouble uploading files to your WordPress site due to the size limit? If that’s the case, you’ve come to the right place. In this article, we’ll show you how to increase the size limit by modifying the PHP maximum upload size.
The standard maximum upload size in WordPress may vary depending on your hosting provider. Usually, it’s ranging from 5 to 128 MB.
Most of the time, 128 MB is enough if you only need to upload a short video or a picture. However, if you want to upload a longer video, you may need to increase the maximum upload size.
That goes double if your maximum upload size is only 5 MB. You won’t be able to install a theme or plugin, considering most plugins go beyond 5 MB these days.
On the other hand, if the size limitation is set too large, someone else may upload a large file that takes a lot of your storage. In this case, you may want to decrease the PHP maximum upload size to prevent that from happening.
In most cases, you can change the PHP maximum upload size by editing a file named php.ini. However, if you’re using Hostinger’s shared hosting plan, you don’t have access to the said file. Instead, you’re allowed to configure most of the PHP values from the .htaccess file.
php_value upload_max_filesize XXM php_value post_max_size XXM
You can also edit the .htaccess file via an FTP client like FileZilla
After changing your PHP maximum upload size, we need to check the current size limit with the phpinfo() function to make sure that it’s already changed.
Simply create a new PHP file on the public_html directory of your WordPress site and insert the following code:
<?php phpinfo(); ?>
You can name the file with anything you want. In this case, we name it phpinfo.php.
To access the file we just created, just ad/phpinfo.php to the end of your site’s domain (http://yoursite.com/phpinfo.php).
You’ll see two columns — local value and master value. Local value is set within the .htcaccess and overrides the master value, which is set within the php.ini. Therefore, pay no mind to the master value and seek the local value for upload_max_filesize and post_max_size instead.
If the local values of both parameters are the same as the one you set earlier, then you have successfully changed the PHP maximum upload size for your WordPress site.
You’ve learned how simple it is to change the PHP maximum upload size on WordPress. You can increase the limit when you’re uploading a large file or decrease it a little bit to prevent other users from taking too much space of your storage.
Why don’t you give it a try?
May 14 2017
Sorry but it's still not working.
Replied on August 23 2019
November 21 2017
It freaking worked. Thanks a ton
April 26 2018
method 3 has worked for me thank you very much
Replied on April 28 2018
Hey THOMAS, Glad it helped you!
July 20 2018
Very helpful post. Thank you very much!
August 16 2018
Thank you! The first option worked for me.
September 25 2018
Thank you! The 3rd method worked for me, I appreciate it.
October 05 2018
It worked by using method 3. Thanks!
November 24 2018
perfectly worked for me 2nd method.
February 13 2019
Thanks alot,method 3 worked for me...
May 04 2019
This solution work for me in laravel.
May 12 2019
Really appreciate this tutorial. Thanks for making it.
May 13 2019
I have created a plugin which makes it much easier to change php settings directly from within the Wordpress administration: https://wordpress.org/plugins/custom-php-settings/
August 02 2019