One advantage about WordPress is the ability to host your files in your WordPress site but sometimes some users may be limited in uploading large media files. This might be due to cheap hosting plan which may be limited by the WordPress web hosting company so as to make good usage of your available disk space. The default WordPress file upload size is 2 MB, this is also applicable with the PHP memory limit that run plugins and scripts. Hosting your files in other free file manager site is not advisable and professional because you can be restricted in the duration and size in which your hosted file will last, so there is need hosting files in your website. You will receive error message like “The uploaded file exceeds the upload_max_filesize directive in php.ini.” when trying to upload a file above the default file limit. You can view your WordPress default upload file limit by logging your WordPress Dashboard > Media > Add New section.
How to Increase the Upload_max_filesize in WordPress
There are various ways of increasing the default file limit in your WordPress. These includes:
1.Modifying .htaccess file
Every cpanel has a default .htcacess file located in the file manager of your cpanel host.You can easily modify the .htaccess file by logging your Cpanel of your WordPress Host. Click on FILES > File Manager and navigate to the root folder( ensure you checkbox for Show Hidden Files ).
Locate a file called .httaccess usually found in the root f
php_value upload_max_filesize 12M php_value post_max_size 13M php_value memory_limit 15M
You can the values to suit your taste. Advised not to increase it to more than 50M(megabytes) for cheap Web Hosting plans. If the above method fails to work then you can use the method below
2. Editing php.ini file
Most php.ini files are restricted by the Hosting servers and might give permission to edit only for VPS or dedicated Server Hosting and not shared hosting.
Login to your cPanel, under the Files section, click on the File Manager button (Make sure the checkbox for Show Hidden Files).
Select your wp-admin folder and locate the php.ini or php5.ini file(located at /etc/).
If you don’t find one, create by clicking the New File button on the top left corner, naming the file php.ini or php5.ini. and Click the Create File button on the pop-up.
Modify the file with the settings below:
upload_max_filesize = 12M post_max_size = 13M memory_limit = 15M
Change the upload, max size and memory limit to the value with which you wish.
3. Increase WordPress Memory in wp-config.php
If the above methods doesn’t work for you, then you can increase the WordPress Memory limit manually by yourself.
Locate the WordPress folder in the File manager, and edit the wp-config.php file in the root folder by adding the below code below of wp-config.php (right before the “happy blogging” line):
4. Set theme functions.php
You can also increase the maximum upload limit by editing the WordPress theme functions.php. You can locate your theme functions.php by viewing Cpanel>>File manager>>public_html>>wp-content>>themes…
Select the theme you are currently using and add the below code into the functions.php file:
@ini_set( ‘upload_max_size’ , ‘128M’ );
@ini_set( ‘post_max_size’, ‘128M’);
@ini_set( ‘max_execution_time’, ‘600’ );
5. Contact WordPress Hosting Support
If you feel the above methods are too tedious or the above methods failed to work, then the bet solution is contacting your WordPress Hosting Support. They can configure it manually from their server because they might have limited you due to your Hosting plan purchased.
You can easily upload media files like videos,music, pictures with your WordPress without using any plugins. This helps you to host your files yourself and make your site look professional when visitors download contents from your site directly instead of being redirected to online file manager sites to download from. If you wish to upload files larger than 128M(Megabytes), you can upload your files via FTP or cPanel.
If you are confused or having issues, don’t hesitate to ask questions using the comment section belo.