increase the maximum upload file size in wordpress

How to Increase the Maximum Upload File Size in WordPress

Practice you want to increase the WP max upload file size in your site only you lot're not sure how? We've got yous covered. In this guide, you volition learn different methods to alter the maximum file upload limit in WordPress.

Why Increase the Maximum Upload File Size?

If you lot take a site or an eCommerce store, yous're probably familiar with the process of uploading media. Usually, yous practise it via the library and you can upload images, GIFs, ZIP files, and more. The problem comes when your file size is as well large. What's besides big? If your file size is bigger than the maximum file upload size configured in the server, you will experience issues.

For example, if you effort to upload a 20MB file through the media library just your maximum file upload size is 10MB, information technology won't piece of work. You'll get an alert saying that the file size limit was exceeded. And unless you increase the maximum upload file size on your WordPress site, you won't be able to upload that file. This can exist a headache for websites that need to upload videos and high-resolution images.

The good news is that there are several ways to set up this trouble. In this guide, we'll bear witness yous how to increase the upload limit in WordPress. But earlier that, let's see how to check what the electric current maximum upload file size is on your site.

How to Cheque the Max Upload File Size

Before raising the upload limit, check what your current limit is. In your WordPress dashboard, become to Media > Add together New. There, you volition see the maximum file size that you can currently upload.

max upload file size

In most cases, the maximum upload limit is fix past your hosting provider. For example, for us, the file size is 128MB but some WordPress hosting companies set this value to 2MB by default.

How to Increase the Maximum Upload File Size in WordPress

There are several ways to increase the maximum upload file size limit in WordPress:

  1. .htaccess File
  2. Functions.php File
  3. PHP.Ini File
  4. WP-Config.php File
  5. Increase Size in Multisite
  6. With Plugins
  7. From the Hosting Platform
  8. Upload_Size_Limit Filter
  9. Contact your Hosting Provider

In this section, we'll explain each method step-by-step and so yous can choose the ane that best suits your needs.

NOTE: Some methods require editing the theme files or WordPress core files, and so before you get-go, we recommend yous generate a complete fill-in of your site. If you're not sure how to do information technology, cheque out this step-by-step guide.

i) .htaccess file

By editing the .htaccess file, yous will be able to increase the maximum file upload limit. To do this, you need to use an FTP customer like FileZilla, so first install FileZilla on your local computer. Later that, connect FileZilla with your web server.

You will need to create an FTP business relationship using your website'south cPanel (control panel) and and then, yous will be redirected to the file manager.

ftp connected

The left side shows you all the local files available and on the right side, y'all will see the server files, where you should exist able to locate the .htaccess file.

htaccess file

Right-click on it and select View/Edit.

edit htaccess file wordpress

The software will open the file on the text editor you lot take on your calculator. In our case, it'south Notepad.

htaccess file on notepad

Now re-create this code to increase the file size limit to 128 MB.

php_value upload_max_filesize 128M php_value post_max_size 128M php_value memory_limit 256M php_value max_execution_time 300 php_value max_input_time 300

Paste it in the .htaccess file and save it.

Increase the Maximum Upload File Size in WordPress - .htaccess

So, upload the file back to the server. Yous volition see a pop-up where you have to click the option to finish editing and delete the local file so ostend.

upload htaccess file back to server

That'south it!  From now on, the maximum file upload limit will be 128 MB or any other size that you've configured through the code. We chose 128MB as the maximum upload size but you tin can alter it and adjust the value to any size y'all desire.

2) Functions.php file

If yous're not comfortable editing WordPress core files, y'all can likewise upgrade the maximum file upload limit by editing the theme files. To do that, yous need to edit your kid theme's functions.php file. If you don't have a child theme, we recommend you create one following this tutorial or utilise any of these plugins.

In that location are two options to edit your kid theme files:

  • Via the WordPress editor
  • With plugins

Both methods will get the chore washed without issues. Here, nosotros'll explain how to utilize both so you lot can choose your favorite one.

Method ane: Edit Functions.php file from WordPress Customizer

