WordPress have its own awesome media section. Which always help you to upload images, documents, audio and videos. There are specific formats of allowed file types in WordPress. However you can easily upload files in media or while adding post or page. But sometime Maximum File upload size becomes an issue.
Let’s try to understand when it becomes and issue maximum file upload size. First of all you should understand Maximum File Upload size is handled by your server administrative by default. So some hosting providers allow 2 MB upload limit some 16 some more. So what if you have maximum upload size only 8MB its fine to upload images, documents and audios. But when you want to upload big files like videos or xml big files. This does not suits you and make a problem its where you want to increase the size of upload file size for your WordPress media.
How to check WordPress Maximum Upload file Size
While you can check WordPress maximum upload file size limit on uploading screen. If you are not able to check the size of maximum allowed file size. To check it you can simply go to Media » Add New page and below upload file you can see the allowed upload size.
Note: Every server handle Maximum file upload size differently and every host enable you to modify that in different ways. If no option from given options help you we recommend you to reach your hosting provider.
Via Theme Function or wp-config.php file
The functions below are actually PHP functions which force your PHP to override the settings of .ini file and grand new settings for maximum upload file size. You can either place this code in start of your theme’s function.php or you can place it in wp-config.php file.
To Place in function.php
Just sign in your wp-admin and go to appearance >> editor then select functions.php from files displaying on right side. If your server settings do not allow you to update funcitons.php from wp-admin. You can sign in the FTP and download functions.php file from root /wp-content/themes/yourtheme/functions.php
To Place in wp-config.php
For placing this code in wp-config.php sign in FTP download wp-config.php and write following code on top. Re upload file and that’s it. You can also use cPanel file manager to edit and update the wp-config.php file.
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
Via php.ini file
If you are using xampp or wampp on your local host you can easily locate php.ini file. For live or online servers if you are on shared hosting then you would not able to access this file. In shared hosting scenario we recommend you to try first method. Access your php.ini file through FTP or via cPanel file manager it can be found in root if you have access or ask your hosting provider where to find this file. Every host is different and provides different locations to files. Once you find the file you can insert following code in php.ini file.
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
Via .htaccess file
Most shared servers which do not provide you direct access to php.ini file do take php.ini commands from .htaccess as well. This is just a way hosting company want to provide you access to settings. So its worth to try this method as well. In most cases .htaccess file is hidden in file manager via cPanel or hosting control panel. By going to settings in file manager you can enable to display unknown extensions as well. Otherwise best way is download .htaccess from WordPress root via FTP its easy and straight. Once you download .htaccess file edit it and place this code in top of file.
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
Since php have released many new versions in last 5 years. And people who are still running software of old supported php version want to use older php versions. While new users want to use latest php versions. That’s reason many web hosts have given this option to users in cPanel. You can also try by Sign in cPanel and search for PHP selector if you find. First of all select at least 7.0 PHP version and then you can also edit php.ini or setup php.ini file from settings there.
If you are not sure why or how something needs to make happen. Please leave me a line i would be happy to help you. If you like this article or this article helped you to save time. Please share it with your friends. Thanks
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?