How to Increase Maximum File Upload Size in WordPress

The maximum file upload size limit for your WordPress installation depends on both your web server's configuration and WordPress settings. You must take care of both if you want to increase the limit. If you receive errors such as "The uploaded file exceeds the upload_max_filesize directive in php.ini", it usually means you need to increase the limit.

To increase the maximum file upload size in WordPress, you typically need to edit the "php.ini" file or the ".htaccess" file or the "functions.php" file of your active theme. Here's how you can do it:

Method 1: Editing php.ini:

The maximum file upload size can be directly increased in the "php.ini" file on your server if you have access to it.

Find the line that sets "upload_max_filesize" and "post_max_size". Increase the values to your desired file size limit. For example:

upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 300

Change 256M to the maximum file upload size you want, e.g., '512M' for 512 megabytes. Once the modification is made, save the php.ini file.

Method 2: Editing .htaccess

Also, you can increase the maximum file upload size by editing the .htaccess file in your WordPress installation directory. Add the following line:

php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value max_execution_time 300

Replace 256M with your desired maximum file upload size limit. Save the .htaccess file after making the change.

Method 3: Editing theme's functions.php:

Add the following line of code to your active theme's functions.php:

@ini_set( 'upload_max_size' , '256M' );
@ini_set( 'post_max_size', '256M');
@ini_set( 'max_execution_time', '300' );

You can replace '256M' with the maximum file upload size you want. Save the functions.php file after making the change.

After making any of these changes, navigate to Tools > Site Health > Info in your WordPress admin dashboard to verify if the maximum file upload size has increased. To confirm the new limit, look for the entries under "Server" for "Upload max filesize" and "PHP post max size".

Note:
Remember that due to server resource limitations, you might not be able to increase the maximum file upload size in some shared hosting environments beyond a particular amount. You should ask for help from your hosting provider if you run into any problems or have any questions.

Our WordPress Themes

Below are some of our premium WordPress themes. View all our free and premium WordPress themes →
NeatMag PRO WordPress Theme

NeatMag PRO

Do you like the NeatMag Free WordPress Theme?, Then you will love the premium version. NeatMag PRO is very user...

$25.00
GridMode PRO WordPress Theme

GridMode PRO

Are you using the GridMode free WordPress Theme and looking for more advanced features? GridMode PRO theme is developed for...

$35.00
BoxWP PRO WordPress Theme

BoxWP PRO

If you like BoxWP free WordPress Theme, you will love the premium version. BoxWP PRO is an elegant, user-friendly, feature-rich,...

$25.00
HotWP PRO WordPress Theme

HotWP PRO

If you like HotWP free WordPress Theme, you will love the HotWP premium version. HotWP PRO is easy to use,...

$30.00
ElegantWP PRO WordPress Theme

ElegantWP PRO

If you like ElegantWP free WordPress Theme, you will love the premium version. ElegantWP PRO is very user friendly, feature-rich,...

$30.00
GalleryWP PRO WordPress Theme

GalleryWP PRO

If you like GalleryWP free WordPress Theme, you will love the premium version. GalleryWP PRO is an improved version of...

$25.00
CoolWP PRO WordPress Theme

CoolWP PRO

If you like CoolWP free WordPress Theme, you will love the premium version. CoolWP PRO is very user friendly, feature-rich,...

$30.00
WP Masonry PRO WordPress Theme

WP Masonry PRO

If you like WP Masonry free WordPress Theme, you will love the premium version. WP Masonry PRO is an improved...

$25.00

Can't you choose a single theme? Purchase All Themes for $100.

Save money with our low, one-time price for access to all of our 54 WordPress themes.