How to Increase Php Upload Limit in Wordpress

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

The default max upload size value depends on your host, merely it tin be quite low in some cases. This can result in yous 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's Media Library or via other upload interfaces.

Thankfully, at that place are some fixes that you can utilize to solve the trouble.

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

Many of these methods will require calculation some lawmaking snippets to your site. However, we volition start 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 (code snippet)
  3. php.ini file (hosting dashboard or code snippet)
  4. .htaccess file (lawmaking snippet)
  5. Bonus workaround – upload files via FTP

Permit's get started!

How to Check WordPress Max File Upload Size

Earlier getting started, here's a quick way to check your WordPress site'due south 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 you're trying to upload, yous at present know why you're having issues.

How to Increase the Maximum File Upload Size in WordPress

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

So, if you attempt these methods and detect that they don't work for you, your next stride should be to reach out to your host's support. They might be able to override whatever is causing the problem.

With that caveat out of the fashion, allow's get into the tutorials…

1. Utilise the Free Increment Maximum Upload File Size Plugin

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

However, the plugin volition only work up to the maximum upload limit ready by your server. For that reason, it will merely fix the problem if the consequence is that your WordPress site's upload limit is set lower than the server upload limit for some reason.

To check if it will work for yous, install and activate the gratis plugin from WordPress.org. Then, get to Settings → Increase Maximum Upload File Size.

Y'all'll come across the max upload size from your server every bit well as your WordPress site'due south current site limit. Yous tin can and so utilise the drop-downwards to set your site'due south max anywhere upwardly to the server max:

How to Increase the Maximum File Upload Size in WordPress

If your server'south max upload size is yet likewise depression, keep reading for some lawmaking-based fixes for that.

2. Utilise Child Theme'south Functions.php or Code Snippets Plugin

In some situations, y'all can increase your max upload size past adding the post-obit code snippets to either your kid theme'south functions.php file or via the Code Snippets plugin (or another similar plugin).

If y'all're calculation it to functions.php, brand sure to utilise a child theme. Otherwise, your changes volition 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 alter the numbers – '32M' – according to your needs. For example, to brand the max upload 64 MB, you lot could alter 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 case, with Bluehost, you can open cPanel past clicking the Advanced tab in your Bluehost dashboard. Then, you can select the MultiPHP INI Editor tool:

Bluehost php.ini editor

Then, you lot can select the site that you desire 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 can effort accessing the file directly.

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

  • If you see an existing file called php.ini, edit that file. Y'all might need to tell your FTP client to bear witness hidden files.
  • If you lot don't see an existing file, create a new file called php.ini.

And then, add together 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 code, edit the numbers according to your needs.

4. Add together Code to .htaccess File

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

To edit the .htaccess file, y'all'll demand to connect to your server using FTP or cPanel File Manager. And so, discover the .htaccess file in the root binder (the same binder that contains wp-config.php).

Before making any edits, you should download a re-create of the file to your local figurer so that y'all have a safe backup in case something goes wrong (it'southward unlikely – only the .htaccess file is sensitive so you always desire to take a backup).

In one case you accept a fill-in, edit the file and add the following lawmaking:

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 lot can change the numbers according to your needs.

five. Talk to Your Host'south Support

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

And so – if nothing has worked then far, nosotros recommend that you accomplish out to your host's back up to see if they will increase your server'due south upload limit for you lot.

Workaround: Upload Via FTP and Import to WordPress

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

This won't permanently fix the problem, simply it will give you a way to get the file uploaded correct abroad, which might exist exactly what you demand right now.

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

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

For example:

/wp-content/uploads/2021/01/

At present, the file is on your server. Nonetheless, WordPress won't recognize information technology inside your Media Library still. To fix that, you can employ the complimentary Add From Server plugin to annals the file that y'all uploaded to your Media Library.

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

Choose folder

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

Import files

Once you import the file using the plugin, you'll meet the file in your Media Library but as if y'all'd uploaded it directly via your WordPress dashboard.

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

Increase WordPress Maximum File Upload Size Today

In this mail, we've shared a number of unlike methods that yous can utilize to increase your WordPress site's max file upload size.

For the simplest pick, you lot should beginning with the gratuitous Increase Maximum Upload File Size plugin. Nevertheless, remember that this plugin will only work if your WordPress site's max upload is set below your server's limit – it can't increase the server limit by itself.

If the server limit is the problem, you'll need to try ane of the code snippets that we shared. And if none of those piece of work, you tin can reach out to your host'southward support to see if they can help you lot out.

Or, you tin too get around this issue entirely by uploading a file via FTP and then 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, bank check out our guide on how to troubleshoot WordPress errors.

Withal have any questions most how to increment the maximum file upload size in WordPress? Ask us in the comments!

mooncogized.blogspot.com

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

0 Response to "How to Increase Php Upload Limit in Wordpress"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel