How to fix the “413 Request Entity Too Large” Error?

If you’re encountering a “413 Request Entity Too Large” error, the silver lining is that resolving this issue is straightforward and swift.

It merely requires some server adjustments. Rest assured, you don’t need to be a tech guru.

Let’s delve into the process.

What does the “413 Request Entity Too Large” error mean?

The 413 Content Too Large or 413 Request Entity Too Large error is triggered when a client tries to send a file that’s too big for the server’s limit.

This is common when a client tries to upload a large file to a web server, and the server sends back a 413 error to let the client know that the file is too big.

To put it simply, the “413 HTTP error code” occurs when you’re trying to upload a file (like an image or video) that is too big.

Let’s put it in a scenario:

It’s like trying to fit a large sofa through a small door – it just won’t work! If you own the website, you can change the settings to accept larger files. If not, you might need to make your file smaller.

Root Causes of “413 Request Entity Too Large” error

Here are some situations where you might see this error:

  • Big File Uploads:

When you’re trying to upload big files like photos, videos, or audio files.

  • Large Form Submissions:

If you’re submitting a form with large file attachments, you might encounter this error.

  • Hefty API Requests:

When you’re making requests to an API with a lot of data

  • Content Management Systems:

If you’re using content management systems like WordPress that have set size limits, you might see this error.

  • Server Settings:

The server might be set up to reject uploads that are too big.

For example, Nginx usually limits client requests to 1 MB.

Browser Cache:

Occasionally, the error can be caused by data cached in your browser.

Remember, you can only fix this error if you’re the owner of the website where the error occurred.

If it happened on a website or app you’re using, you might need to make your file smaller or contact their support team.

How to fix the “413 Content Too Large” Error?

How to fix the 413 Request Entity Too Large Error

Let’s discuss various methods to rectify the HTTP error 413. Initially, we’ll explore some strategies that are independent of the device, server, and hosting.

Following that, we’ll guide you on how to address a 413 error specifically on your WordPress site, as well as on Nginx and Apache servers.

Check File Permissions:

Make sure the file permissions on your server are set correctly. If they’re not, changing them might solve the problem.

Use FTP for Uploading:

If the file is too big to upload via the website, try uploading it directly using FTP.

Reach Out to Your Hosting Provider:

If you’re unsure about how to do the above or if they don’t work, your hosting provider can help.

Clear Your Browser’s Cache and Cookies:

Sometimes, this error can be fixed by simply clearing your browser’s cache and cookies.

If the error is caused by corrupted or expired cookies or cache, clearing them could help.

When you clear them, you get new info from the website’s server.

If you use Google Chrome, here’s how to clear its cache:

  1. Click the three dots in the top-right corner of your window. You can also use the keyboard shortcut (Ctrl + H).
  2. Go to History History.
  3. Click on Clear Browsing Data.
Clear browsing data
  1. A new window will appear. Choose the Time range, if you wish to erase all data, select All Time.
Choose the Time range
  1. Select what you’d like to clear- this could be browsing history, cookies, and other site data, or cached images and files.
  2. Then, hit the Clear Data button.

Increase the Server’s File Size Limit:

If you have access to the server settings, you can increase the maximum file size that the server will accept.

How to Fix 413 Content Too Large an Error in WordPress?

To address the 413 Content Too Large Error in WordPress, there are several strategies to tackle this issue in WordPress:

  • Enhancing Upload File Size Limit Using WPCode: 

The WPCode plugin can be utilized to augment the upload file size limit, eliminating the need to directly alter the functions.php file.

  • Amplifying Upload File Size Limit via .htaccess File: 

The upload file size limit can also be amplified by adjusting the .htaccess file.

  • Uploading File Manually via FTP:

 If the file exceeds the size limit for uploading through WordPress, it can be manually uploaded using an FTP client.

  • Modify the functions.php File

Another method to consider is enhancing your size limit through the functions.php file of your active WordPress theme.

If you’re aiming for a long-term solution, it’s advisable to attempt the previously mentioned strategies first.

With this method, you’ll be required to modify the functions.php each time you update or switch your current theme.

How to Fix 413 Request Entity Too Large Error in Nginx?

The “413 – Request Entity Too Large” error signifies that the web server is set to limit large file sizes.

To rectify this, you need to modify your nginx.conf and augment the value of the client_max_body_size directive.

For instance, if you require 100MB then: 

client_max_body_size 100M;

How to Fix 413 Content Too Large Error in Apache?

To tackle the 413 error in Apache, data can be compressed prior to transmission.

If you’re utilizing Apache, mod_deflate can be enabled in your .htaccess file or Apache configuration file to automatically compress outgoing data.

An alternative solution is to augment the value of the LimitRequestBody directive in your Apache configuration file.

To alter the size limit on an Apache server by modifying your .htaccess file as follows:

  1. Navigate to File Manager under Files in your cPanel menu.
  2. Find .htaccess in your root WordPress directory (typically public_html). Note that the .htaccess file might be hidden based on your settings.
  3. Choose .htaccess and hit the Edit icon.
  4. Append the following code at the end of your .htaccess file:

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. Press Save and restart Apache.

By doing so, you’re setting the maximum permissible size of your WordPress uploads and posts to 64 megabytes and establishing the maximum file upload duration to 300 seconds. Feel free to adjust these values as per your needs.

Conclusion

In conclusion, the “413 Request Entity Too Large” error arises when a client attempts to send a file that exceeds the server’s size limit.

This error can occur in various situations such as uploading large files, submitting forms with large attachments, making hefty API requests, using content management systems like WordPress with set size limits, or due to server settings that reject large uploads. Occasionally, it can also be caused by data cached in your browser.

The good news is that you don’t need to be a tech expert to fix this error. There are several methods to rectify it.

Always remember to back up your data before making any changes to your server configuration.

By following the provided solutions above, you can rest assured that you’ll be able to resolve this issue.

For further learning, you can also check the following HTTP status code:

Leave a Comment