How to Increase the Upload File Size Limit in WordPress
When working with WordPress, you may encounter a frustrating error message: “The uploaded file exceeds the upload_max_filesize directive in php.ini.” This happens when the file you’re trying to upload (a plugin, theme, image, or video) is larger than the server’s configured limit.
Step 4 is most important
Fortunately, there are several ways to increase the upload file size limit in WordPress. Let’s walk through the most effective methods:
1. Check Current Upload Limit
Before making any changes, check your current file upload size:
- Go to your WordPress dashboard.
- Navigate to Media → Add New.
- Below the upload box, you’ll see something like: “Maximum upload file size: 2 MB”.
2. Update .htaccess
File (For Apache Servers)
If you’re on an Apache server, try modifying the .htaccess
file in your root WordPress directory:
apacheCopyEditphp_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
⚠️ If adding these lines causes a 500 Internal Server Error, remove them immediately. Your host may not allow overriding PHP settings via
.htaccess
.
3. Edit php.ini
File
If your hosting provider gives you access to the php.ini
file (common in VPS or dedicated servers), modify or create it in your root directory:
iniCopyEditupload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
After making changes, restart your web server if required.
4. Modify wp-config.php
You can also try modifying the wp-config.php
file in your WordPress root directory:
phpCopyEdit@ini_set('upload_max_size' , '64M');
@ini_set('post_max_size','64M');
@ini_set('max_execution_time','300');
Note: This method may not work if your host does not allow overriding these settings.
5. Contact Your Hosting Provider
If none of the above methods work, reach out to your hosting provider and ask them to increase the upload limit. Most shared hosting providers will do this quickly upon request.
6. Use a Plugin
There are several plugins that can help you increase the upload file size without manual edits:
- Increase Max Upload Filesize
- WP Maximum Upload File Size
- File Upload Max Size
Install one from the WordPress plugin directory and follow the plugin’s instructions.
Conclusion
Increasing the file upload limit in WordPress is essential for uploading large themes, plugins, or media. While some methods work only on certain servers, one of the approaches above should solve the issue for you. Always make a backup before editing server files.
✅ Recommended upload limit: At least 64 MB for smooth media uploads.