Do you want to increase the maximum file upload size in WordPress? Sometimes, a low upload limit can prevent you from uploading large files or installing bigger plugins and themes. In this article, we’ll show you how to easily increase the maximum file upload size in WordPress.
Why Increase the Maximum File Upload Size?
Your WordPress hosting provider sets a default maximum file upload size when you first sign up and install WordPress. This limit can range from 2MB to 500MB. For most users, this is enough. However, sometimes you may need to increase this limit to avoid upload errors.
For example, you might need to increase the limit if:
- You run a photography website and need to upload large images.
- Your portfolio has large design or photography files.
- You want to install a larger WordPress theme or plugin.
- You sell digital products like eBooks, photos, or videos.
- You regularly update content with large audio, photos, or other media.
Now, let’s see how you can increase the maximum file upload size in WordPress.
How to Check Your Maximum File Upload Size
To find your current maximum file upload size, go to your WordPress admin panel and navigate to Media » Add New. You will see the maximum file upload size limit displayed there.
Methods to Increase the Maximum File Upload Size
Here are five methods you can use to increase the maximum file upload size in WordPress:
- Contact Your Hosting Provider The easiest way is to ask your hosting provider to increase the limit. This is a simple task for their customer service team and can be done in minutes. Just log in to your hosting provider’s website, like Bluehost, and use their chat support or contact them through your account dashboard.
- Create or Edit a php.ini File Another way is to create or edit a file called php.ini, which controls many settings for your hosting environment. If your host uses cPanel, you can do this through the built-in tools. Here’s how:
- Log in to your hosting account and open cPanel.
- In the Software section, click on ‘MultiPHP INI Editor’.
- Find the ‘upload_max_filesize’ setting and enter a new value, then click ‘Apply’.
If you don’t have cPanel, you can edit the php.ini file manually:
- Use an FTP client or the file manager in your hosting control panel.
- If you don’t see a php.ini file, create one and upload it to your root folder.
- Add the following code to the file:
php
upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 300
- Adjust the values as needed.
- Add Code to Your Theme’s functions.php File You can add code to your theme’s functions.php file to increase the upload size. Use the WPCode plugin to do this safely without editing files directly:
- Install and activate the WPCode plugin.
- Go to Code Snippets » + Add Snippet.
- Choose ‘Add Your Custom Code’ and select ‘PHP Snippet’.
- Copy and paste the following code:
php
@ini_set('upload_max_size', '256M');
@ini_set('post_max_size', '256M');
@ini_set('max_execution_time', '300');
- Activate and save the snippet.
- Add Code to Your .htaccess File You can also modify the .htaccess file, which controls configuration settings for your website:
- Log in to your website server via FTP.
- Locate the .htaccess file in your root folder.
- Add the following code:
php
php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value max_execution_time 300
php_value max_input_time 300
- Adjust the values as needed.
- Use a Plugin If you’re not comfortable adding code, you can use a plugin like WP Increase Upload Filesize:
- Install and activate the plugin.
- Go to Media » Increase Upload Limit in your admin panel.
- Select a new file upload size from the drop-down menu and click ‘Save Changes’.
Note
Keep in mind that displaying many large files on your website can slow it down. It’s usually better to avoid uploading videos directly to WordPress. Instead, use a service like YouTube or Vimeo and embed the videos on your site.
By following these methods, you can easily increase the maximum file upload size in WordPress to suit your needs.