Whenever you upload a plugin, theme, or any media file, you may see the 413 request entity too large error. You may already have figured out the server doesn't accept your file because of its size.
Every web hosting company configures its server to a specific file upload limit, and when the server detects a bigger file, it displays the error page.
To maintain a healthy environment, setting up such a file upload limit is essential. No company wants its users to drain the server resources.
And as you know, most of the WordPress users have the shared web hosting, and one user can affect other's performance. The server puts some limitations, to avoid any bad situation.
In this tutorial, you're going to learn to fix the 413 request entity too large error using two methods. You can either use the functions.php of the .htaccess file.
Fix the Error Using functions.php
You can edit the file from your WordPress dashboard, but if you read any security, you may have disabled the file editing, which doesn't display the editor option.
So, it's always good to learn the cPanel method. The functions.php file resides in the WordPress theme you have activated on your site.
Let me show you the steps to find and edit it.
As usual, you need to login to your cPanel account and open the file manager. Depending on your web hosting, you can see the icon at a different place.
For your primary domain, you need to open the public_html directory, for which, you have to navigate to it from the left-hand sidebar.
Many companies offer an option while opening the file manager.
Search for the wp-content folder and open it.
As I have mentioned earlier, you have to open the Themes folder.
You can see the active or inactive WordPress theme of your website, you need to open the folder of your active theme.
Scroll down and find the functions.php file. Right-click to edit.
Note: Before you proceed further, let me remind you that you should have the backup of your website and its database.
One minor mistake can break the whole website.
A new tab opens up on the browser. You need to copy and paste the code.
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
Click on the Save Changes button from the top-right corner of the screen. If you wish, you can increase the upload_max_size from 64M to 128M.
But in most of the cases, 64M is more than enough. No plugin or theme can be bigger than 64MB.
Fix 413 Request Entity Too Large Error Using .htaccess
You may already know that .htaccess is one of the most important files of a WordPress site. It handles the redirects and solves many common errors.
Do you know how to edit the file?
Follow These Steps.
As you have already logged in, you need to open the public_html directory. For a primary domain, all the data is residing in the directory, but if you host multiple websites, you need to open the folder of the domain you want to edit.
Scroll down and look for the .htaccess file. Right-click to edit. If you use cPanel quite often, you may know it also consists of an Edit option in the main navigation menu.
A popup appears to provide an option to disable encoding. All you need is to click on the Edit button.
You can see a new tab in the browser to edit the .htaccess file. Copy and paste the code.
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
As usual, you need to save the file by clicking on the Save Changes button from the top-right corner.
You have successfully solved the 413 request entity too large error. If you wish you know, I should tell you that you can upload your file using FTP, also.
Depending on your cPanel skills, you can use any of the files I have mentioned above. If you use the Yoast SEO plugin, you can edit the .htaccess file from your wp-admin panel.
I hope you have understood the concept and quickly solve the problem.
Check out these top 3 WordPress hosting services: