How To Fix "413 Request Entity Too Large" Error in WordPress 1

How To Fix “413 Request Entity Too Large” Error in WordPress

WordPress is the most popular content management system (CMS) in the world, and rightfully so. It is powerful and versatile, suitable for people with or without a coding background. However, as any website owner can tell you, the path to site creation and maintenance is rarely unobstructed. WordPress errors are among these obstacles. More common errors are usually mapped to numbers and/or error log names. Such an error 413 Demand Too Big error. This is a pretty common mistake for websites using shared hosting.

The 413 Request Entity Too Large error occurs when you try to upload a file or folder that is larger than the maximum upload limit. It usually happens when installing a plugin or theme folder using your dashboard’s upload options. Fortunately, this error has a fairly easy solution that you can approach using one of the methods listed below:

How to resolve 413 Request Entity Too Large error

To resolve this error, simply increase the server resources whose limits are causing the error. These are the file upload size and the maximum time allowed to execute PHP scripts.

We will show you various ways to increase server resources. You can choose the method that best suits your needs or try one by one. If the problem is not resolved after following one of the methods, you should consider increasing the values ​​further. But make sure you do this within the limits of your hosting package! If additional resources are needed beyond the limits, we recommend that you contact your hosting provider regarding the increase. Finally, the problem can also be resolved by manually uploading the large file or folder via FTP.. We discuss this method towards the end of the article.

Using the PHP INI Editor in cPanel

Hosting providers will offer their customers access to a control panel like cPanel. Therefore, the easiest way to solve this error is to change the settings related to the php.ini file in cPanel. To change your php.ini settings, Go to MultiPHP INI Editor It is located in the Software section in cPanel.

MultiPHP INI Editor

In the following window you will be able to change the basic php.ini settings. Make sure you are in the Basic Mode tab, select your domain, and then set the values ​​for the settings below.:

max_execution_time = 300
upload_max_filesize = 128M
post_max_size = 256M

After doing this, press apply button under.

PHP INI Editor

You will then receive a message stating Settings applied successfully in the upper right corner of the screen.

Editing your Functions.php file

Other ways to fix the error require you to edit certain files. This process is only slightly more difficult than the one we mentioned earlier. You can also edit these files in the File Manager section of cPanel or via FTP using an FTP client. We’ve included examples for both types of editing, depending on the file. However, to avoid making the article unnecessarily long, we left out duplicate instructions for each file mentioned.

However, let’s examine how to arrange it. functions.php file which is one of the files that can be edited to increase server resources. In the Files section of cPanel Click on File Manager.

File Manager

After that, find your domain and locate your root WordPress directory, usually called public_html from the left side navigation. At that time, Go to /wp-content/themes and open the directory of the theme you are currently using. Find the functions.php file inside, right clickand select the edit option in the drop-down menu.

Editing Functions

Confirm that you want to edit the file. pressing the edit button in the pop-up window that appears.

Editing Functions Button

The file will open with a cPanel-specific text editor. Enter the code below Below your function.php file:

@ini_set( ‘upload_max_size’ , ’128M’ );
@ini_set( ‘post_max_size’, ’256M’);
@ini_set( ‘max_execution_time’, ‘300’ );
Editing Functions Code

back then press the save changes button in the upper right corner of the screen.

Editing your .htaccess file

Another file you can edit to increase your server resources is the .htaccess file. Because .htaccess is a server configuration file for Apache servers, it can help enable or disable a number of other server functions. You can access it using FTP. However, since it is usually hidden, you need to enable the appropriate options to show hidden files in the FTP client of your choice for viewing.

After that connecting to your server Using your FTP credentials, go to the root WordPress directory of your siteIt is named public_html. Find the .htaccess file inside, right click and Select View/Edit.

Editing the htaccess File

Open the file using a text editor of your choice. Enter the code shown below at the end of the file, # END after WordPress line of code.

php_value upload_max_filesize 128M
php_value post_max_size 256M
php_value max_execution_time 300
php_value max_input_time 300
Editing htaccess File Code

After that, save the changes and restore the edited file to your server to override the existing one.

Editing your wp-config.php file

The wp-config.php file is another file that can be used to increase server resources. The process is very similar to editing the .htaccess file.

connect to your server using your FTP credentials and go to root WordPress directory. Find the wp-config.php file inside, right clickand Select View/Edit. You can edit the file using any text editor you want.

Editing WP Configuration

Enter the code /* shown below That’s it, stop editing! Happy releases. */ line of code.

@ini_set( ‘upload_max_size’ , ’128MB’ );
@ini_set( ‘post_max_size’, ’256M’ );
@ini_set( ‘memory_limit’, ’300MB’ );
Editing WP Configuration Code

At that time, save changes and restore the file to your server to overwrite the old wp-config.php file on your server.

Manually uploading a file or folder via FTP

Since error 413 occurs when uploading a very large file or folder to your control panel, an additional way to fix the problem is to upload the troublesome file via FTP. We’ll show you the steps using a plugin folder as an example. You can install it manually. connecting to your server your FTP credentials and go to your root WordPress directory named public_html. After that, Find and enter your /wp-content/plugins directory. Then, in the left part of the FTP client, find the uncompressed plugin folder on your computer. right click and Choose the Upload option in the drop-down menu.

Manually Installing the Plugin Folder

Uploading a theme via FTP is very similar. Start from your root WordPress directory using the navigation on the right side of the FTP client and Go to /wp-content/themes. Then, in the FTP client navigation on the left, find the uncompressed theme folder. right click and Choose the Upload option.

Manually Upload Theme Folder

Either way, you may need some patience for the installation to complete.. Depending on the size of the plugin or theme folder, this may take some time. However, your patience will be rewarded once the folder is uploaded as this will resolve the error you are experiencing.

final thoughts

WordPress errors can sometimes seem confusing and difficult to resolve, but most are easily fixed. this 413 Demand Too Big error is no exception. By carefully following any of the methods we discussed above, we’re pretty sure you can fix the error pretty quickly. Also, increasing server resources can be beneficial for your site in the long run. It can fix (or prevent) the appearance of other common WordPress errors, such as image upload errors. And increased server resources can help your website run smoothly overall.

Support our work ❤️

If you enjoyed this article, consider leaving a tip to help us keep publishing great content.

Secure payment on PayPal
Moyens I/O Staff is a team of expert writers passionate about technology, innovation, and digital trends. With strong expertise in AI, mobile apps, gaming, and digital culture, we produce accurate, verified, and valuable content. Our mission: to provide reliable and clear information to help you navigate the ever-evolving digital world. Discover what our readers say on Trustpilot.