How to Fix the 413 Request Entity Too Large Error
The 413 Request Entity Too Large error is one that can cause you some grief. This is because it’s no clear enough about what the issue is. However, reading between the lines, the usual problem is that a user sends a HTTP request that’s too large for the server to cope with. Most times this is due to media file sizes, but you can fix it in a snap.
For this tutorial, we’re going to show you how to fix the 413 Request Entity Too Large error fast. Here’s what we’re going to cover:
- Carry out some server-side steps to see if the server itself has an issue.
- Edit the
functions.phpfile and other server configuration files to help you clear the error.
Throughout, we’ll give you a run down on the tools you’ll need to fix the issue. There’s a high possibility you already have them to hand.
1. Check Whether Your Server Lets You Circumvent the 413 Request Entity Too Large Error
Your job to fix the error is to raise the maximum file size limit for your server. However, it’s worth trying to circumvent the issue before you dig into your files. That way, you’ll understand if the problem lies with your configuration or your server itself. The best way to do this is through Secure File Transfer Protocol (SFTP).
Using SFTP is beyond the scope of this article, but we have a few articles on the process:
- How To Bulk Upload Files To WordPress Via FTP + Other Methods
- How to Use FileZilla: A Step-By-Step Guide
Your first task is to find the wp-content folder within your WordPress installation’s directory. We’re using the Cyberduck SFTP client in this example, but it will be similar in FileZilla, Transmit, and others. Here, you’ll find the uploads folder:
Depending how you set this directory up, you could see other folders that separate uploads by year. You’ll need to follow the convention for your server, but the goal is to upload your file through drag-and-drop. If you can upload the file, you might want to contact your host to see if they can shed some light on why you get the 413 Request Entity Too Large error.
You should also check your file permissions at this point too. While this won’t necessarily be the cause of the error, you’ll at least know your file structure is as it should be. We have an in-depth article on working with file permissions is this is an area you’re not familiar with.
2. Edit Your
The most straightforward way to fix the 413 Request Entity Too Large error is to add a code snippet to your
The good news is this is something we cover in a dedicated article on increasing your maximum file size in WordPress. In this article, we also cover how to alter your
.htaccess file to achieve the same result.
The difference is that your
functions.php file relates to WordPress, while
.htaccess is for an Apache-based server. The majority of the time, you won’t need to add snippets to both.
There’s a slight difference when it comes to Nginx servers. The relevant file you need here is nginx.conf. However, on the vast majority of servers, you won’t be able to access this file in the same way you do
.htaccess. There is some configuration you can do, as we show in our article on fixing broken permalinks, but Nginx servers often don’t provide the same ability to tinker as Apache servers.
Our advice is to contact your host if you have an Nginx server and you see the 413 Request Entity Too Large error. They will be able to diagnose the issue in the correct way, and make the necessary changes to your server, without further errors.
If you come across the 413 Request Entity Too Large error, you’ll likely wonder what it means. However, it can be simple to decipher – usually you’re uploading files that are too large – and fix. It shouldn’t take more than a few minutes in most cases to put things right and get your site back online.
For this post, we have looked at three ways to fix the 413 Request Entity Too Large error. You can try using SFTP to upload files to your server, and also check permissions. You’re also able to edit the
nginx.conf files to get back online. In lots of situations, you won’t need to touch your server’s core files – but it’s straightforward to do if you need to.
Have you come across the 413 Request Entity Too Large error, and if so, what fixed it for you? Let us know in the comments section below!