banner



How To Increase The Upload File Size In Wordpress

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

The default max upload size value depends on your host, just it tin can be quite low in some cases. This can result in you seeing errors such every bit "The uploaded file exceeds the upload_max_filesize directive in php.ini" when y'all try to upload files to your WordPress site'southward 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 y'all several different methods that you tin use to increment the maximum file upload size on your WordPress site.

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

Here are the 5 methods that we'll cover:

  1. Free plugin (code-gratuitous)
  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 Check WordPress Max File Upload Size

Before getting started, here's a quick manner to bank check your WordPress site's existing max file upload size.

In your WordPress dashboard, go to Media → Add 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 you lot're trying to upload, you lot at present know why you lot're having problems.

How to Increment the Maximum File Upload Size in WordPress

Before we get started, I desire to note that whether or not some of these methods work depends on your host'due south configuration. We cannot guarantee that all of the methods will work for your specific state of affairs. But we can say that they work for many WordPress users and hosting configurations.

So, if you attempt these methods and observe that they don't work for you, your adjacent step should be to achieve out to your host'southward support. They might be able to override whatever is causing the problem.

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

one. Use the Gratis Increment Maximum Upload File Size Plugin

The accented simplest choice to increase your max upload size is to use the free Increase Maximum Upload File Size plugin because it doesn't require editing any lawmaking.

Nevertheless, the plugin will only work upwardly to the maximum upload limit set by your server. For that reason, it will simply gear up the problem if the result is that your WordPress site'southward upload limit is set lower than the server upload limit for some reason.

To bank check if it will piece of work for yous, install and activate the gratuitous plugin from WordPress.org. Then, go to Settings → Increase Maximum Upload File Size.

You'll meet the max upload size from your server besides as your WordPress site's current site limit. Y'all tin can then use the drib-down to fix your site'southward max anywhere up to the server max:

How to Increase the Maximum File Upload Size in WordPress

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

two. Utilise Child Theme's Functions.php or Code Snippets Plugin

In some situations, yous tin can increase your max upload size by adding the post-obit lawmaking snippets to either your kid theme's functions.php file or via the Code Snippets plugin (or another similar plugin).

If yous're calculation information technology to functions.php, make sure to utilise a child theme. Otherwise, your changes will be overwritten when you update 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' – according to your needs. For example, to make the max upload 64 MB, you 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, you lot might exist able to edit the php.ini file via cPanel, which is simpler than editing the file directly. For instance, with Bluehost, you can open cPanel by clicking the Advanced tab in your Bluehost dashboard. Then, y'all tin can select the MultiPHP INI Editor tool:

Bluehost php.ini editor

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

Changing the upload_max_filesize directive

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

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

  • If you run into an existing file called php.ini, edit that file. Yous might need to tell your FTP client to testify subconscious files.
  • If you 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 encounter those lines of code, edit the numbers co-ordinate to your needs.

4. Add Code to .htaccess File

If your host uses the Apache web server (which most WordPress hosts do), you can endeavor to increase your max upload size by editing your site's .htaccess file.

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

Before making whatsoever edits, you should download a copy of the file to your local figurer then that you have a safe fill-in in example something goes incorrect (information technology'southward unlikely – merely the .htaccess file is sensitive so you always want to accept a backup).

Once you have a backup, edit the file and add the following 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 tin can change the numbers co-ordinate to your needs.

5. Talk to Your Host's Back up

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

Then – if null has worked then far, nosotros recommend that y'all reach out to your host's support to see if they volition increase your server'due south upload limit for you.

Workaround: Upload Via FTP and Import to WordPress

If nothing has worked then far and your host won't increment the max upload file size for you, I'll finish by sharing a workaround that you tin can use to upload huge files to your WordPress Media Library.

This won't permanently prepare the problem, simply it will give you a manner to go 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 tin upload the file using FTP, which will completely bypass any file size limits.

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

For instance:

/wp-content/uploads/2021/01/

At present, the file is on your server. Withal, WordPress won't recognize it within your Media Library all the same. To fix that, y'all tin can employ the costless Add From Server plugin to register the file that you uploaded to your Media Library.

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

Choose folder

Then, open up the binder where you lot uploaded the file via FTP and import the files that you uploaded:

Import files

One time you import the file using the plugin, you'll come across the file in your Media Library just equally if you'd uploaded information technology directly via your WordPress dashboard.

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

Increment WordPress Maximum File Upload Size Today

In this postal service, 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, you should first with the costless Increase Maximum Upload File Size plugin. However, remember that this plugin volition simply work if your WordPress site'due south max upload is set below your server'due south limit – it tin't increase the server limit by itself.

If the server limit is the problem, y'all'll need to try one of the code snippets that we shared. And if none of those piece of work, you tin reach out to your host's support to meet if they can aid you out.

Or, you can too become effectually this issue entirely by uploading a file via FTP and so using the Add From Server plugin to import it to your Media Library.

For more than tips on how to ready these types of WordPress issues, cheque out our guide on how to troubleshoot WordPress errors.

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

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

Posted by: autreysuccans.blogspot.com

0 Response to "How To Increase The Upload File Size In Wordpress"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel