WordPress has around sixteen years of experience and has empowered numerous people to start their own sites and business online. WordPress which provides users to utilize this content management system (CMS), and where CMS is also an open source platform providing users free access to web development. However, it is a pretty impressive and open-source platform. But, with so many people and websites, 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 supportive community, we provide various solutions for the same. For web-development services click here. But first, get a bit overview of error 413 request entity too large.
What is the “413 request entity too large” error?
When your web server sets a particular HTTP request size limit, it shows that the client came across a 413 request entity as a too-large response. It occurs when the request made from the client is too large and can’t be processed by the webserver. 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.
So what is actually a web server and why there are many types of web servers?
- On the software side, a web server includes several parts that control how web users access hosted files. At a minimum, this is an HTTP server. An HTTP server is software that understands URLs (web addresses) and HTTP (the protocol your browser uses to view webpages). An HTTP server can be accessed through the domain names of the websites it stores, and it delivers the content of these hosted websites to the end user’s device.
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 a 413 request entity too large error page will display on the screen.
Generally, most WordPress hosting companies have configured their servers but WordPress users can easily upload large images and other media. But, sometimes this setting is not sufficiently high to upload large themes or plugins files. As one can install plugins to improve a site’s performance or help it rank better in search engines like Google. 413 Request entity too large error does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.
Also, stop uploading large files in the media library through the multi-file uploader. In that condition, you will see a different message, the file size exceeds the maximum granted 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
There are various ways to fix the 413 request entity too large error in WordPress, a list of all the methods is shown below. Let’s have a look at them:
- Increase Upload File Size Limit Using Functions File
- Increase Upload File Size Limit via.htacces File
- Manually Upload File Size Limit using WordPress file
- Increase Upload File Size Limit via php.ini file
- Manually Upload File via FTP
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 where the function.php file defines classes, actions, functions, and filters that are used by templates. Function.php file is automatically loaded in the admin bar and front-end pages of a WordPress site.
|@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 upload in upload_max_size_ and post_max_size.
You will also have to extend the max_execution_time to the time that it seems it would take for the file to upload. Additionally, you can try to double this value if you are unsure. As 413 request entity too large error relies on the extended time.
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 the 413 Request Entity Too Large Error – All you have to do is to edit the .htaccess file entirely. As the .htaccess file belongs to Apache server. Actually, this is the server configuration file that communicates with the server to respond to your WordPress Website.
Important – Precautions of Editing .htaccess file
When you are editing .htaccess. However, it’s important to exercise maximum caution since errors on the .htaccess file will cause your site to crash. Finding .htaccess can also be difficult; Here are two precautions to guide you while editing the .htaccess file:
- Show Hidden Files -:- While editing .htaccess in cPanel. You will need to check the “Show hidden files” setting to view and edit .htaccess. However, in some web hosting, you may require changing the permission settings to view the same .htaccess file.
- Backup .htaccess -:- Creating a backup copy of the .htaccess file while editing the same file is the most important precaution. However, this backup copy is used to restore back the website to its original status.
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, WordPress media file uploader allows you to upload multiple files at the same time, you may choose multiple images, audio files, and even video files to upload and WordPress Website will do the rest on its own. You will need to edit the WordPress file. Thereafter add the below code in the 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 the Upload File Size Limit via the php.ini file
For increasing the 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, the 413 Request Entity Too Large error occurs while you are uploading a single specific file, so you would like to consider uploading the file manually via FTP.
FTP or File Transfer Protocol is a way to transfer or upload files from one local computer to another remote website like a 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. Nginx pronounced like “engine-ex”, is an open-source web server that, since its initial success as a web server, is now also used as a reverse proxy, HTTP cache, and load balancer. 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 as a value. Nginx is built to offer low memory usage and high concurrency. Rather than creating new processes for each web request, Nginx uses an asynchronous, event-driven approach where requests are handled in a single thread.
# 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. WordPress Apache is a popular open-source, cross-platform web server that is, right now the most popular web server in existence. It is actively maintained by the Apache Software Foundation. A web server is a software that receives your request to access a web page. It runs only a couple of security checks on your HTTP request and takes you to the web page.
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 directive LimitRequestBody is used to limit the total size of the HTTP request body sent from the client. You can use this directive to specify the number of bytes from 0 (meaning unlimited) to 2147483647 (2GB) that are allowed in a request body.
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). 413 request entity too large error uses Apache web servers.
Let’s take an example:
If you want to restrict requests larger than 100MB, use –
Once you have made your changes, save the configuration file and reload Apache using the following command:
service apache2 reload
Here with the error 413 request entity is too large. As it depends on the type of web server you are currently working on, which determines the instructions you need to configure. These methods have been provided to prevent users from uploading too large files to your web server or increasing the upload size limit.
That’s all on our behalf! We hope that you thoroughly went through this article and now must be able to resolve your WordPress 413 request entity too large Error.
If you need any help talk to our WordPress Support Experts as they will resolve all your issues with a quick response. Our experts from WPGlobalSupport are well-trained professionals who will provide solutions to your problems with the best customer experience. So instead of wasting your precious time dial our Toll-Free number +1-855-945-3219.
Read More Useful Blogs: