Blog Menu

I write and curate content for Bluehost. I hope this blog post is helpful.
Are you looking at creating a blog, website or an online store? Bluehost has something for everyone. Get started today.

If you’ve ever run into an error while trying to upload media, install a large theme, or add a hefty plugin to your WordPress site, you’re probably familiar with the frustration of hitting the maximum file upload size limit. The default settings in WordPress restrict the size of files you can upload. This can be frustrating when you need to work with large media files or themes. Such restrictions can slow down your process, impacting everything from uploading images to configuring essential features on your site. 

In this guide, we’ll show you some simple and effective methods to boost the file upload size in WordPress, making your workflow smoother. Whether you’re comfortable editing a php file, tweaking the .htaccess file, or using a plugin, you’ll find a method that works for you to remove that file size limit and upload larger files smoothly. Let’s get your WordPress site running without a hitch!  

Method 1: Contact your WordPress hosting provider   

To enhance the size of the highest file that can be uploaded in WordPress, the best method is to connect with your hosting provider. It will save you from having to deal with code snippets or server setup like turning .php or the .htaccess file down your way.  

If you’re a Bluehost user, log into your Bluehost user account, and select the ‘Chat’ icon located at the bottom of the page. From here, you can ask the support team to increase the maximum upload file size for you. 

 This quick method will remove the need to use technical settings such as the maximum upload size limit of your site. This way, you can either upload big files or switch between different versions very comfortably.   

 Method 2: Create or edit the php.ini file  

Another effective way to increase the ultimate file upload size in WordPress is by creating or editing a file called php.ini. This file plays a key role in managing various server settings, including the maximum upload size for your WordPress site. By tweaking this file, you can easily adjust the limits that affect file uploads, so you can upload large files like themes, plugins, or media without running into the dreaded “file size limit” error.  

If your hosting provider uses cPanel, as many do (like Bluehost), you can make this change using the built-in MultiPHP INI Editor. Here’s how to do it: 

First, log in to your cPanel through your hosting provider’s dashboard. On Bluehost, for example, you’ll find the cPanel option under the “Hosting” tab.  

Once inside cPanel, scroll down to the “Software” section and click on MultiPHP INI Editor.  

From there, locate the section labeled upload_max_filesize and simply enter your desired file size limit. After making your changes, click ‘Apply’ and you’re all set. 

Alternatively, switch to the ‘Editor Mode’ tab, where you can directly modify the file upload size in the editor. Simply locate and adjust the ‘upload_max_filesize’ section to increase the file upload limit. Once you have made your changes, click the ‘Save’ button to apply them.  

Editing php.ini by adding code 

If you’re feeling a bit more adventurous or don’t have cPanel access, you can manually create or edit the php.ini file. Using an FTP client or your hosting provider’s File Manager, navigate to your site’s root folder (the WordPress root directory). 

If the php.ini file isn’t already there, no worries—just create a new one. Then, add the following code snippet:  

upload_max_filesize = 256M 

post_max_size = 256M 

max_execution_time = 300 

You can adjust the 256M to whatever size you need for your uploads. Once saved, this will increase the max upload size limit, allowing you to upload large image files or media uploads smoothly.  

Method 3: Add code to your theme’s functions.php file 

Next, adding a code snippet to your theme’s functions.php file can help you increase the maximum file upload size in WordPress. While you can edit this file directly, it’s much safer and easier to use a plugin like WPCode. This plugin lets you add custom code to your WordPress site without risking any errors or breaking your site.  

To get started, you first need to install the free WPCode plugin. Once installed and activated, head to Code Snippets » + Add Snippet. Hover over the “Add Your Custom Code” option and click on the Add Custom Snippet button.  

Now, you’ll be taken to a screen where you can name your new snippet. Change the code type to PHP Snippet and then paste this code into the Code Preview section: 

“`php 

@ini_set( 'upload_max_size' , '256M' ); 

@ini_set( 'post_max_size', '256M'); 

@ini_set( 'max_execution_time', '300' ); 

“` 

Feel free to adjust the 256M value to the maximum upload size you need. Once you’re done, switch the toggle at the top to “Active” and click the Save Snippet button. The code will now be live on your WordPress site, increasing your max file upload size without you needing to mess with the core files directly.  

This method is perfect for those who want to safely edit their WordPress site and easily manage file upload limits. 

