Increase Maximum File Upload Size WordPress

A very common question is how to increase Maximum File Upload size in WordPress. Actually in this tutorial we will learn what is Max File Upload size and what is the upload limit provided by most of the hosting provider and how to increase those upload limit for WordPress as well as in PHP. Depending on the hosting plan and hosting provider it media upload limit may vary. In a regular manner we found that most of the users have maximum upload file size: 2 MB.

It is not quite sufficient sometime and then we need to increase maximum file upload size. In case of audio, video or WordPress plugin upload maximum time we face this type of problem. It can be done in different ways. Let’s start learn how to increase maximum file upload size WordPress.

default maximum upload limit in WordPress

Increase Maximum File Upload Size WordPress

First of all this is a basic tutorial about increase file upload size WordPress. But it’s not working sometime depending on your server restriction and shared hosting settings. In such cases you will get help from your hosting provider to increase the maximum file upload size.

After increase max upload file size WordPress.
increase max upload file size in wordpress

1. Modify WordPress Theme function.php

If your hosting provider give you max file upload size greater than 2 mb but in WordPress you can not upload more than that or get error like exceeds the maximum upload size for this site. Then you can try these changes. Just modify your theme function.php with below lines of code for increase upload media size and check.

@ini_set( 'upload_max_size' , '8M' );
@ini_set( 'post_max_size', '8M');
@ini_set( 'max_execution_time', '500' );

The above code represents that if your hosting provide file upload limit more than 2 MB then you can modify the maximum upload file size in WordPress also.

2. Modify in PHP.INI File

In most of the cases it is working very well. But the main thing is for shared hosting you can not find the PHP.INI file where you have to define or change the max upload size in php. For such situation you have to create your own php.ini file in your root directory and add the below code.

; Maximum allowed size for uploaded files.
upload_max_filesize = 10M
; Must be greater than or equal to upload_max_filesize
post_max_size = 10M

3. Modify in .htaccess File

Sometime developers use htaccess file upload limit and modification on that file to get it work. And this is one of the way you can increase the maximum file upload size in WordPress.

php_value upload_max_filesize 10M
php_value post_max_size 10M

In this ways you can increase maximum file upload size WordPress. But for shared hosting users this tricks may not work sometime and you can take help of your hosting provider for such situation. Thanks for watching. Share and like will be appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *