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.
- Log in to your HostPapa account.
- Navigate to Software > Select PHP Version.
3. Click Switch to PHP Options.
4. Click the following items in the list to amend their values:
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.
- Using an FTP client or cPanel File Manager, navigate to your WordPress theme folder (wp-content/themes).
- Open functions.php for editing.
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' );
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.