How To Increase the Maximum File Upload Size in WordPress

The easiest way to modify your file upload limit is to install a simple WordPress plugin designed for the task. There are many options available. We recommend the following plugins:

Simply install a plugin, activate it, and follow the instructions.

Functions.php

This method requires copying and pasting some code into the functions.php file, which is included in all WordPress themes.

Add this code at the bottom of the file, changing the numbers to your desired upload size. The M stands for megabytes, so if your file is 120 megabytes, change the settings to be equal to or greater than 120M.

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

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

@ini_set( ‘max_execution_time’, ‘300’ );

Php.ini File

The php.ini file controls many of the settings for your web host. By adding a few lines of code to it, you can modify the file upload limit.

Php.ini should be in the root directory, or top level, of your site. You can access this directory via FTP/SFTP, a file manager WordPress plugin, or CPanel. By default, it is not accessible directly from the WordPress admin panel.

upload_max_filesize = 12M

post_max_size = 13M

memory_limit = 15M

.htaccess file:

The .htaccess file is a tool that controls the web server. As with the php.ini file, it should be located in the root directory, which is the top level of your website.

Once you’ve connected to your site and located the file, add this code to the bottom of it, modifying the number to suit your needs:

php_value upload_max_filesize 60M

php_value post_max_size 60M

php_value memory_limit 15M

wp-config.php

The last method is similar to the previous two. This time, we’ll be modifying the wp-config.php file, which is usually in the top level directory (root) of your site. Simply add this code to the bottom of the file, changing the numbers to suit your needs.

@ini_set( ‘upload_max_size’ , ’35M’ );

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

@ini_set( ‘memory_limit’, ’15M’ );

Leave a comment

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