How to increase WordPress maximum file upload size?

If you have a website then you need to upload files, audios or videos every now and then. So the file size may vary according to type of that file. The default file upload size for any WordPress website is 2mb. Which is enough for uploading images. But you need way more limit than 2mb. For uploading videos or audio files you need bigger limit.

There are few different ways to increase max file upload size limit. For beginners, there three are simple and easy ways to increase file upload limit. Try any of them and one should work with your website.

Create php.ini file or modify existing php.ini file:

follow these simple steps to increase limit

  1. login to cpanel of your domain, e.g, www.[domain name].com\cpanel
  2. then go to file manager
  3. double click on public_html file
  4. look for a file ‘php.ini’, if it doesn’t exist then you have to create one by clicking on +file at the top left corner of the window.
  5. After creating php.ini file, then select that file and click on edit.
  6. Once your are in editor write the following code to it
  • upload_max_filesize = [MB]
  • post_max_size = [MB]
  • max_execution_time 300

this should work with your website.

Modify .htaccess:

if the first process doesnt work then try this way. It is also very simple and easy process. Just follow the following steps and you will get desired upload limit.

It involves same almost same steps, but here you don’t need to add or modify php.ini. You need to edit or create .htaccess file. Like:

  1. login to cpanel of your domain, e.g, www.[domain name].com\cpanel
  2. then go to file manager
  3. double click on public_html file
  4. select .htaccess file and click on edit
  5. now add these commands to this file :
  • php_value upload_max_filesize [MB]
  • php_value post_max_file [MB]
  • php_value memory_limit [value must be equal or greater than file size]
  • php_value max_execution_time 180
  • php_value max_input_time 180

this works for most of the websites.

Editing WordPress theme:

If these two processes don’t work then try this method to increase upload limit. Follow these simple steps;

  1. from WordPress dashboard, go to appearance and click on editor
  2. once you are in the theme editor. At the right side there is an option ‘theme function’

click on theme function and scroll down to the end of that page.

  1. Now at the end of that function page, write this formula, as shown in the above image,
  • @ini_set ( ‘upload_max_filesize’ , ‘[MB]’ );
  • @ini_set ( ‘post_max_size’ , ‘[MB]’ );
  • @ini_set ( ‘max_execution_time’ , ‘300’ );

These are the three simple methods to increase file upload file size limit. I have tried these methods and they worked for me perfectly. They will work for you as well. Try one at a time. don’t try all of them.

these methods with pictures is attached as PDF file. view or download file below: