How to Change WordPress Max Upload Size

Change WordPress Max Upload SizeAre you looking for a way to increase the maximum file upload size in WordPress? In this post I will show you how Change WordPress Max Upload Size by editing the htaccess and also editing the php.in file to change the maximum WordPress upload size.

If you want to upload large files. It is important to check the maximum file upload size of your site. A low WordPress upload size limit will not allow you to upload some plugins or themes as well.

This can be an obstacle if you are building a media-heavy website.

If this is the case, you need to increase the max upload size in WordPress or your server (or both) in such cases.

How to Change WordPress Max Upload Size

There are many ways to solve this issue. We will cover them in this brief tutorial.

But first, let us learn how you can check the maximum upload size in your store.

Let us see how you can achieve this.

What Is the Maximum Upload Size in WordPress?

It is worth mentioning that uploading large files to a server consumes a lot of the server’s resources.

The default maximum upload size in WordPress typically ranges from 4 MB to 128 MB. This prevents users from causing server timeouts.

It is important to note that WordPress also includes constants that define this limit. However, they cannot override the server-level settings in most cases.

If you want to verify the maximum upload size in your WordPress site, log in as admin to access the WordPress dashboard.

Go to Media > Add New page and you will see the maximum file upload size limit for your WordPress site as shown below:max size

This is why the “exceeds the maximum upload size for this site” error occurs when you upload a large file. It can be frustrating, but it ensures security and efficiency.

It prevents site owners and malicious users from uploading huge files.

Ways to Change WordPress Max Upload Size

Here are some of the solutions:

1.    Theme Functions File

You can increase the upload size by adding the following code in theme’s functions.php file:

[php]@ini_set( ‘upload_max_size’ , ’64M’ );

@ini_set( ‘post_max_size’, ’64M’);

@ini_set( ‘max_execution_time’, ‘300’ );[/php]

2.    Create or Edit an Existing PHP.INI File

To use this method, you need to access your WordPress site’s root folder by using FTP. You can also access it using the File Manager app in your hosting account’s cPanel dashboard.

If you are using shared hosting, you will not see a php.ini file in your directory.

If you don’t see it, create a file called php.ini and upload it in the root folder:

[php]upload_max_filesize = 64M

post_max_size = 64M

max_execution_time = 300[/php]

3.    Htaccess Method

Alternatively, you can modify the .htaccess file in the root directory.

Add the following code in the .htaccess file:

[php] php_value upload_max_filesize 64M

php_value post_max_size 64M

php_value max_execution_time 300

php_value max_input_time 300

[/php]

Conclusion

In this post, we have shared some of the ways to increase the maximum file upload size.

It is important to note that some of the methods may not work if you are using shared hosting. If this is the case, please contact your web hosting provider.