Simple Guide for Fixing the WordPress 413 Request Entity Too Large Error
The 413 request entity too large error in WordPress occurs when you want to upload a plugin or theme file. The error occurs when the file being uploaded exceeds the maximum file size that is required for a WordPress upload. The server fails to upload the file and sends the request entity too large error. Seeing this error does not mean you will never be able to upload the file that you need. You just need to make a few changes to your server configurations.
WordPress hosting companies normally configure the server to make it easy for their clients to upload large images and other media easily. However, the configured setting is at times not enough to upload a much larger plugin or theme file. If this is the case, uploading larger files in your media library will also trigger an error but you will get a different message that states that the file size you are trying to upload exceeds the set maximum limit. The good news is that you can fix these errors. Below are the three methods you should consider using to fix the 413 request entity too large error in WordPress.
Increase the upload file size limit through the functions file
This is the simplest method you can use to fix the upload error. You just add a simple code to the functions.php file or the site-specific plugin. Here is the code you need to add:
@ini_set( ‘upload_max_size’ , ‘64M’ );
@ini_set( ‘post_max_size’ , ‘64M’ );
@ini_set( ‘max_execution_time’ , ‘300’ );
You can increase the values in the upload_max_size and in the post_max_size in order to upload a much larger file. You will also need to increase the max_execution_time to the time you file the file will take to upload. If you are not sure how much time it will take to upload the file, double the value.
Increase the upload file size limit through .htaccess File
This method requires that you edit the .htaccess file. You do this by adding the following lines of 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
Uploading the file manually via FTP
If you only need to upload one file that is triggering the 413 request entity too large error in WordPress, you can consider uploading it using FTP. There are several guides on how to install themes and plugins using FTP.
So long as you know what needs to be done, most of the WordPress errors will not hold you back. There is always someone online who has solved the problem you are having. Don’t keep it to yourself.