How To Fix 413 Request Entity Too Large Error For WordPress Site?

How To Fix 413 Request Entity Too Large Error For WordPress Site?

userPosted by Richard

There is a certain limit on the size of files to upload for a WordPress website. When this limit exceeds from its actual parameter, the application throws a 413 Request Entity Too Large error despite adding the file to the server. Thus, it is very crucial to keep this restrictive guideline in mind during file upload. Make sure the theme or plugin file you are attempting to upload is not bigger than the actual size. Otherwise, your web server will not let your file be uploaded. However, if this really happens, just try to reconfigure your server to get it fixed quickly and efficiently. The blog post will explain to you how!

 

What Does The “413 Request Entity Too Large” Error Mean?

In general, a Web Server sets a definite HTTP request size limit to prevent users from crashing the site. Exceeding storage permissions and uploading a large file to a server could lead to a 413 Request Entity Too Large WordPress error issue.

Let’s break the error into its relevant pieces to understand What Does “413 Request Entity Too Large” Error Mean. Have a glimpse once:

  • “413”:This is one of the HTTP 4xx error codes, which specifically denotes there’s a problem between the web server and browser.
  • “Request Entity”:The “entity” in this case is the information load being requested by the client from a web server.
  • “Too Large”:This simply means the entity is bigger than the server site which is willing or able to serve.

 

Prerequisites To Resolve 413 Request Entity Too Large

Here’s what actually you’ll need to have for 413 Request Entity Too Large Fix:

  • Administrator access to your web server of a WordPress website.
  • A suitable SFTP client.
  • The know-how to use SFTP — proactive guide to the basics available on WordPress.org.
  • A text editor, though there’s no requirement of anything too complex.
  • A clean and current backup in case the worst condition happens.

 

Two Pre-Fixes To Implement For 413 Request Entity Too Large

There are a couple of effective steps you need to take to help resolve the 413 Request Entity Too Large error. They are noted beneath and would probably give you a workaround to this particular error. Let’s have a brief glance:

 

Fixes 1: Upload A Large File To A Server Through SFTP

Although the issue is related to the file sizes, it’s a good idea to evade the front end interface. Afterward, try an effort to upload a large file to the server yourself. You can do it in an optimum way by using the SFTP protocol. Let’s do it now!

  • First, log in to your WordPress website through SFTP. Make sure you enter the correct login credentials.
  • Once you are logged in, locate the “wp-content” folder.
  • There, you will see the “Uploads” folder.
  • Afterward, upload your file to this folder on the server and see the result.
  • If the file is uploaded successfully, we recommend you send an email to the site’s developer. They have the efficiency to investigate the issue further on the frontend.
  • If required, remove and re-create your SFTP user.

 

Fixes 2: Check For Server Permissions Errors

Of course, on a serious note, permissions errors won’t enable server requests to run. Thus, it is extensively required to check whether the user has sufficient permissions to upload theme or plugin files of any size. Once this is sorted, the particular Error 413 Code disappears.

 

Advanced Solutions To Fix 413 Request Entity Too Large

Adjusting your file size or increasing the size limit will be the possible productive solution to get rid of a 413 Request Entity Too Large error. Depending on the web server you use for your WordPress website, you can modify the size limit accordingly. Let’s do it in a few clicks:

 

Solution 1: Modify PHP.ini

The comprehensive steps to adjust your server’s PHP.ini file to enhance the upload limit are mentioned underneath. Start following the given directives and hassle-freely change your limit through the cPanel interface as coding is not required:

  • First, in your cPanel menu, select the “MultiPHP INI Editor” tab under Software.
  • Then, in the window that appears, opt for your domain from the dropdown menu.
  • Now, change the values as per your preference:
  1. max_execution_time (maximum time to upload, in seconds)
  2. upload_max_filesize (maximum upload size, in megabytes)
  3. post_max_size (maximum post size, in megabytes)
  • Once done, click the “Apply” button to save the changes.

 

Solution 2: Modify the functions.php File

The functions.php file is often used to define ‘classes’ and ‘actions’ on your WordPress site. Moreover, it can add several additional features and functionalities such as enabling post thumbnails, post formats, and navigation menus. Let’s adjust the file limit by following the given steps:

  • First, access your Hostinger cPanel menu.
  • Now, go to the “File” section and select the “File Manager” option.
  • Now, you will see three folders under the public_html folder.
  • Simply, click the “wp-content” folder. Doing this, a list of files will appear on the right side.
  • Afterward, give a double-tap on the “Themes” folder to find the “functions.php” file.
  • Once you find it, select the “functions.php” file.
  • And then, give an instant click on the “Edit” icon.
  • Now, add the following code snippet at the end of the file:
  1. upload_max_size
  2. post_max_size
  3. max_execution_time
  • Finally, click the “Save” button to save the changes.

Now, try to upload a theme or plugin file to test if you still have an HTTP 413 Request Entity Too Large error or it is solved.

 

Solution 3: Modify .htaccess file

For an Apache server user, change the size limit by updating your .htaccess file to solve the 413 Request Entity Too Large WordPress error. Here’s how:

  • First, open your Hostinger cPanel menu.
  • Then, go to the “Files” section and select the “File Manager” tab.
  • Afterward, navigate to your “public_html” folder and locate the “.htaccess” file. Depending on your settings, the .htaccess file may be hidden.
  • Place double-click on the .htaccess file.
  • A pop-up window will instantly evolve where you can add the respective code.
  • To start adding the code, click the “Edit” icon.
  • Copy and paste the following code:

 

  1. php_value upload_max_filesize 256M
  2. php_value post_max_size 256M
  3. php_value max_execution_time 600
  4. php_value max_input_time 600

 

  • Click “Save” to save the changes.
  • Now, reload Apache server to check the 413 Request Entity Too Large error is been sorted out or not.

 

Solution 4: Modify Nginx Configuration

If really the web server is set to restrict large file sizes, chances is high to confront 413 Request Entity Too Large. Nginx has client_max_body_size to allow the maximum size of the client request body. Once you adjust the size limit, an error message will disappear. Thus, it is extremely required to reconfigure Nginx to extend the limit and upload files without any hindrance. To do so, perform the following steps:

  • First, open the “nginx.conf” file
  • Next, check for the directive “client_max_body_size”.
  • Thereafter, change the value (in megabytes) to your maximum file size preference.
  1.  # set client body size to 8M #
  2. client_max_body_size 8M;
  • If you do not see this directive in nginx.conf, you can add it to the end of a server, location, or http block.
  • Now, in the end, save and close the file.

Feel free to reload the Nginx web server using the following command:

  • # nginx -s reload

Now, proceed to check if Error 413 is completely gone.

 

Final Thought

Whenever you try to upload a file larger than allowed by your web server, you will face a 413 Request Entity Too Large error in WordPress. In this tutorial, we compiled the most feasible different methods considering the server you usually utilize so that you can effortlessly enlarge the size and upload the file. For a cost-efficient Professional WordPress Support solution, call us at the given helpline number. Get your error resolved in a bit of effort and minimal time in the comfort of your home.

Tagged with: