banner



How To Increase The Upload Size Of Wordpress

Struggling with how to increase the maximum file upload size in WordPress?

The default max upload size value depends on your host, but it can be quite depression in some cases. This tin can result in you seeing errors such as "The uploaded file exceeds the upload_max_filesize directive in php.ini" when you attempt to upload files to your WordPress site's Media Library or via other upload interfaces.

Thankfully, there are some fixes that you lot can apply to solve the problem.

In this post, we'll show you several different methods that y'all can apply to increase the maximum file upload size on your WordPress site.

Many of these methods will require adding some code snippets to your site. Nevertheless, we will start with a simple plugin method that might work depending on how your server is configured.

Here are the five methods that nosotros'll cover:

  1. 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 go started!

How to Cheque WordPress Max File Upload Size

Before getting started, here's a quick way to cheque your WordPress site's existing max file upload size.

In your WordPress dashboard, become to Media → Add together New and wait for the Maximum upload file size value:

How to check the Maximum File Upload Size in WordPress

If this value is smaller than the file y'all're trying to upload, you now know why yous're having issues.

How to Increase the Maximum File Upload Size in WordPress

Earlier we get started, I desire to note that whether or not some of these methods work depends on your host'southward configuration. Nosotros cannot guarantee that all of the methods will work for your specific situation. But we tin say that they work for many WordPress users and hosting configurations.

So, if you endeavor these methods and find that they don't work for you lot, your adjacent step should be to reach out to your host's support. They might be able to override whatsoever is causing the trouble.

With that caveat out of the way, let's become into the tutorials…

1. Use the Free Increase Maximum Upload File Size Plugin

The absolute simplest option to increment your max upload size is to use the free Increment Maximum Upload File Size plugin because information technology doesn't crave editing any code.

Withal, the plugin will just work up to the maximum upload limit set by your server. For that reason, information technology will simply fix the problem if the consequence is that your WordPress site's upload limit is fix lower than the server upload limit for some reason.

To check if it will work for you, install and activate the free plugin from WordPress.org. So, go to Settings → Increment Maximum Upload File Size.

You'll see the max upload size from your server likewise as your WordPress site'southward current site limit. You tin can then use the drop-downwardly to set your site's max anywhere up to the server max:

How to Increase the Maximum File Upload Size in WordPress

If your server'south max upload size is yet too low, go along reading for some code-based fixes for that.

2. Use Kid Theme'southward Functions.php or Code Snippets Plugin

In some situations, yous can increment your max upload size by adding the post-obit code snippets to either your child theme's functions.php file or via the Lawmaking Snippets plugin (or another similar plugin).

If y'all're adding it to functions.php, make sure to use a child theme. Otherwise, your changes will be overwritten when yous update your theme.

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

You can modify the numbers – '32M' – according to your needs. For example, to make the max upload 64 MB, y'all could change it to '64M'.

3. Create or Edit php.ini File

The php.ini file controls basic PHP configuration variables, including the max upload size.

At some hosts, yous might be able to edit the php.ini file via cPanel, which is simpler than editing the file directly. For example, with Bluehost, you can open cPanel by clicking the Advanced tab in your Bluehost dashboard. So, you tin select the MultiPHP INI Editor tool:

Bluehost php.ini editor

Then, you lot can select the site that you want to edit and conform the upload_max_filesize directive:

Changing the upload_max_filesize directive

If your host doesn't offer such a tool, you tin can endeavour accessing the file directly.

Connect to your server's root folder using FTP or cPanel File Manager (the root binder is the same folder that contains the wp-config.php file):

  • If you lot run across an existing file called php.ini, edit that file. You might need to tell your FTP client to show hidden files.
  • If y'all don't see an existing file, create a new file called php.ini.

Then, add the following lines of code:

upload_max_filesize = 32M post_max_size = 32M max_execution_time = 300          

Or, if you already see those lines of lawmaking, edit the numbers according to your needs.

four. Add Code to .htaccess File

If your host uses the Apache web server (which almost WordPress hosts exercise), you can try to increase your max upload size past editing your site'south .htaccess file.

To edit the .htaccess file, you'll demand to connect to your server using FTP or cPanel File Manager. So, observe the .htaccess file in the root folder (the same binder that contains wp-config.php).

Before making whatever edits, you should download a copy of the file to your local computer and then that yous take a rubber backup in example something goes wrong (it's unlikely – merely the .htaccess file is sensitive then you e'er want to have a backup).

Once you lot have a backup, edit the file and add the post-obit 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          

Once more, you can alter the numbers according to your needs.

v. Talk to Your Host'south Back up

Again, we can't guarantee that these methods will work for all sites because sometimes your host's configuration but won't allow these tactics to work.

Then – if nothing has worked and so far, we recommend that you reach out to your host's back up to run into if they volition increment your server's upload limit for yous.

Workaround: Upload Via FTP and Import to WordPress

If aught has worked and then far and your host won't increase the max upload file size for you, I'll finish past sharing a workaround that you can apply to upload huge files to your WordPress Media Library.

This won't permanently ready the trouble, but it volition give you a way to get the file uploaded right away, which might be exactly what you lot need right now.

Instead of trying to upload files via the WordPress dashboard, you can upload the file using FTP, which will completely featherbed any file size limits.

To go started, employ FTP to upload the file to the wp-content/uploads/… folder, making sure to select the correct year/month.

For example:

/wp-content/uploads/2021/01/

At present, the file is on your server. Even so, WordPress won't recognize it inside your Media Library even so. To fix that, you lot can use the free Add From Server plugin to annals the file that yous uploaded to your Media Library.

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

Choose folder

So, open up the folder where you uploaded the file via FTP and import the files that y'all uploaded:

Import files

In one case you import the file using the plugin, you'll see the file in your Media Library only as if you'd uploaded it directly via your WordPress dashboard.

For a deeper await at this method, check out our tutorial on how to bulk upload files to WordPress.

Increase WordPress Maximum File Upload Size Today

In this mail, nosotros've shared a number of different methods that you can use to increase your WordPress site's max file upload size.

For the simplest option, yous should first with the complimentary Increase Maximum Upload File Size plugin. Withal, think that this plugin will just work if your WordPress site's max upload is set below your server's limit – information technology can't increase the server limit past itself.

If the server limit is the problem, yous'll need to endeavor 1 of the code snippets that we shared. And if none of those work, you tin can reach out to your host'southward support to come across if they tin assist you out.

Or, y'all can as well get around this outcome entirely by uploading a file via FTP so using the Add From Server plugin to import it to your Media Library.

For more tips on how to fix these types of WordPress problems, check out our guide on how to troubleshoot WordPress errors.

Still have any questions about how to increase the maximum file upload size in WordPress? Enquire us in the comments!

Source: https://www.wpkube.com/how-to-increase-the-maximum-file-upload-size-in-wordpress-5-methods/

Posted by: murdockbeinerculd.blogspot.com

0 Response to "How To Increase The Upload Size Of Wordpress"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel