How to Fix the 413 Request Entity Too Large Error in WordPress: The Complete Guide

As a webmaster with over 15 years of experience using WordPress, I know how frustrating the ‘413 Request Entity Too Large‘ error can be. You‘re trying to upload a file, theme, or plugin and then bam – blocked by this vague-sounding error message.

Not to worry, friend. In this comprehensive guide, I‘ll show you exactly why you‘re seeing the 413 error in WordPress and walk you through how to properly fix it.

Why Does the 413 Error Happen in WordPress?

To understand what causes this error, we first need to talk about WordPress upload file size limits.

When WordPress was first created in 2003, the average size for a digital photo was just around 1MB. For context, today the average smartphone photo is around 4MB!

As digital media and file sizes grew over the years, WordPress needed a way to restrict maximum upload sizes to prevent users from crippling websites with ginormous files.

That‘s why WordPress lets web hosts configure a maximum upload file size limit. This is usually set very conservatively between 2-8MB by default on most managed WordPress hosts.

When you try to upload a file larger than this limit, WordPress will return the 413 error stating that the "Request Entity" (your file) is too darn large!

Here are some statistics on common file sizes that can trigger this error:

  • Average WordPress themes today range from 1MB to 8MB+ when zipped.
  • Popular plugins like WooCommerce can be over 10MB.
  • High resolution photos from DSLR cameras are often 10-30MB.
  • HD video files are typically 50MB to 500MB+.

As you can see, it doesn‘t take much to hit that tiny 2-8MB limit and get the dreaded 413 error in WordPress!

Request Entity Too Large error when uploading file

Now let‘s go over a few different methods to increase the upload size limit and fix this frustrating issue for good!

Method 1: Increase File Size Limit in wp-config.php (Recommended)

The best and easiest way to increase the upload size limit in WordPress is by adding some code to your wp-config.php file.

This file allows you to customize settings and configurations for your WordPress site. It‘s one of the most powerful files!

Here are the steps I recommend to raise the max upload size in wp-config.php:

  1. Use an FTP program or file manager in your web host dashboard to access the wp-config.php file located in the main WordPress directory.

  2. Open the wp-config.php file in a text editor like Notepad or TextEdit. Pro Tip: Always make a backup first!

  3. Add the following code before the line that says That‘s all, stop editing!:

@ini_set( ‘upload_max_filesize‘ , ‘64M‘ );
@ini_set( ‘post_max_size‘, ‘64M‘);  
@ini_set( ‘max_execution_time‘, ‘300‘ );
  1. Save changes and upload the file back to replace wp-config.php on your server.

This will increase the max upload file size to 64MB, max POST size to 64MB, and max execution time to 300 seconds. Feel free to tweak the values as needed to fit your specific upload size requirements.

I love this method because it doesn‘t require you to access or edit any server config files. As long as you can access wp-config.php, you can make this adjustment yourself easily.

Method 2: Increase Size Limits via php.ini or .htaccess

If you‘re comfortable digging into server config files, then another option is to increase the max upload size in either the php.ini or .htaccess file:

php.ini Method

To adjust the upload size limit in php.ini:

  1. Open the php.ini file in a text editor. It is usually located in /etc/php.ini or /etc/php/7.x/php.ini on Linux servers.

  2. Modify the following parameters:

upload_max_filesize = 64M
post_max_size = 64M 
max_execution_time = 300
max_input_time = 300
  1. Save changes and restart your web server for settings to take effect.

.htaccess Method

If don‘t have access to the php.ini file, you can use .htaccess instead:

  1. Open the .htaccess file located in wp-admin folder on your server.

  2. Add the following code:

php_value upload_max_filesize 64M  
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
  1. Save changes and reload/refresh WordPress.

The .htaccess method works great on most hosts but sometimes not so much on Nginx servers. Stick with php.ini method for Nginx sites if possible.

Method 3: Manually Upload Large Files via FTP

If you are unable to change the php server config at all, a workaround is to manually upload the large files via FTP.

This allows you to bypass the size restrictions when uploading directly in the WordPress admin dashboard.

Here is how to manually upload files over FTP:

  1. Connect and login to your web server using an FTP client like FileZilla.

  2. Navigate to the proper wp-content folder such as /wp-content/plugins/ for plugins or /wp-content/themes/ for themes.

  3. Upload the large ZIP or file into the right folder.

  4. Refresh your WordPress admin to confirm the file now shows up properly.

While more time consuming, uploading directly via FTP often resolves upload issues for extra large files. Definitely an easy fix!

Optimizing Upload Limits on Shared Hosting Plans

If your WordPress site is on a standard shared hosting server, you may need to request your web host to increase the max upload file size limit for your account.

The challenge with shared hosts is they have limited server resources and accommodate hundreds or thousands of accounts. So they set very conservative php defaults to ensure stability.

However, most shared hosts will gladly increase the upload_max_filesize and other php limits upon request. Especially if you‘re on a paid plan.

I recommend opening a support ticket and asking your host to raise the values above 64MB as needed. Provide them with the exact parameters and sizes to change.

The other option is to upgrade to a VPS or dedicated server which gives you full control to configure php and server settings as you see fit.

Shared hosting vs other types of hosting server resources

Troubleshooting Tips for 413 Errors

Here are some steps to troubleshoot 413 errors:

  • After increasing upload limits, clear your browser cookies and cache to avoid old size restrictions.

  • Try uploading from both the media library and the plugin/theme installation tabs.

  • Confirm your new php settings were saved and applied correctly on the right config file for your server.

  • If manual FTP upload works, then double check server config steps. New limits may not be applied properly.

  • Always test new file uploads and size limits on a staging site first before touching your live site. Safety first!

  • Still getting 413 errors? Contact your host to confirm the php updates were applied on the backend for your account.

  • For large uploads, I recommend using a dedicated hosting plan or virtual private server (VPS) which provides more resources and flexibility.

Conclusion

Fixing the pesky ‘413 request entity too large‘ error ultimately comes down to increasing your WordPress upload size limits. The easiest way is bumping up the php limits directly in wp-config.php.

You can also use php.ini or .htaccess if available. And when all else fails, manual FTP upload bypasses the restrictions so you can upload those large files.

Phew, that was a lot of info! I hope this guide helps you finally squash the 413 upload errors so you can use large media, themes, plugins, and other files on your WordPress site.

Let me know if you have any other questions!

Sincerely,

[Your Name] WordPress Expert

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.