How to fix the 413 Request Entity Too Large error in WordPress

If you encounter the 413 Request Entity Too Large error in WordPress, the most likely cause is that you’re trying to upload a file larger than the maximum file upload limit on your site. The most common occurrence of the error is during plugin or theme uploads.

To resolve the issue, you can increase your site’s maximum upload file size. There are several methods available to achieve this – let’s take a look at each.

Increase your maximum upload file size using the HostPapa Dashboard

The recommended way to increase your site’s maximum upload file size is via the HostPapa cPanel dashboard.

  1. Log in to your HostPapa account.
  2. Navigate to Software > Select PHP Version.

My cPanel

3. Click Switch to PHP Options.

Switch to PHP Options

4. Click the following items in the list to amend their values:

  • upload_max_size
  • post_max_size
  • max_execution_time

PHP Options

5. Save the amended settings, then try to upload your file once more. 

6. If the error reoccurs, increase the values in PHP Options.

Increase your maximum upload file size using functions.php

Alternatively, a simple tweak to your theme’s functions.php file can be all that’s required to change the file size limit. 

  1. Using an FTP client or cPanel File Manager, navigate to your WordPress theme folder (app/themes).
  2. Open functions.php for editing.

cPanel File Manager

3. Add the following code (you can amend the values for each line as required):

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

functions.php

4. Save the file, then try to upload your file once more. 

5. If the error reoccurs, increase the values in the functions.php file.

If you need help with your HostPapa account, please open a support ticket from your dashboard.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache