How Do I Change the Media 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, but it can exist quite low 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 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 mail, nosotros'll show you several dissimilar methods that you can use to increase 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 first with a simple plugin method that might work depending on how your server is configured.

Here are the five methods that we'll comprehend:

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

Allow'due south get started!

How to Check WordPress Max File Upload Size

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

In your WordPress dashboard, go to Media → Add New and look 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 yous're trying to upload, yous at present know why yous're having issues.

How to Increment the Maximum File Upload Size in WordPress

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

And so, if you try these methods and notice that they don't piece of work for you, your adjacent step should be to accomplish out to your host'due south support. They might be able to override whatever is causing the trouble.

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

1. Utilise the Gratis Increase Maximum Upload File Size Plugin

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

Yet, the plugin volition but work up to the maximum upload limit gear up by your server. For that reason, it volition only fix the trouble if the result is that your WordPress site's upload limit is set lower than the server upload limit for some reason.

To check if information technology volition work for you, install and activate the gratis plugin from WordPress.org. Then, get to Settings → Increase Maximum Upload File Size.

You'll see the max upload size from your server too as your WordPress site's current site limit. You can then use the driblet-down 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's max upload size is still too low, keep reading for some code-based fixes for that.

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

In some situations, you lot can increase your max upload size by adding the following lawmaking snippets to either your kid theme'due south functions.php file or via the Code Snippets plugin (or some other similar plugin).

If you lot're adding it to functions.php, brand sure to use a kid 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' – co-ordinate to your needs. For example, to make the max upload 64 MB, yous 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 might be able to edit the php.ini file via cPanel, which is simpler than editing the file directly. For example, with Bluehost, y'all tin open cPanel by clicking the Avant-garde tab in your Bluehost dashboard. Then, you can select the MultiPHP INI Editor tool:

Bluehost php.ini editor

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

Changing the upload_max_filesize directive

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

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

  • If you lot see an existing file called php.ini, edit that file. You might need to tell your FTP client to show hidden 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 run across those lines of code, edit the numbers according to your needs.

4. Add Code to .htaccess File

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

To edit the .htaccess file, you'll need to connect to your server using FTP or cPanel File Manager. Then, observe 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 computer so that you have a safe backup in case something goes incorrect (it's unlikely – simply the .htaccess file is sensitive so you lot always want to have a fill-in).

Once yous 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          

Again, you can alter the numbers co-ordinate to your needs.

five. Talk to Your Host'southward Back up

Once again, we can't guarantee that these methods will work for all sites because sometimes your host'southward configuration simply won't permit these tactics to work.

So – if nothing has worked so far, we recommend that you accomplish out to your host's support to encounter if they volition increase your server's upload limit for you.

Workaround: Upload Via FTP and Import to WordPress

If zilch has worked so far and your host won't increment the max upload file size for you lot, I'll stop by sharing a workaround that you tin employ to upload huge files to your WordPress Media Library.

This won't permanently fix the problem, merely it will give you a mode to get the file uploaded right away, which might be exactly what yous need right now.

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

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

For example:

/wp-content/uploads/2021/01/

Now, the file is on your server. However, WordPress won't recognize it inside your Media Library yet. To fix that, you tin can use the free Add From Server plugin to register the file that you uploaded to your Media Library.

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

Choose folder

And so, open the folder where yous uploaded the file via FTP and import the files that you uploaded:

Import files

Once you import the file using the plugin, yous'll encounter the file in your Media Library only as if you'd uploaded information technology direct via your WordPress dashboard.

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

Increase WordPress Maximum File Upload Size Today

In this post, nosotros've shared a number of different methods that yous tin can utilize to increment your WordPress site'southward max file upload size.

For the simplest selection, you should starting time with the complimentary Increase Maximum Upload File Size plugin. However, remember that this plugin will only work if your WordPress site's max upload is set beneath your server's limit – it tin can't increase the server limit by itself.

If the server limit is the problem, you'll demand to try one of the code snippets that we shared. And if none of those work, you lot tin can reach out to your host's support to come across if they can help you out.

Or, you can also get effectually this upshot entirely past uploading a file via FTP and and so using the Add From Server plugin to import information technology to your Media Library.

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

Still have any questions nigh how to increase the maximum file upload size in WordPress? Ask u.s. in the comments!

raybrishemed.blogspot.com

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

0 Response to "How Do I Change the Media Upload File Size in Wordpress"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel