Fix 413 Request Entity Too Large Error In WordPress: Best Methods

Fix 413 Request Entity Too Large Error In WordPress: Best Methods

WordPress has around sixteen years of experience and empowered numerous people to start their own sites and business online. However, it is a pretty impressive and open source platform. But, with so many peoples and websites, the things cannot always go so fluently and the users start facing the issues in between. Indeed, there are a lot of WordPress Common Errors in which “413 request entity too large error” is one of them. Hence, with its huge user base and a supportive community, we provide various solutions for the same. But first, get a bit overview on error 413 request entity too large.

What 413 request entity too large error is?

When your web server sets a particular HTTP request size limit, it shows that the client came across a 413 request entity too large response. It occurs when the request made from the client is too large and can’t be processed by the web server. An example request, which could cause this error if a client is trying to upload a large file to the server (such as a large media file).

It certainly depends on the type of web server you are currently working on, which determines the instructions you need to configure. Whether you want to prevent users from uploading too large files to your web server or increasing the upload size limit, the following section will explain how.

Main causes of WordPress 413 request entity too large error

This error normally occurs while you are trying to upload a file that exceeds the maximum file upload limit on your WordPress site. That’s why, a web server will fail to upload the file, and 413 request entity too large error page will display on the screen.

413 request entity too large errorGenerally, most WordPress hosting companies have configured their servers but WordPress users can easily upload the large images and other media. But, sometimes this setting is not sufficiently high to upload large themes or plugins files.

Also, stop uploading large files in the media library. In that condition, you will see a different message, the file size exceeds the maximum granted limit.

file size limit

Now, let’s have a look at how to fix the WordPress 413 request entity too large error.

Fix “413 request entity too large error” in WordPress

413 request entity too large error

There are various ways to fix the request entity too large error in WordPress, a list of all the methods is shown below. Let’s have a look at them:

Method 1: Increase Upload File Size Limit Using Functions File

To do this, you just have to do is to add the following code to your theme’s function.php files or a site-specific plugin.

@ini_set( ‘upload_max_size’ , ’64M’ );
@ini_set( ‘post_max_size’, ’64M’);
@ini_set( ‘max_execution_time’, ‘300’ );

However, you can exceed the value to be more than the file you are trying to uploads in upload_max_size_ and post_max_size.

You will also have to extend the max_execution_time to the time that you seems it would take for the file to upload. Additionally, you can try to double this value if you are unsure.

Method 2. Increase Upload File Size Limit via.htacces File

In case, if the above method is not working properly, then you can easily remove the error via this method.

Further, to fix 413 Request Entity Too Large Error – All you have to do is to edit the .htaccess file entirely. And add the following code shown below:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

Method 3: Manually Upload File Size Limit using WordPress file

For this, you will need to edit the WordPress file. Thereafter add the below code in wp-config.php or themes function.php file.

@ini_set( ‘upload_max_size’ , ’64MB’ );
@ini_set( ‘post_max_size’,64 MB);
@ini_set( ‘memory_limit’, ’300MB

Now, you have successfully fixed the error using a WordPress file.

Method 4: Increase Upload File Size Limit via php.ini file

For increasing Upload File Size Limit via php.ini file – All you have to do is to edit the entire PHP.ini file and add the following code that’s shown below:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

Method 5. Manually Upload File via FTP

As we have discussed above, 413 Request entity error occurs while you are uploading a single specific file, so you would like to consider uploading the file manually via FTP.

If you have any problem uploading the theme, then read our article on how to install a WordPress theme.

Continuously, if you face any difficulty to upload the plugin, you can also see our article on how to install a plugin in WordPress.

FTP or File Transfer Protocol is a way to transfer or upload files from one local computer to another remote website like WordPress blog. For example, if you install software like WordPress, there are more chances you will use FTP in order to upload all of the WordPress files from your personal computer to your server. To do this task, you need a thing called an FTP client.

Method 6. Nginx

The client_max_body_size directive which determines the maximum allowable HTTP request size for Nginx error. Which is somewhere already defined in your nginx.conf file located at /etc/nginx/nginx.conf. Though in a rare case, if it isn’t present there, you can add that directive either in an http, server, or location block and define it a value.

# set client body size to 8M #
client_max_body_size 8M;

Though the default value for this directive is 1 megabyte. If you don’t require to have a request size limit you may even set the value to 0.

After the desired value has been set, save the changes and reload Nginx using the command: service nginx reload.

Method 7. Apache

Apache web servers use a similar directive called LimitRequestBody.This instruction provides the same functionality as inclient_max_body_size that you are able to restrict the size of the HTTP request. The LimitRequestBody command can be defined in your http.conf file or .htaccess file. The default value for this instruction in Apache is 0, however, you may prefer this value to whatever value you want (values are represented in bytes).

Let’s take an example:

If you want to restrict requests larger than 100mb, use –

LimitRequestBody 104857600

Once you have made your changes, save the configuration file and reload Apache using the following command:

service apache2 reload

That’s all on our behalf! We hope that you thoroughly went through this article and now must be able to resolve your WordPress Error.

If you need any help talk to our WordPress Support Experts as they will resolve all your issues with quick response. So instead of wasting your precious time dial our Toll-Free number +1-844-275-0975.

Read More Useful Blogs:

Leave a Reply

Call Now