Problem Fixed: The 413 Request Entity Too Large Error in WordPress

Are you running a WordPress website and get the “413 Request entity too large” error occasionally? Many of you may not know the reason, but this usually occurs when you are trying to upload a theme, plugin or a media file that exceeds the maximum file upload limit. The web server fails to upload the file, and that’s why you see the “413 request entity too large” error page.

Want to know how to fix this issue? Don’t worry!

In this article, we will explain the best ways to fix the “413 request entity too large” error for WordPress websites.

How to fix 413 request entity too large errors?

There are various methods to fix this error in WordPress. We will cover all these methods, and you can try the one that works best for you.

Method 1: Change the upload file size limit via functions.php file

WordPress website has a functions.php file located in the theme folder. You can access this file using FTP server or by getting login into your website dashboard. Once you are in the edit mode, simply add the following code to theme’s functions.php file.

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

The above-mentioned value can be changed depending on the file size you are trying to upload. You will also have to increase the max_execution_time to the value that may take to get the file uploaded. Or, just double this value if you are not sure.

Method 2. Increase the upload file size limit via .htacces file

This is another method that can be used to deal with “413 request entity too large” errors. It will work for most of you, but sometimes it causes another error. For this method, you will need to edit the .htaccess file and add the following code at the bottom.

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: Increase Upload File Size Limit via php.ini file

If the above methods don’t work out to solve your problems, then you should consider adding the following code to the php.ini file which is located in your WordPress root directory.

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

Method 4: Manually upload file size limit using WordPress file

If your hosting service provider doesn’t allow you to access php.ini file then you should add below code in wp-config.php, themes function.php file etc.

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

Method 5: Manually upload files via FTP

If all of the above steps don’t apply to your WordPress website, then you may want to consider uploading the file manually via FTP.

We hope this article has helped you to solve the “413 request entity too large” errors. For any related queries, you can always reach us through the comment section.

Consider for further reading “how to speed up WordPress website performance easily”.