Method 4: Modify the .htaccess file  

You can increase the maximum file upload size in WordPress by modifying the .htaccess file as well. This file is crucial because it controls key configuration settings for your website. To get started, you’ll need to log in to your server using an FTP client.   

Once logged in, navigate to your site’s root folder, where the .htaccess file is located. If you don’t see it, your File Manager or FTP client may have hidden the file.  

After finding the file, open it and add the following code snippet to increase the upload size: 

“`php 

php_value upload_max_filesize 256M

php_value post_max_size 25M

php_value max_execution_time 300

php_value max_input_time 300 

“` 

If you need to increase the upload size even more, simply adjust the 256M value to the desired file size. Once done, you can save and upload the file back to your server. This method gives you control over your file upload limits, allowing you to upload large files like images and media without errors.  

By editing the .htaccess file, you’re tweaking the core settings of your web server, which directly affects your site’s upload capabilities.  

Method 5: Use a plugin to increase file upload size  

If you’re not comfortable adding code to WordPress, a great option to increase the maximum file upload size is using a plugin like WP Increase Maximum Upload Filesize. This plugin makes it easy to adjust the upload size without dealing with .php files or the .htaccess file.  

First, install and activate the plugin.  

Once the plugin is activated, go to Media » Increase Upload Limit in your WordPress dashboard. 

On the plugin’s settings page, you’ll see a drop-down menu labeled Choose Maximum Upload File Size. Select the new upload size you want, then click the Save Changes button. 

Keep in mind that your hosting provider might set a maximum upload size limit. If you need to upload larger files than what’s available in the plugin’s drop-down menu, you must get in touch with your hosting provider to request a higher limit. 

This plugin is a simple solution for users who prefer not to edit code but still need to upload large files to their WordPress site.  

 Method 6: Create or update the ‘.user.ini’ file 

If your hosting provider has restricted the global PHP settings, they might be using .user.ini files instead of php.ini. Just like php.ini or .htaccess, you can find the .user.ini file in your WordPress root directory.  

If it’s not there, you can create one.  

To create or modify the .user.ini file, follow the same steps as creating a php.ini file. Once you’ve created the file, add this code snippet:  

“`ini 

upload_max_filesize = 32M 

post_max_size = 64M 

memory_limit = 128M 

“` 

This code increases the maximum upload size, post size and memory limit for your WordPress site. It’s a similar method to the php.ini file, but with a different filename. This will help you increase the maximum file upload size for large files and resolve any upload errors.  

Method 7: Use the WordPress ‘upload_size_limit’ filter 

In WordPress 2.5, the `upload_size_limit` filter was introduced to allow for more control over the maximum upload size allowed, as defined in php.ini. This filter can be customized to change the upload limit for different user roles, such as non-admins. Here’s an example of how you can use this filter to set a specific upload size limit for non-administrators.  

Below is an example provided by WordPress contributor Drew Jaynes, which sets the maximum file upload size for all non-admin users to 10MB:  

“`php 

/**  Filter the upload size limit for non-administrators.   *@param string $size Upload size limit (in bytes).  @return int Filtered size limit. */ function filter_site_upload_size_limit( $size ) {           // Set the upload size limit to 10 MB for users lacking the 'manage_options' capability.          if ( ! current_user_can( 'manage_options' ) ) {              // 10 MB limit for non-admins.             $size = 1024  10000;         }         return $size; } add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', 20 ); 

“` 

This code checks if the current user lacks the `manage_options` capability (which is only available to admins) and limits their upload size to 10MB. You can modify this code to adjust the upload size for specific user roles or even for particular user IDs, depending on your needs.  

Method 8: Increase the max upload file size in Nginx 

Nginx is a type of web server that is frequently used because it works faster. At the same time, it serves more requests per second. A lot of performance-oriented hosting services liberate WordPress, including Bluehost, utilize Nginx. 

If your WordPress website is hosted on Nginx server and you find yourself in a position where you need to increase the upload max file size, you will have to change this both in the php.ini file as well as the nginx.conf file.       

Step 1: Modify the php.ini file 

Begin by finding and editing your php.ini file to customize the upload settings. On a Nginx server, this file is typically found at `/etc/php/7.4/fpm/php.ini`, though the exact path may vary depending on the PHP version installed on your server.  

