The 413 Request Entity Too Large error is an HTTP status code generated by your web server (usually Nginx or Apache) when the client (your browser) attempts to upload a file that exceeds the server’s configured maximum upload size limit.
In WordPress, you will almost exclusively encounter this error when trying to upload a premium theme, a massive plugin, or high-resolution media directly through the WordPress dashboard.
Unlike a 400 Bad Request where the data packet is malformed, a 413 error means the data is perfectly fine—it is simply too large for the server’s security pipes. Here is exactly how to bypass this restriction by increasing your server’s upload limits.
1. Increase Limits via php.ini
If you are using cPanel or have root access to your server, modifying the PHP initialization file is the most direct way to fix this issue.
Locate your php.ini file (often found in the public HTML root or accessible via cPanel’s ‘MultiPHP INI Editor’) and update the following parameters:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
Crucial Tip: Always ensure post_max_size is equal to or slightly larger than upload_max_filesize. Additionally, increasing max_execution_time is mandatory; otherwise, uploading a massive 128MB file on a slow connection will trigger a 504 Gateway Timeout before the upload finishes.
2. Increase Limits via .htaccess (Apache Servers)
If your server runs on Apache and you cannot locate a php.ini file, you can enforce these limits directly through the .htaccess file located in your WordPress root directory.
Connect via FTP, edit the .htaccess file, and append these lines at the very bottom:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
3. Fix the Error on Nginx Servers
If you are running a modern VPS or Cloud Server, it is highly likely you are using Nginx. Nginx ignores .htaccess files and has its own strict, hardcoded limit for client request bodies (which defaults to a measly 1MB).
To fix the 413 error on Nginx, you must edit the server block configuration.
- Access your server via SSH.
- Edit the main configuration file:
sudo nano /etc/nginx/nginx.conf - Look for the
http { ... }block and add the following line inside it:
client_max_body_size 128M;
- Save the file and restart Nginx to apply the changes:
sudo systemctl restart nginx
4. Upgrade Your Hosting Plan
If you are on an entry-level shared hosting plan, your provider will likely completely block your ability to modify .htaccess, php.ini, or Nginx configurations to prevent you from hogging server resources. This leaves you completely stuck, unable to install the themes or plugins your business requires.
Do not let restrictive server limits hold back your website’s development. Nextgen’s WordPress Hosting in Pakistan comes with developer-friendly configurations out of the box. Our environments feature extremely generous, pre-optimized upload limits and execution times, ensuring that your heavy themes, premium plugins, and high-definition media upload smoothly on the very first try.
Accelerate your eCommerce store workflows and media processing with custom WordPress development.
