How to Increase the Maximum File Upload Size in WordPress (5 Methods)
/ / How to Increase the Maximum File Upload Size in WordPress (5 Strategies)

How to Increase the Maximum File Upload Size in WordPress (5 Strategies)

Some of the links in this post are affiliate links. This means if you click on the link and purchase the item, We will receive an affiliate commission at no extra cost to you. All opinions remain our own.

Struggling with the way to improve the utmost file add measurement in WordPress?

The default max adds measurement worth relies upon on your host, however, it may be fairly low in some instances. This may end up in you seeing errors resembling “The uploaded file exceeds the upload_max_filesize directive in php.ini” whenever you attempt to add recordsdata to your WordPress site’s Media Library or through different add interfaces.

Thankfully, there are some fixes that you could apply to unravel the issue.

In this put-up, we’ll present you with many completely different strategies that you should utilize to extend the utmost file add measurement on your WordPress site.

Many of these strategies will require including some code snippets to your site. However, we will start with an easy plugin technique that would possibly work relying on how your server is configured.

Here are the 5 strategies that we’ll cowl:

  1. A free plugin (code-free)
  2. functions.php (code snippet)
  3. php.ini file (hosting dashboard or code snippet)
  4. .htaccess file (code snippet)
  5. Bonus workaround – upload files via FTP

Let’s get began!

How to Check WordPress Max File Upload Size

Before getting began, right here’s a fast strategy to test your WordPress site’s present max file add measurement.

In your WordPress dashboard, go to Media → Add New and search for the Maximum add file measurement worth:

If this worth is smaller than the file you’re attempting to add, you now know why you’re having points.

How to Increase the Maximum File Upload Size in WordPress

Before we get began, I need to observe that whether or not or not some of these strategies work relies upon your host’s configuration. We can not guarantee that each one of the strategies will work to your particular state of affairs. But we can say that they work for many WordPress users and hosting configurations.

So, for those who attempt these strategies and discover that they don’t give you the results you want, the next move must be to achieve out your host’s support. They would possibly be capable to override no matter what is inflicting the issue.

With that caveat out of the best way, let’s get into the tutorials…

1. Use the Free Increase Maximum Upload File Size Plugin

The absolute easiest possibility to extend your max add measurement is to make use of the free Increase Maximum Upload File Size plugin as a result of it doesn’t require modifying any code.

However, the plugin will solely work as much as the utmost add restrict set by your server. For that reason, it will solely repair the issue if the difficulty is that your WordPress site’s add restrict is set to decrease then the server adds restrict for some reason.

To test if it will give you the results you want, set up and activate the free plugin from WordPress.org. Then, go to Settings → Increase Maximum Upload File Size.

You’ll see the max add measurement out of your server in addition to your WordPress site’s present site restriction. You can then use the drop-down to set your site’s max wherever as much as the server max:

How to Increase the Maximum File Upload Size in WordPress

If your server’s max add measurement is nonetheless too low, maintain reading for some code-based fixes for that.

2. Use Child Theme’s Functions.php or Code Snippets Plugin

In some conditions, you may improve your max add measurement by including the next code snippets to both your baby theme’s functions.php file or through the Code Snippets plugin (or one other comparable plugin).

If you’re including it on functions.php, make certain to make use of a baby theme. Otherwise, your modifications will be overwritten whenever you replace your theme.

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

You can change the numbers – ’32M’ – in line with your wants. For instance, to make the max add 64 MB, you possibly can change it to ’64M’.

3. Create or Edit php.ini File

The php.ini file controls fundamental PHP configuration variables, together with the max add measurement.

At some hosts, you would possibly be capable to edit the php.ini file through cPanel, which is easier than modifying the file instantly. For instance, with Bluehost, you may open cPanel by clicking the Advanced tab in your Bluehost dashboard. Then, you may choose the MultiPHP INI Editor device:

Bluehost php.ini editor

Then, you may choose the site that you just need to edit and modify the upload_max_filesize directive:

Changing the upload_max_filesize directive

If your host doesn’t offer such a device, you may attempt accessing the file instantly.

Connect to your server’s root folder utilizing FTP or cPanel File Manager (the basis folder is the identical folder that accommodates the wp-config.php file):

  • If you see a present file referred to as php.ini, edit that file. You would possibly want to inform your FTP consumer to indicate hidden recordsdata.
  • If you don’t see a present file, create a new file referred to as php.ini.

Then, add the next strains of code:

upload_max_filesize = 32M
post_max_size = 32M
max_execution_time = 300

Or, for those who already see these strains of code, edit the numbers in line with your wants.

4. Add Code to .htaccess File

If your host makes use of the Apache webserver (which most WordPress hosts do), you may attempt to improve your max add measurement by modifying your site’s .htaccess file.

To edit the .htaccess file, you’ll want to hook up with your server utilizing FTP or cPanel File Manager. Then, discover the .htaccess file in the basis folder (the identical folder that accommodates wp-config.php).

Before making any edits, you must obtain a copy of the file to your native pc so that you've got a protected backup in case one thing goes fallacious (it’s unlikely – however the .htaccess file is delicate so that you at all times need to have a backup).

Once you've got a backup, edit the file and add the next code:

php_value upload_max_filesize 32M
php_value post_max_size 32M
php_value max_execution_time 300
php_value max_input_time 300

Again, you may change the numbers in line with your wants.

5. Talk to Your Host’s Support

Again, we can guarantee that these strategies will work for all websites as a result of typically your host’s configuration simply received’t permit these techniques to work.

So – if nothing has labored up to now, we advocate that you just attain out to your host’s support to see if they will improve your server’s ad restriction for you.

Workaround: Upload Via FTP and Import to WordPress

If nothing has labored up to now and your host received’t improve the max add file measurement for you, I’ll end by sharing a workaround that you should utilize to add big recordsdata to your WordPress Media Library.

This received’t completely repair the issue, nevertheless, it will provide you with a strategy to get the file uploaded immediately, which may be precisely what you want proper now.

Instead of attempting to add recordsdata through the WordPress dashboard, you may add the file utilizing FTP, which will utterly bypass any file measurement limits.

To get began, use FTP to add the file to the wp-content/uploads/… folder, ensuring to pick out the right 12 months/month.

For instance:

/wp-content/uploads/2021/01/

Now, the file is on your server. However, WordPress received’t acknowledge it inside your Media Library but. To repair that, you should utilize the free Add From Server plugin to register the file that you just uploaded to your Media Library.

After activating the plugin, go to Media → Add From Server:

Choose folder

Then, open the folder the place you uploaded the file through FTP and import the recordsdata that you just uploaded:

Import files

Once you import the file utilizing the plugin, you’ll see the file in your Media Library simply as for those who’d uploaded it instantly through your WordPress dashboard.

For a deeper have a look at this technique, take a look at our tutorial on the way to bulk add recordsdata to WordPress.

Increase WordPress Maximum File Upload Size Today

In this put-up, we’ve shared a quantity of completely different strategies that you should utilize to extend your WordPress site’s max file add measurement.

For the only possibility, you must start with the free Increase Maximum Upload File Size plugin. However, keep in mind that this plugin will solely work in case your WordPress site’s max add is set beneath your server’s restrict – it couldn't improve the server restriction by itself.

If the server restriction is the issue, you’ll have to attempt one of the code snippets that we shared. And if none of these work, you may attain out to your host’s support to see if they may also help you out.

Or, you may also get around this subject totally by importing a file through FTP after which utilizing the Add From Server plugin to import it to your Media Library.

For extra suggestions on the way to repair these varieties of WordPress points, take a look at our information on the way to troubleshoot WordPress errors.

Still, have any questions on the way to improve the utmost file add measurement in WordPress? Ask us in the comments!