Spam bots hit unprotected contact forms within hours of going live, flooding inboxes with junk submissions and fake inquiries. Adding reCAPTCHA to your WordPress contact form stops 99% of automated…
Table of Contents
That “file exceeds maximum upload size” error stops you cold when you’re trying to install a theme or upload media.
WordPress sets default upload limits between 2MB and 128MB depending on your host, but you can increase this yourself. Most people don’t realize they have multiple methods to boost their upload capacity without contacting support.
This guide shows you how to increase WordPress upload size through php.ini, .htaccess, wp-config.php, functions.php, and cPanel. You’ll also learn how to verify your changes worked and troubleshoot common issues.
Takes about 10 minutes to implement any of these methods.
What is the WordPress Maximum Upload Size?
WordPress Maximum Upload Size is the largest file size you can upload through the WordPress dashboard in a single transfer.
Default limits range from 2MB to 128MB depending on your hosting provider and PHP configuration settings.
This restriction appears when you try to upload themes, plugins, media files, or any content through WordPress forms with file upload functionality.
Why WordPress Limits Upload Size
Server resources need protection from oversized file transfers that could crash the system.
PHP memory allocation sets boundaries to prevent individual uploads from consuming all available memory. Your hosting provider implements these restrictions to maintain server stability across all accounts on shared infrastructure.
Three directives control this: upload_max_filesize (individual file limit), post_max_size (total POST data), and memory_limit (PHP memory allocation).
Security plays a role too. Smaller upload limits reduce the risk of malicious files overwhelming your server or storage capacity.
Check Current WordPress Upload Limit
Media Library Method
Navigate to Media > Add New in your WordPress dashboard.
The maximum upload size displays directly below the file upload area. Takes about five seconds to find.
Site Health Tool Location
Go to Tools > Site Health > Info tab.
Expand the Server section to see upload_max_filesize, post_max_size, and memory_limit values. This shows all three PHP directives that control your upload capacity.
phpinfo() File Method
Create a new PHP file in your WordPress root directory with this code: <?php phpinfo(); ?>
Access it through your browser at yoursite.com/filename.php. Search for “upload_max_filesize” on the page.
Delete this file immediately after checking. Leaving phpinfo() accessible creates security vulnerabilities.
Increase Upload Size Through php.ini File
Locate php.ini File
The php.ini file lives in your server root directory, usually /public_html/ or /home/username/.
Some hosts place it in /usr/local/lib/ or require you to create one if it doesn’t exist. Check with your hosting provider’s documentation if you can’t find it.
Access it through FTP, File Manager in cPanel, or SSH depending on your setup.
Required Directives
Add or modify these four lines in your php.ini file:
upload_max_filesize = 256M
post_max_size = 256M
memory_limit = 512M
max_execution_time = 300
The memory_limit should be larger than post_max_size. Post_max_size should equal or exceed upload_max_filesize.
Max_execution_time determines how long PHP allows a script to run before timing out.
Specific Value Configurations
Set values based on your actual needs, not arbitrary large numbers.
Need to upload 50MB files? Set upload_max_filesize to 64MB for buffer room. Planning to restore 200MB backups? Go with 256MB.
Megabytes (MB) is the standard unit. Use 64M, 128M, 256M, or 512M depending on requirements.
Server Restart Requirements
Changes take effect immediately on most shared hosting environments.
VPS and dedicated servers might require Apache or nginx restart. Run sudo service apache2 restart or sudo service nginx restart through SSH.
Some configurations need PHP-FPM restart instead: sudo service php-fpm restart.
Modify Upload Limit Using .htaccess File
Access .htaccess Location
The .htaccess file sits in your WordPress root directory where wp-config.php lives.
Hidden files don’t show by default. Enable “Show Hidden Files” in your File Manager or FTP client settings.
Create a new .htaccess file if one doesn’t exist. Just make sure you’re not overwriting WordPress rewrite rules.
Apache Server Requirement
This method only works on Apache web servers, not nginx.
Most shared hosting uses Apache, but verify before editing. Adding Apache directives to nginx configurations causes errors.
Check your hosting control panel or ask support which web server you’re running.
Code Directives to Add
Insert these lines at the top of your .htaccess file:
php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value memory_limit 512M
php_value max_execution_time 300
Leave existing WordPress rules untouched below these additions.
Syntax Rules
No spaces around the equals sign in .htaccess syntax differs from php.ini format.
One directive per line. No semicolons at the end like in PHP code.
Wrong syntax breaks your entire site. Back up the original .htaccess before making changes.
Change Upload Size via wp-config.php
File Location in WordPress Root
The wp-config.php file sits in your WordPress root directory alongside wp-settings.php and wp-load.php.
Never edit this file without backing it up first. One syntax error locks you out of your entire site.
PHP Code to Insert
Add this line before “That’s all, stop editing!” comment:
@ini_set('upload_max_filesize', '256M');
@ini_set('post_max_size', '256M');
@ini_set('memory_limit', '512M');
Place it after the database settings block. The @ symbol suppresses error messages if the server doesn’t allow ini_set modifications.
Memory Limit Adjustments
WordPress defines WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT separately from PHP memory limit.
Add these lines if you need more memory for admin operations:
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');
WP_MEMORY_LIMIT controls frontend memory. WP_MAX_MEMORY_LIMIT applies to admin dashboard tasks.
Backup Before Editing
Download a copy of wp-config.php to your local machine before making changes.
Keep it somewhere safe. You’ll need the original if your edits break the site.
Some hosts offer automatic backups, but don’t rely on them for critical configuration files.
Adjust Upload Limit Through functions.php
Theme Functions File Access
Navigate to Appearance > Theme File Editor in WordPress dashboard.
Select functions.php from the right sidebar. Or access it through FTP at /wp-content/themes/your-theme/functions.php.
Editing the active theme’s functions.php can break your site if done wrong.
Filter Hooks to Use
Add this code at the end of functions.php:
@ini_set('upload_max_size', '256M');
@ini_set('post_max_size', '256M');
@ini_set('max_execution_time', '300');
The code runs every time WordPress loads. Changes apply immediately without server restarts.
Code Implementation
Paste the code after the last closing PHP tag, or before it if no closing tag exists.
Don’t add opening <?php tags if the file already starts with one. Double opening tags cause fatal errors.
Test your site immediately after saving. White screen means syntax error.
Child Theme Considerations
Always use a child theme for functions.php modifications.
Parent theme updates overwrite your changes. Child themes preserve custom code through updates.
Create a child theme if you don’t have one, or use a plugin like Code Snippets to avoid editing theme files directly.
Contact the Hosting Provider for Upload Increase
When to Contact Support
Your hosting provider controls server-side restrictions that override file-based configurations.
None of the previous methods worked? Time to contact support. Shared hosting often blocks php.ini and .htaccess modifications.
Some hosts set hard limits that require plan upgrades to increase.
Shared Hosting Limitations
Shared hosting environments typically cap uploads between 8MB and 64MB.
Multiple sites share the same server resources. Providers limit individual accounts to prevent one site from affecting others.
Budget hosts enforce stricter limits than premium shared hosting services.
VPS and Dedicated Server Options
VPS gives you root access to modify any PHP configuration setting.
Dedicated servers offer complete control over upload_max_filesize, post_max_size, and all other directives. No restrictions from hosting providers.
Migration from shared to VPS costs more but removes upload barriers permanently.
Hosting Plan Upgrades
Most hosting companies offer tiered plans with higher upload limits.
Basic plans limit uploads to 64MB. Business plans allow 256MB or higher. Check your host’s plan comparison page for specifics.
Upgrading costs $5-20 more per month depending on the provider.
Increase Upload Size Through cPanel
MultiPHP INI Editor Location
Log into cPanel and search for “MultiPHP INI Editor” in the search bar.
It’s usually under Software or Advanced sections. Different cPanel themes organize tools differently.
This tool only exists if your host enables it. Not all hosting control panels include MultiPHP INI Editor.
Basic vs Advanced Mode
Basic mode shows common PHP settings with dropdown menus and input fields.
Advanced mode displays raw php.ini content for direct editing. Riskier but offers more control over PHP directives.
Start with basic mode unless you know exactly what you’re editing.
PHP Options to Modify
Find these four settings in basic mode:
- upload_max_filesize
- post_max_size
- memory_limit
- max_execution_time
Change the values, then select your domain from the dropdown if you host multiple sites.
Apply Changes Process
Click “Apply” button at the bottom after changing values.
Changes take effect within seconds. No server restart needed for cPanel modifications.
Verify the new limits in WordPress Media Library immediately to confirm they worked.
Common Issues After Increasing the Upload Limit
Changes Not Reflecting
Browser cache shows old upload limits even after increasing them.
Clear your browser cache and hard refresh (Ctrl+F5 or Cmd+Shift+R). Check Site Health again to see if PHP upload settings updated.
Some hosts cache PHP configurations for up to 5 minutes before applying changes.
Error Messages
“The uploaded file exceeds the upload_max_filesize directive” means your change didn’t apply.
“Maximum execution time exceeded” indicates max_execution_time is too low. Increase it to 300 or 600 seconds.
Post_max_size errors appear when trying to upload multiple files that exceed the combined POST limit.
File Upload Timeouts
Large files fail on slow connections before reaching the server.
Max_execution_time controls server-side timeouts. Network speed causes client-side timeouts that PHP settings can’t fix.
Split large uploads into smaller chunks or use FTP for files over 500MB.
Browser Cache Problems
Old cached values persist in your browser memory even after configuration changes.
Open an incognito window to test uploads without cache interference. Or clear all site data for your WordPress domain specifically.
Mobile browsers cache aggressively. Test on desktop first to isolate the issue.
Verify Upload Size Increase
Test File Upload
Try uploading a file larger than your previous limit through Media Library.
Use a real file you need rather than test files. Confirms both the limit increase and file compatibility.
Watch for error messages during upload. Success means your changes worked.
Check Media Settings Again
Return to Media > Add New to see the updated maximum upload size.
The number displayed should match your new upload_max_filesize value. If it doesn’t, one of your configuration changes failed to apply.
Site Health tool also reflects new limits under Server information.
Confirm with Different File Types
Test multiple file upload types including images, PDFs, ZIP files, and videos.
Some file types have separate restrictions from plugins or server configurations. WordPress contact form plugins sometimes limit upload types regardless of PHP settings.
Different file extensions occasionally trigger different upload paths with separate limits.
Troubleshoot if Unsuccessful
Recheck every configuration file for syntax errors.
Verify your hosting provider doesn’t enforce hard limits below your settings. Contact support if file-based methods consistently fail.
Try the methods in order: php.ini first, then .htaccess, then wp-config.php, then functions.php, finally cPanel or hosting support.
FAQ on How To Increase WordPress Upload Size
What is the default WordPress upload size limit?
WordPress default upload limit ranges from 2MB to 128MB depending on your hosting provider’s PHP configuration. Most shared hosting sets it between 8MB and 64MB. The limit appears in Media Library under the file upload area.
Why can’t I upload large files to WordPress?
PHP directives like upload_max_filesize, post_max_size, and memory_limit restrict file sizes to protect server resources. Your hosting provider implements these limits to prevent one site from consuming excessive memory or storage capacity that affects other accounts on shared infrastructure.
How do I check my current upload limit?
Go to Media > Add New in your WordPress dashboard to see the maximum upload size displayed below the upload area. Alternatively, check Tools > Site Health > Info > Server section for detailed PHP configuration values including upload_max_filesize and post_max_size.
Which method is best for increasing upload size?
The php.ini method works best because it controls all PHP settings at the server level. If you can’t access php.ini, try .htaccess on Apache servers or wp-config.php as alternatives. cPanel’s MultiPHP INI Editor offers the easiest interface for most users.
Do I need to restart my server after changes?
Shared hosting applies changes immediately without restart. VPS and dedicated servers require Apache, nginx, or PHP-FPM restart depending on your configuration. Run sudo service apache2 restart or sudo service php-fpm restart through SSH to apply modifications on self-managed servers.
Can I increase upload size without accessing server files?
Yes, through cPanel’s MultiPHP INI Editor if your host enables it. Navigate to cPanel, find MultiPHP INI Editor, adjust upload_max_filesize and post_max_size values, then apply changes. Contact your hosting provider support if file-based methods aren’t available on shared hosting.
What if my changes don’t work?
Clear browser cache and hard refresh to see updated limits. Check that post_max_size equals or exceeds upload_max_filesize and memory_limit is larger than both. Your host might enforce hard limits below your settings that require plan upgrades or support intervention.
How large should I set my upload limit?
Set limits based on actual needs, not arbitrary large numbers. Need 50MB files? Use 64MB for buffer. Planning 200MB backups? Set 256MB. Unnecessarily high values waste server memory and create security vulnerabilities without providing practical benefits.
Will increasing upload size slow my site?
No, changing upload limits doesn’t affect site speed or performance. The max_execution_time directive only applies during active uploads. Higher memory_limit values reserve resources but don’t consume them unless needed. Your site runs normally between uploads regardless of configured limits.
Can plugins increase my upload limit?
Some plugins claim to increase limits but they modify the same configuration files you can edit manually. Most fail on shared hosting where hosts block ini_set functions. Direct file editing or cPanel modifications prove more reliable than plugin-based solutions for upload capacity expansion.
Conclusion
You now know how to increase WordPress upload size through multiple methods: php.ini, .htaccess, wp-config.php, functions.php, and cPanel’s MultiPHP INI Editor.
Start with the php.ini method if you have server access. Falls back to .htaccess on Apache servers or wp-config.php modifications if needed.
Remember that upload_max_filesize, post_max_size, and memory_limit work together. Set post_max_size equal to or higher than upload_max_filesize, and memory_limit above both values.
Most changes take effect immediately on shared hosting. VPS and dedicated servers need service restarts.
Clear your browser cache after making configuration changes to see updated limits. Test with actual files you need to upload rather than dummy files.
Contact your hosting provider if file-based methods fail. Some hosts enforce restrictions that require plan upgrades.


