Guide for fixing the 413 Request Entity too Large Error

Guide for fixing the 413 Request Entity too Large Error

The 413 request entity too large error is pretty common and you probably have seen it. It comes up mostly when you are trying to upload a plugin or theme file in WordPress. The error popups when you are uploading a file that is larger than the set limit. The web server will fail to load the file and the 413 request entity too large error will load up. Even where the servers have been configured to allow the upload of large image files, the setting is often not adequate to upload larger plugins or themes. What happens if you really need the theme or plugin but the error page keeps loading up? This post takes a look at the fixes you should consider using.

  • Increase the upload file size limit through the functions file

This is one of the best methods you can use to resolve this problem. You do this by adding simple lines of code to your theme. You can add the functions.php file or the site-specific plugin code.
@ini_set( ‘upload_max_size’ , ‘64M’);
@ini_set( ‘post_max_size’ , ‘64M’);
@ini-set( ‘max_execution_time’ , ‘300’);

You can change the values in the upload_max_size and in the post_max_size to fit the file size that you want to upload. The max_execution_time should also be increased to the time you feel it will take to upload the target file. If you don’t know exactly how much time it might take, consider doubling the values.

  • Increase upload file size limite through .htaccess File

This is a method that relies on making changes to the .htaccess file. You should add these codes:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

The values above are not fixed. You can increase them to suit your upload needs. There are several guides you can find online on how to increase the values in WordPress.

  • Upload manually using FTP

If the 413 Request Entity too Large Error is only showing for a single file that you wish to upload, it makes no sense to change the settings of your account. You can go ahead and upload the file manually. You do this via FTP. You can use this method to upload a plugin or theme. There are many guides you can use for this.

The three are the main methods you should consider using when uploading files that trigger the 413 Request Entity too Large Error. Your method of choice will depend mostly on how many files you will be uploading. You should also make sure that you are doing it the right way.

413 request entity too large error