Here’s the code you need to add or modify:  

“`ini 

upload_max_filesize = 64Mpost_max_size = 128M 

“` 

These lines adjust the maximum file upload size and the maximum post size, respectively. After making your changes, save the file. To apply these updates, you’ll need to restart PHP-FPM using the following command:  

“`bash 

sudo service php7.4-fpm restart 

“` 

If you’re using a different PHP version, adjust the command accordingly (e.g., `php7.3-fpm` or `php8.0-fpm`).  

Step 2: Modify the nginx.conf file  

Next, you’ll need to modify the nginx.conf file to increase the upload limit at the server level. This is done by adjusting the `client_max_body_size` directive, which controls the maximum upload size for the entire Nginx server.  

To find this file, navigate to `/etc/nginx/nginx.conf`. You can place the `client_max_body_size` directive in one of three blocks within the configuration file, depending on how widely you want the setting to apply:  

http block: Affects all sites and apps hosted on the server. 

“`nginx 

 http {      ...      client_max_body_size 128M;  } 

“` 

server block: Affects a specific site or app hosted on the server. 

“`nginx 

 server {      ...      client_max_body_size 128M;  } 

“` 

location block: Affects a specific directory, such as `/uploads` or `/files`, within a site or app. 

“`nginx 

 location /files {      ...      client_max_body_size 128M;  } 

“` 

Adjust the size (e.g., 128M) to your preferred maximum upload size. Once the changes are made, save the file. 

Step 3: Restart Nginx 

To apply the new settings, restart Nginx using the following command: 

“`bash 

sudo service nginx reload 

“` 

This command reloads the configuration without stopping the server, ensuring your changes are applied immediately. 

Note for Bluehost users 

You won’t have direct access to the nginx.conf file in case you have partnered with Bluehost. However, Bluehost’s support team can make these changes for you. Simply reach out to them and they’ll adjust the upload limits on your behalf.   

To increase the maximum file upload size on a WordPress site running on Nginx, you’ll need to tweak both the php.ini and nginx.conf files. By adjusting the limits in these files and then restarting PHP-FPM and Nginx, you’ll be able to upload larger files without encountering any errors. This approach helps ensure that your WordPress site can smoothly handle bigger media files, plugins, or themes without hitting size restrictions.  

Final Thoughts: Increase maximum file size 

Increasing the maximum file upload size in WordPress allows you to upload large media files, themes, or plugins without interruptions, ensuring smoother site management and improved functionality. Whether you’re handling heavy files or need more flexibility, boosting the upload limit will make your workflow faster and more efficient. 

If you’re hosting your site with Bluehost, their support team is always available to assist you in increasing your upload limits. Whether you’re dealing with large media files or need extra flexibility, Bluehost is there to help you manage your WordPress site seamlessly.  

FAQs: Increase upload file size 

What is the default maximum upload file size in WordPress?  

The default maximum upload size in WordPress varies based on your server configuration and hosting provider, but it is usually between 2MB and 64MB.  

How can I check my current maximum upload file size in WordPress?  

You can check the current upload size limit by going to your WordPress dashboard, navigating to Media » Add New and looking for the maximum file upload size notice below the upload box.  

How to increase WordPress max upload file size limit?

You have the option to boost the upload size by contacting your hosting provider, editing the php.ini or .htaccess files, adding code to the functions.php file, or using a plugin like WP Increase Upload Filesize.  

What if I don’t feel comfortable editing server files like php.ini or .htaccess?  

If you’re not comfortable with editing code, the easiest way to increase the upload size is by using a WordPress plugin like WP Increase Upload Filesize. It allows you to increase the file size limit without dealing with complex server settings.  

What should I do if I still get an error message after increasing the upload limit?  

If you’re still encountering errors after increasing the maximum file upload size, you may need to contact your hosting provider. They might have a maximum upload size limit set on their server, which needs to be adjusted. 

  • Sonali Sinha

    Sonali Sinha is a versatile writer with experience across diverse niches, including education, health, aviation, digital marketing, web development, and technology. She excels at transforming complex concepts into engaging, accessible content that resonates with a broad audience. Her ability to adapt to different subjects while maintaining clarity and impact makes her a go-to for crafting compelling articles, guides, and tutorials.

Learn more about Bluehost Editorial Guidelines

Write A Comment