How to Increase the Maximum Upload File Size in WordPress: 3 Ways + Reasons to Do it
Are you unable to upload large files to WordPress? We’ve got you covered! Here, we will uncover how to increase the maximum file upload size in WordPress. By the end of the article, you will know how to modify the upload limit to meet your needs.
Three Ways to Increase WordPress Maximum File Upload Size
To modify WordPress’ file upload size, you need to access your hosting control panel and WordPress administrator dashboard. Make sure you have access to both of them before diving into the tutorial below.
Here are three ways to increase WordPress’ maximum file upload size:
1. Modifying .htaccess File
Many hosting providers allow you to change the PHP settings via .htaccess file. You can take advantage of this ability to apply php_value upload_max_filesize rule in this file.
Here’s how this method works:
- Access the WordPress root directory (public_html) via an FTP client or File Manager. For Hostinger users, you can access the File Manager in your hPanel dashboard.
- Open the .htaccess file and add the following code to the bottom of the file. Once you’re done, save the changes.
php_value upload_max_filesize 128M php_value post_max_size 128M php_value max_execution_time 300 php_value max_input_time 300
2. Configuring php.ini File
This method is most suitable for WordPress sites with VPS hosting as shared hosting providers generally don’t allow editing the php.ini file. If you’re running on shared hosting, make sure to contact your hosting support team and clarify whether or not you can modify the php.ini file.
Here’s how to increase the maximum file upload size by configuring php.ini file:
- Access the WordPress root directory (public_html) via an FTP client, File Manager, or SSH (if it’s supported), then open the php.ini file. If you cannot find the file, create one under the same name and filetype in the root directory.
- Add the following code to the php.ini file and save the changes.
upload_max_filesize = 128M post_max_size = 128M max_execution_time = 300
3. Editing functions.php file
Alternatively, you can increase WordPress’ maximum file upload size by modifying your theme’s functions.php file. Despite so, please note that the modification will revert to default if you change your site’s theme.
Here’s how to change the maximum file upload size by modifying functions.php file:
- From your WordPress dashboard, navigate to Appearance -> Theme Editor.
- Open the theme functions file (functions.php) and add the following code to the file. Once you’re done, save the changes.
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
Reasons to Increase WordPress Maximum File Upload Size
WordPress provides a built-in media uploader. It saves you time as you don’t have to connect with FTP clients or use a File Manager from your hosting provider. Despite so, the PHP-based uploader has an upload limit for maximum file size. The upload file limit may vary depending on your hosting provider and WordPress configuration.
You can check your WordPress upload file limit by navigating to Media -> Add New from the administrator dashboard.
While the maximum upload file limit is more than enough to accommodate regular use, there are cases where you may need to upload large files. This can be problematic as uploading files bigger than the allowed size results in ‘the uploaded file exceeds the upload_max_filesize directive in php.ini’ error.
Despite enforcing a maximum file upload size, WordPress allows you to increase its limit. The tutorial above shows that there are multiple ways of increasing WordPress’ maximum file upload size. If these methods don’t work for you, it’s best to reach out to your hosting provider and let them alter it for you.
Find More Advanced WordPress Tutorials
Increase Memory Limit
Modify PHP Max Upload Size
WordPress Page Builders
What Is a Pingback
June 19 2021
How to increase the description character limit in WordPress website? I want to write at least a thousand 2000 characters
September 14 2021
Hi there! Could you clarify which limit exactly do you have in mind? If you mean meta descriptions for your pages and posts, it is defined by your plugin (most likely according to Google recommendations). So in that case, you should check with your plugin developers to see if it can be increased.
September 26 2021
Hi, quick comment to let you know that the child function option does not work anymore with recent php versions. This is due to changes to what configuration settings can be set where. The upload_max_size and post_max_size options are restricted to be set either in php.ini, .htaccess, httpd.conf or .user.ini files. Kind regards, Aron
September 28 2021
Hi Aron, I've just tested this on PHP version 8.0.7 and it seems to be working well. However, you should bear in mind that if you're limited by your host to a certain value, you will not be able to set more than their fixed value (though you should be able to set a lower value). You can test it out to be sure using an info.php file :)
August 13 2022
all in one wp migration plugin not shown in dashboard, although I am using paid plugin
August 19 2022
Hey there! If you have All-In-One WP Migration plugin installed on your site, you will be able to access the plugin from your WordPress Admin Dashboard, it will be visible on the left side menu. You can check out this resource to learn how to use the plugin 😊