First, log in to your WordPress site and go to Appearance > Theme Editor.

wordpress theme editor

By default, your server will load the mode.css file. We'll edit the functions.php file then await for it on the right-hand side of the screen.

load functions file

Then, copy this code to increase the file size limit to 64MB.

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

Paste information technology in your functions.php file and update the file.

update functions.php file

In this case, we take chosen 64MB as the max upload size just if yous desire a different file size, simply update the code. For example, let'due south say you desire to be able to upload files upwardly to 100MB. The code will be:

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

On the other hand, if you lot don't feel comfy editing the theme files, bank check out the plugin method below.

Method 2: Code Snippets Plugin

Lawmaking Snippets is one of the best plugins to add lawmaking for those who don't like to edit cadre/theme files directly. To install this tool, in your WordPress Admin, go to Plugins > Add New, expect for Code Snippets. Then, install and activate the plugin.

increase the maximum upload file size in wordpress - install code snippets wordpress plugin

Afterwards that, you volition be able to add custom PHP/ HTML/ CSS or JavaScript codes through the plugin settings. Just go to Snippets > Add New on the sidebar.

add new snippet

Every time you create a snippet, nosotros recommend y'all give it a clear proper name that explains what it does and so and then it's easy to identify. For example, we'll call it "Increase Max File Upload Time". Afterwards that, re-create the lawmaking from below, paste it in the plugin's snippet section and relieve it.

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

code snippets adding

That's it! You've just increased the maximum file size limit to 64MB.

3) PHP.Ini File

Another alternative to increase the maximum file size limit in WordPress is to create or edit the php.ini file.

First, copy the below code to increase the limit to 128MB.

upload_max_filesize = 128M post_max_size = 13M memory_limit = 15M

Then, open up whatever text editor (Notepad, Notepad++, Sublime Text, or any other) and paste the code. And so, salve information technology as php.ini (.ini is the extension here) and place information technology somewhere handy.

save-php-ini-file

One time yous have created this file, log in to your website's file manager through cPanel or FileZilla and upload this php.ini file to your WordPress installation directory. That's it!

iv) WP-Config.php File

The wp-config.php file is a cadre file that contains essential data such as the MySQL username, hostname, password, and and then on. Additionally, it has information regarding the upload size limit, so nosotros can edit it to increase that limit.

To do that, log in to your file manager using FileZilla. In the WordPress installation directory, you lot will see a file called wp-config.php. Right-click on it and select View/Edit.

edit wp config file

Then, open the file using any text editor and copy the post-obit code to increase the file limit size to 120MB.

@ini_set( 'upload_max_size' , '120M' ); @ini_set( 'post_max_size', '13M'); @ini_set( 'memory_limit', '15M' );

After that, paste the code right earlier the line That's all, terminate editing! Happy blogging and salvage the changes.

paste code in wp config file

Then upload the file back to your server and that's it! Yous've increased the file size limit past editing the wp-config.php.

upload modified wp config file

5) Increase Size in Multisite

If you lot have a multisite WordPress installation and desire to increase the maximum upload file size, follow these steps.

First, in your dashboard, go Network Admin >Settings.

network admin settings

Under the settings, search for the Max upload file size option.

max upload file size

Hither, the server is configured with a max 1500 kb (or 1.5MB) file upload limit so we'll increase information technology to 64MB (64000 kb).

Finally, relieve the settings and you are good to go.

half dozen) Increase the maximum file size upload limit with plugins

If yous don't feel comfortable editing files, you can increment the file size limit with a plugin. For this demo, we'll use a free tool called Increase Maximum Upload File Size.

increase the maximum upload file size in wordpress - plugin

The first thing you demand to exercise is install and activate the plugin.

increase the maximum upload file size in wordpress - install plugin

Then, go to the plugins' configuration under the Settings section.

increase maximum file upload limit plugin settings

At present, simply select the size you want from the dropdown and salve the changes.

upload size

Every bit you tin see, the size options are: 16MB, 32MB, 64MB, 128MB, 256MB, 512MB, 1GB. Keep in mind that you lot can't select a dissimilar file size, and then you lot'll accept to choose i of those options.

