Understanding the WordPress Theme Upload File Size Limit
When you try to upload a WordPress theme via the Appearance → Themes → Add New → Upload Theme interface, you might encounter an error message indicating that the uploaded file exceeds the `upload_max_filesize` directive in `php.ini`. This isn't a WordPress specific limit, but rather a server-level restriction imposed by your web host to manage resource consumption and prevent abuse.
The default limits can vary significantly. Shared hosting plans often have lower limits (e.g., 2MB, 8MB, 16MB), while VPS or dedicated servers might offer more generous defaults (e.g., 64MB, 128MB). Many modern WordPress themes, especially those with extensive demo content, bundled plugins, or complex assets, can easily exceed these lower thresholds. A typical theme package, such as a Themify theme with all its features, might range from 5MB to 30MB, making these limits a common hurdle for web designers and agencies.
Beyond the `upload_max_filesize`, two other critical PHP directives play a role: `post_max_size` defines the maximum size of data that can be sent to the server in a POST request, and `memory_limit` specifies the maximum amount of memory a script can consume. For successful theme uploads, `post_max_size` should always be equal to or greater than `upload_max_filesize`, and `memory_limit` should be sufficiently high to process the upload (e.g., 128M or 256M).
Why Your Theme Upload Might Fail (Common Causes)
Multiple factors can contribute to a failed theme upload due to size limitations, often leading to generic error messages that don't immediately pinpoint the root cause.
The most straightforward reason is that the `.zip` file containing your theme (e.g., `my-theme.zip`) simply exceeds the `upload_max_filesize` configured on your server. If your host has set this to 8MB and your theme is 15MB, the upload will fail instantly.
Another common, yet less obvious, issue is that the `post_max_size` directive is lower than `upload_max_filesize`. Even if you raise `upload_max_filesize` to 32MB, but `post_max_size` remains at 8MB, the server will still reject the larger POST request containing your theme file. Always ensure `post_max_size` is at least equal to, if not slightly larger than, `upload_max_filesize`.
Finally, insufficient `memory_limit` can also cause problems. While less directly tied to the file size itself, the process of extracting and installing a large theme requires adequate memory. If your `memory_limit` is set too low (e.g., 32M or 64M), the server might run out of memory during the installation process after the file has been successfully uploaded, leading to an HTTP 500 error or a blank screen.
Before attempting any changes, you can verify your current PHP limits. Navigate to Tools → Site Health → Info in your WordPress dashboard, then expand the "Server" section. Here you'll find entries for `upload_max_filesize`, `post_max_size`, and `memory_limit`.
Method 1: Adjusting PHP Limits via Your Hosting Control Panel
This is often the safest and easiest method, as it doesn't require direct file editing and is typically available on most shared hosting environments. Many hosts provide graphical interfaces to manage PHP settings.
Log in to your hosting control panel (e.g., cPanel, Plesk, custom dashboard). Look for sections related to PHP Configuration, Select PHP Version, or PHP Manager. Within these sections, you should find options to modify PHP directives.
Locate `upload_max_filesize`, `post_max_size`, and `memory_limit`. Increase these values to a suitable level. For a typical theme, setting `upload_max_filesize` to 64M, `post_max_size` to 64M, and `memory_limit` to 256M is usually sufficient. Remember to save your changes. The exact path and naming can vary between hosts, but the core functionality remains similar. Changes made here usually take effect immediately or within a few minutes.
Method 2: Editing Your php.ini File
If your host doesn't provide a direct interface, or you're on a VPS/dedicated server, editing `php.ini` is the definitive way to adjust PHP settings. You might have access to a global `php.ini` or be able to create a custom one for your domain.
Access your server via SFTP or your host's file manager. Look for the `php.ini` file in your root directory, `public_html`, or a `cgi-bin` folder. If you can't find one, you might need to create it in your WordPress root directory (`/public_html/`).
Add or modify the following lines:
```ini upload_max_filesize = 64M post_max_size = 64M memory_limit = 256M max_execution_time = 300 max_input_time = 300 ```
The `max_execution_time` and `max_input_time` directives, set to 300 seconds (5 minutes), prevent timeouts during the upload and processing of larger files. Save the file. For changes to take effect, you might need to restart your web server (Apache/Nginx) or PHP-FPM service, which is typically done via your hosting control panel or by contacting support.
Method 3: Modifying Your .htaccess File
For some shared hosting environments, you might be able to override PHP settings using the `.htaccess` file in your WordPress root directory. This method works if your server is running Apache with `mod_php` and `AllowOverride All` is enabled, but it's not always supported or recommended.
Access your WordPress root directory (`/public_html/`) via SFTP or file manager. Locate the `.htaccess` file. If you can't see it, ensure your file manager is set to show hidden files.
Add the following lines at the bottom of your `.htaccess` file, before or after any existing WordPress rules:
``` php_value upload_max_filesize 64M php_value post_max_size 64M php_value memory_limit 256M php_value max_execution_time 300 php_value max_input_time 300 ```
Save the `.htaccess` file. These changes should take effect immediately without a server restart. If you encounter a "500 Internal Server Error" after saving, it means your host does not permit PHP value overrides via `.htaccess`. In that case, revert the changes immediately and try another method.
Method 4: Using WordPress's functions.php File (Limited Use)
While not a direct solution for `upload_max_filesize` or `post_max_size`, you can attempt to increase `memory_limit` using WordPress's `functions.php` file or `wp-config.php`. This method is less reliable for upload limits as they are typically set at a higher server level, but it can help with memory issues during theme activation.
Access your theme's `functions.php` file via Appearance → Theme File Editor (or SFTP in `wp-content/themes/your-theme-name/functions.php`). Alternatively, edit your `wp-config.php` file in the root directory via SFTP.
In `functions.php`, add this line at the top, after the opening `<?php` tag:
```php @ini_set( 'memory_limit', '256M' ); ```
In `wp-config.php`, add this line before the `/* That's all, stop editing! Happy publishing. */` comment:
```php define( 'WP_MEMORY_LIMIT', '256M' ); ```
While these lines can influence WordPress's memory usage, they often cannot override a lower `memory_limit` set in `php.ini` or by your host. The server's `php.ini` settings always take precedence. Use this as a last resort for memory issues if other methods fail to provide sufficient memory to PHP scripts.
Alternative: Manual Theme Installation via SFTP
If you've tried all methods to increase your WordPress theme upload file size limit and still face issues, or if you simply prefer a more direct approach, manual installation via SFTP (Secure File Transfer Protocol) is a reliable alternative. This bypasses all PHP upload limits entirely.
First, unzip your theme file (e.g., `my-theme.zip`) on your local computer. This will reveal a folder, typically named after the theme (e.g., `my-theme`). This folder contains all the theme's core files, including `style.css`, `index.php`, `functions.php`, and others.
Connect to your web server using an SFTP client (like FileZilla, Cyberduck, or Transmit). Navigate to your WordPress installation's `wp-content/themes/` directory. Upload the unzipped theme folder (e.g., `my-theme`) directly into this directory. Ensure you upload the *folder*, not the `.zip` file.
Once the upload is complete (which can take several minutes for larger themes over SFTP), log into your WordPress admin dashboard. Go to Appearance → Themes. You should now see your manually uploaded theme listed. Click "Activate" to make it live on your site.
This method is particularly useful for very large themes or when facing persistent server configuration challenges. Themify themes, like any standard WordPress theme, are fully compatible with SFTP installation.
Verifying Your Changes and Re-uploading Your Theme
After attempting any of the PHP configuration changes, it's crucial to verify that they have been applied correctly before trying to upload your theme again.
Return to your WordPress dashboard and navigate to Tools → Site Health → Info. Expand the "Server" section and check the values for `upload_max_filesize`, `post_max_size`, and `memory_limit`. Confirm that they reflect the new, higher values you set.
If the values haven't updated, try clearing any caching plugins you might be using and check again. If they still show the old values, your changes were either not saved correctly, the server wasn't restarted (if required), or the method you chose is not supported by your hosting environment. In this case, revisit the steps or contact your hosting provider's support team for assistance.
Once verified, navigate to Appearance → Themes → Add New → Upload Theme. Click "Choose File," select your theme's `.zip` file, and click "Install Now." The upload and installation process should now proceed without the file size limit error. After successful installation, remember to click "Activate" to apply the new theme to your website.
Frequently asked questions
- What is the recommended `upload_max_filesize` for WordPress?
- A recommended `upload_max_filesize` for WordPress is typically 32MB or 64MB, ensuring compatibility with most modern themes and plugins. Always set `post_max_size` to an equal or higher value and `memory_limit` to at least 128MB or 256MB for optimal performance.
- Can I increase the upload limit without cPanel access?
- Yes, you can often increase the upload limit without cPanel access by editing your `php.ini` file (if you have SFTP/FTP access to your server), modifying the `.htaccess` file, or contacting your hosting provider to adjust the settings for you.
- What if my host won't let me change PHP limits?
- If your host prevents you from changing PHP limits, your best options are to either manually install your theme via SFTP, optimize your theme file to reduce its size, or consider upgrading your hosting plan or switching to a provider that offers more flexibility and control over PHP configurations.
- Will increasing the upload limit slow down my website?
- Simply increasing the `upload_max_filesize` itself will not directly slow down your website during normal operation. However, setting extremely high `memory_limit` values unnecessarily could consume more server resources, potentially impacting performance if your server is already resource-constrained.

Add to Chrome — free