How to Increase or decrease the upload size limit files in WordPress

How to Increase or decrease the upload size limit files in WordPress: In order to increase or decrease the size limit of the upload of files in WordPress, we have several options or ways, among which are the following:

Important! – It depends on the configuration of your hosting / server, or the PHP version of it, it may be that the modifications in the .htaccess do not take effect and yes in the .php.ini (as for example in accommodation with PHP-FPM )

1.- .htaccess – (modification of this file in the root of the hosting, www or public_html folder)

In case we do not have any defined value, we must add or modify these 2 lines:

php_value upload_max_filesize 12M
php_value post_max_size 12M
php_value max_execution_time 300 #is not important
php_value max_input_time 300 #is not important

Save the changes and try again.

2.- .php.ini – (modification of this file in the root of the hosting, www or public_html folder)

; Maximum allowed size for uploaded files.
upload_max_filesize = 12M

In case modifying the .php.ini version does not come into effect, you have 2 more options:

Edit a .php.ini file inside the wp-admin directory and place these lines:

memory_limit = 64M; // To increase the memory limit
max_execution_time = 7200; // Increase the waiting time
upload_max_filesize = 20M; // increase allowed size of files to uploadpost_max_size = 20M; // increase post size

Ask your hosting or hosting provider to eliminate that limitation or have it modified by you. In many cases when you have shared hosting, you may not have access to these options.

3.- wp-config.php – (modification of this file in the root of the hosting, www or public_html folder). Less recommended method. Last option and the oldest. Generally it does not usually work in the most recent versions of WordPress, but to test, we offer this last option, open file edit it and add the following line:

define (‘WP_MEMORY_LIMIT’, ‘128M’);

4.- Hosting provider

In case you have tried the previous 3 and not of result, contact your supplier directly to request the modification or deletion of said limit.

5.Use plugin

https://import.wp-migration.com

Aso you can use below filesize:

1. php.ini codes
===============
upload_max_filesize = 256M
post_max_size = 256M
memory_limit = 256M
file_uploads = On
upload_max_filesize = 128M
max_execution_time = 300
max_allowed_packet_size = 524288000

2. .htaccess codes
===================
php_value max_input_vars 5000
php_value max_execution_time 300
php_value post_max_size 128M
php_value upload_max_filesize 128M
php_value memory_limit 256M

3. wp-config.php code
=====================
define( ‘WP_MEMORY_LIMIT’, ‘128M’ );

Leave a Reply

Close Menu