Finally, save the changes and you lot will see the new limit configured. Short and sweet.

7) From the Hosting Platform

Most WordPress hosting companies will requite you an pick to configure the maximum file upload size through the cPanel or your account dashboard. Let'south encounter how you can exercise it.

Outset, log in to your cPanel and go to Software >Select PHP Version.

increase maximum file upload limit - select php version

You lot will be redirected to the PHP extensions page and from there, y'all will be able to enable or disable custom PHP extensions. We don't demand to change whatever of this just on the top-right corner, click the link to open the PHP options.

increase maximum file upload limit - php options

On the side by side folio, you volition run into the PHP selector options. These are the settings people use to modify the PHP version merely we'll use them to edit the maximum file size.

You demand to locate the upload_max_filesize selection. That's the max file upload limit configured by the server or hosting company. Simply click it and select the maximum file size you lot want to apply from the dropdown. Subsequently that, salvage the settings.

increase maximum file upload limit - php selector

Note: Be actress conscientious when changing this type of thing. Modifying the wrong settings can touch on your site's frontend/backend, and so double-check every stride and continue advisedly.

8) Upload_Size_Limit Filter

WordPress includes a filter to increment the upload size called Upload_Size_Limit. Yous can use it to edit your theme's functions.php and add a filter to customize your maximum upload file size. Let's run into how to do it.

Log in to your WordPress site and go to the Theme Editor. Open the functions.php file and paste the below code at the stop of the file.

function filter_site_upload_size_limit( $size ) {     return 1024 * 1024 * 64;  }  add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', 120 );

modify upload limit filter

If you cheque the code, you'll come across that in the last line, nosotros specify a maximum upload size of 120MB. You lot can edit it and select any size you lot desire for your site.

Finally, think to update the file after modifying the theme's functions.php file.

ix) Contact your Hosting Provider

It's worth mentioning that if you utilise shared hosting, these methods may not piece of work. And so if you don't like any of the previous methods or yous employ shared hosting, contacting your hosting provider is your best choice. Most hosting companies offer support via live chat, phone, and ticketing systems, and then merely tell them what yous want to modify and they'll do it for yous.

Bonus: Add custom image sizes

Apart from increasing the maximum upload file size, you can besides add custom image sizes to make improve use of your site's resources.

First, y'all can modify the default prototype sizes by going to Settings > Media in your WP dashboard. In that location, you will see the iii default sizes with their corresponding width and pinnacle. Only suit the sizes and save the changes. Nosotros also recommend y'all regenerate the thumbnails.

If apart from irresolute the default options you desire to add your own custom image sizes, you'll need to practice a chip more work. The easiest fashion is to follow this footstep-by-step guide that shows you ii different methods.

Alternatively, you can remove default image sizes that yous don't employ. To know more about that, accept a look at this guide.

Conclusion

In summary, if you attempt to upload a file to your site that'southward bigger than the limit configured in the server, you will accept issues. That's why learning how to increase that limit is very handy and volition aid you avoid headaches.

In this guide, we've seen several different methods to increase the maximum upload file size in WordPress:

  1. .htaccess
  2. Functions.php
  3. PHP.Ini
  4. WP-Config.php
  5. Multisite
  6. Using plugins
  7. From the Hosting Platform
  8. Upload_Size_Limit Filter
  9. Contact your Hosting Provider

All of these methods get the job done efficiently so choose the ane that yous similar best. The most mutual solutions are editing the .htaccess file, the wp-config.php, the php.ini file. Nevertheless, if you use shared hosting or you're not comfortable using any of the above methods, you can contact your hosting provider and ask them to enhance the limit for you. Additionally, some hosting companies even permit you to update the upload size through the account dashboard.

On the other hand, if yous don't feel comfortable straight editing the theme or WordPress cadre files, you tin can use Lawmaking Snippets.

Have you enjoyed the read? Please share this post on social media and help your friends increase their server'due south maximum upload file size!