Are you frustrated by WordPress limiting the maximum file size you can upload? Whether you‘re trying to add a large image, video, audio file, or plugin, hitting that upload limit can stop you in your tracks.
Fortunately, there are several ways to increase the maximum file upload size in WordPress. In this expert guide, we‘ll walk you through exactly how to do it, step-by-step.
But first, why does WordPress limit upload size in the first place? And when might you need to raise that limit? Let‘s dive in.
Why WordPress Has a Maximum File Upload Size Limit
Out of the box, WordPress sets a maximum file upload size. For most web hosts it defaults to 2 MB, although some hosts may set it higher, like 128 MB or even 256 MB.
So why cap uploads at all? The main reason is to preserve your hosting account‘s disk space, performance, and bandwidth. Allowing huge file uploads could quickly eat up storage, slow down your site, and consume excessive bandwidth as those large files are downloaded.
WordPress and your web host have to balance convenience with these web server resource constraints. That‘s why the default upload limit tends to be on the conservative side.
When You May Need to Increase the WordPress File Size Limit
For many websites, the default max upload size is sufficient. But there are some common scenarios where you may need to raise it:
- Uploading high-resolution images or graphics, especially for a photography site or design portfolio
- Adding video or audio content directly to your WordPress Media Library, rather than embedding from YouTube, Vimeo, etc.
- Installing a premium WordPress theme or plugin that has a large file size
- Offering downloadable content like ebooks, white papers, or software
- Allowing users to submit their own images, documents, or other files, like for a job board, real estate listings, or community site
If you try to upload a file that exceeds your WordPress site‘s maximum upload size, you‘ll see an error message telling you the limit and that your file exceeds it. To get past this roadblock, you‘ll need to raise the limit using one of the methods below.
But first, you should check what your current upload limit is set to. Here‘s how to find out.
How to Check Your Current WordPress Max File Upload Size
There are a few ways to see what your WordPress site‘s upload size limit is currently set to:
In your WordPress dashboard, go to Media → Add New. Below the file uploader area, you‘ll see the maximum upload file size listed.
In your WordPress dashboard, go to Media → Add New. Try uploading a file that‘s larger than the limit. After it fails, you‘ll see an error message stating your specific limit.
Install and activate the free Site Health Tool plugin. Then go to Tools → Site Health. Under the "Server" section, you‘ll see your max upload size listed.
Alternatively, you can create a small PHP file to check your limit:
Using a text editor, create a new file named filesize.php
Paste the following code into the file:
<?php
phpinfo();
?>Save the file and upload it to your WordPress site‘s root directory using FTP/SFTP. (Don‘t put it in the /wp-content/ directory. It needs to be in the same directory as your wp-config.php file.)
In your browser, go to yourwebsite.com/filesize.php.
In the "Core" section, look for "post_max_size" and "upload_max_filesize". These will show your current limits.
After checking, delete the filesize.php from your server for security purposes. Don‘t leave this file on your server.
Now that you know your current max upload size limit, here are 5 ways to increase it on your WordPress site.
Method 1: Ask Your WordPress Host to Increase the File Upload Limit
The simplest approach is often to ask your WordPress hosting provider to raise the upload limit for you. For many shared hosting accounts, the hosting company caps the upload size below what your site may need.
Reach out to your host‘s support team via live chat, a support ticket, or phone call. Politely explain your situation and ask them to increase the max upload size for your account. Many hosts will do this for free upon request.
The trick is knowing what to ask for. Don‘t just say "increase my upload limit". Instead, be specific about what you need. A reasonable range is typically between 64 MB to 128 MB.
If your host does raise the limit, double-check that it worked by following the steps above to view your current max upload size.
Also be aware that your host may have restrictions on the types of files you can upload, no matter the size. For example, some do not allow uploading .zip or other executable files for security reasons.
If your host is unable or unwilling to increase your upload size limit, you may need to upgrade to a higher tier plan or switch to a more generous host. However, there are still a few tricks you can try yourself to raise the limit. Which brings us to our next method…
Method 2: Create or Edit Your php.ini File
You can often increase your WordPress upload limit by creating and editing a file named php.ini. This file controls configurations for your WordPress site on the server.
Here‘s how to create a php.ini file with an increased upload limit:
- Open a text editor like Notepad or TextEdit
- Paste in the following code:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300Save the file as php.ini
Connect to your WordPress site via FTP/SFTP
Upload the php.ini file to your WordPress root directory (the same directory as the wp-config.php file)
If your hosting account already has an existing php.ini file, you can edit it instead:
- Connect to your site via FTP/SFTP
- Locate the php.ini file in your WordPress root directory
- Download the file to your computer and open it in a text editor
- Look for the line that specifies upload_max_filesize. If the line exists, change the M number to your desired max file size in megabytes. If the line doesn‘t exist, paste in: upload_max_filesize = 128M
- Do the same for post_max_size and max_execution_time if those lines exist, or add them if missing.
- Save the edited php.ini file
- Upload it back to your server, overwriting the old file
Note that some hosts may not allow you to create or edit your own php.ini file. If you get a permissions error when uploading, or the file upload succeeds but the limit doesn‘t change, contact your host. They may be able to create the file for you or make the change on their end.
Method 3: Edit Your WordPress Theme‘s functions.php File
Another place you can add code to increase your WordPress max upload size is in your theme‘s functions.php file. This file loads with every page, so code placed here will be executed across your whole site.
Here‘s how:
In your WordPress dashboard, go to Appearance → Theme Editor
In the right-hand sidebar, click on Theme Functions (functions.php)
Scroll down to the bottom of the file and paste in the following code:
@ini_set( ‘upload_max_size‘ , ‘128M‘ );
@ini_set( ‘post_max_size‘, ‘128M‘);
@ini_set( ‘max_execution_time‘, ‘300‘ );- Click the "Update File" button
Be very careful when editing your functions.php file. One wrong character or misplaced bit of code can break your site.
If you‘re not comfortable editing this file directly, you can use a plugin like Code Snippets to add the PHP code instead. With the plugin installed, go to Snippets → Add New and paste in the code. Give it a name, choose "Run snippet everywhere," and click the "Save Changes and Activate" button.
As with the php.ini method, some hosting servers may not allow you to change the upload limit this way. If you add the code and it doesn‘t raise the limit, try one of the other methods.
Method 4: Edit Your .htaccess File
The .htaccess file is a server configuration file that you can edit to enable/disable certain functionality. By adding a few lines of code to this file, you can increase the WordPress max upload size limit.
Here‘s how:
- Connect to your WordPress site via FTP/SFTP
- Locate the .htaccess file in your WordPress root directory. Note that this file may be hidden, so make sure your FTP client is set to show hidden files.
- Download the .htaccess file to your computer and open it in a text editor
- Paste the following code at the bottom of the file:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300- Save the edited file and re-upload it to your server, overwriting the existing .htaccess file.
After editing your .htaccess file, test uploading a larger file to confirm the new limit is in place. If it doesn‘t work, your host may be overriding your .htaccess settings. Reach out to their support for guidance.
Also be careful when editing your .htaccess file. It‘s a crucial file for your site, and any mistakes could cause errors or downtime. Always make a backup of the file first before making changes.
Method 5: Use a WordPress Plugin to Increase the Upload Limit
If you‘re not comfortable messing with code and server files, there are a few WordPress plugins that can help you increase the max upload size. One of the simplest is Increase Maximum Upload File Size.
Here‘s how to use it:
- In your WordPress dashboard, go to Plugins → Add New
- Search for "Increase Maximum Upload File Size"
- Install and activate the plugin
- Go to Settings → Increase Upload Max File Size
- Select your desired maximum upload size from the dropdown menu
- Click the "Save Changes" button
The one downside of this plugin approach is that it can only increase your max upload size up to what is allowed by your hosting server. So if your host caps upload sizes at 64 MB, for example, that will be the highest you can set via the plugin dropdown.
If you need an even higher limit, reach out to your host. They‘ll need to adjust the server settings to allow larger uploads.
Frequently Asked Questions About the WordPress Max Upload Size
Let‘s go over some common questions and concerns about increasing the WordPress max file upload limit:
Will increasing the upload size make my site less secure?
Not substantially. As long as you‘re still following WordPress security best practices, allowing larger file uploads doesn‘t inherently put your site at greater risk.
That said, do think carefully about who you‘re allowing to upload large files directly to your server. If you let any user upload 100+ MB files, for example, you could be vulnerable to abuse or attacks that overwhelm your hosting account‘s resources. Consider restricting large file uploads to only trusted admins and users.
Will increasing the upload size slow down my site?
It shouldn‘t have any impact on your site‘s speed or performance just by increasing the potential upload size. However, if you do start uploading tons of large files, like unoptimized images or videos, that can bog down your server.
As a best practice, always optimize your media files before uploading. And consider hosting large video/audio files externally, such as on YouTube, Vimeo, or Soundcloud, then embedding them into your WordPress pages.
What‘s the maximum upload size I can set?
Ultimately, your web server will have a hard limit on the max file size it allows. Even if you add code to your php.ini, functions.php, or .htaccess to allow 500 MB uploads, for example, your host likely has a lower server-side limit that will override your code.
Theoretically you could allow massive file uploads if you have your own VPS or dedicated server. But for most shared WordPress hosting accounts, 128 MB is a common upper limit. If you try to raise it beyond that, your host may push back and ask you to upgrade to a higher plan tier.
What if I upload a file and get a 413 Request Entity Too Large error?
A 413 error means the file you‘re trying to upload exceeds the maximum upload size set in your php.ini or .htaccess file. You‘ll need to increase the upload_max_filesize and post_max_size values in those files.
If you‘ve already set those values higher than the file size you‘re uploading, the 413 error may be coming from your hosting server. Contact their support team for guidance on how to resolve it.
What if I upload a file and get a 500 Internal Server Error?
While less common, a 500 internal server error can sometimes occur after uploading a large file. Possible causes include:
- The max_execution_time or max_input_time values are set too low in your php.ini or .htaccess file. Try increasing them to at least 300.
- The uploaded file is corrupt or has an invalid file type. Try uploading a different file.
- Your WordPress hosting account is running out of disk space. Upgrade your hosting plan or delete unused files and plugins.
- There‘s a plugin or theme conflict. Try temporarily deactivating your plugins and swapping to a default theme, then testing the upload again.
Wrapping Up
Whether you‘re a photographer uploading high-res images or a podcaster hosting audio files, hitting the WordPress max upload size limit can be a pain. But as you can see, there are several ways to increase that limit and continue uploading the content your site needs.
The simplest solution is often to ask your hosting provider to raise the limit for you. But if you‘re feeling a bit more adventurous, give one of the other methods a try. And if you do get stuck, don‘t be afraid to reach out to your host‘s support team for guidance. They can be an invaluable resource, especially when messing with server configuration files.
One final thought: Just because you can dramatically increase your WordPress upload limit doesn‘t always mean you should. Think carefully about the types and sizes of files you really need to store in your WordPress Media Library.
In many cases, you may be better off optimizing your files to be as small as possible, or hosting them externally. That will put less strain on your WordPress server in the long run.
But for those times when you really do need to upload huge files, it‘s nice to know how to unleash the full power of WordPress!
