What is WordPress Error 413 Request Entity too Large & How to Fix It?

If you are an experienced WordPress user, you have probably seen a few error messages that took you a while to fix. The error we are going to talk about is a pretty common one and we also have some quick fixes to show you. When users are trying to upload a plugin, theme, or basically any media, they can run into the 413 “Request Entity too Large” message which simply won’t let them proceed.

This is Why You Get the 413 Request Entity Too Large Error

You can upload any type of file to WordPress as long as it doesn’t exceed the maximum file size limit. This can be considered as a default limit configured by your WordPress hosting provider. It lets you upload relatively large content but you can never know where the upper limit is. If your upload fails and the 413 “Request Entity too Large” error comes up, it means that your file is too big.

The main issue here is that if you find a useful plugin or a cool theme, sometimes you just can’t apply it because of its size. In your Media Library, you can run into the same issue but it will display a different error message: filename.zip exceeds the maximum upload size for this site. This could happen whenever you want to upload a video or hi-res image.

Most people run into this error message when they want to upload a large image. To see the precise upload limit, click on the Media button and the Add New option. There, you can see below a text saying: Maximum upload file size: ‘value’ (usually 2 MB).

How to Fix the 413 Request Entity Too Large Error?

There are 3 different ways to fix this error. The first two methods are based on a few simple line of code while for the third one, you need to use FTP. We are going to cover all of them so you can decide which one is the simplest.

  1. Set a Higher Upload File Size Limit in Your Functions File

The functions.php file is basically a theme that has a similar structure as a plugin. You can open this file on your front-end and admin pages and it contains functions that define the filters, classes and actions your templates use within the WordPress theme.

If there is no functions.php file available, just create a text file, name it functions.php and copy it into the directory of the theme. To increase the file size limit, copy the code below into the functions.php file of your WordPress theme:

@ini_set( ‘upload_max_size’ , ‘128M’ );

@ini_set(‘post_max_size’ , ‘128M’);

@ini_set(‘max_execution_time’ , ‘500’)

This can be done with a site-specific plugin as well which lets you add lines of code to your WordPress site for customization, without depending on your current theme.

The 128M you see in the post_max_size and upload_max_size is the exact size limit for the files you can upload. This value is really arbitrary, you can set it to any number you want as long as it’s bigger than the file you want to add. The max_execution_time is what determines how long it will wait for the upload to finish before it stops the process. You can also increase this value just to make sure the file has enough time to transfer to the server.

But be aware that this method doesn’t always work, there are some WordPress sites where it won’t do anything. In that case, try the next method based on the .htaccess file.

  1. Set a Higher Upload File Size Limit in the .htaccess File

The .htaccess file is another place where you can configure the server of your website. The lines of code you write there are strict rules that the server has to follow.

If you want to fix the error this way, open your .htaccess file in the root folder of your WordPress site and copy the code below in the following fashion:

php_value upload_max_filesize 128M

php_value post_max_size 128M

php_value max_execution_time 500

php_value max_input_time 500

With these commands, the .htaccess file communicates with the server to set the upload size and the execution time to the given values. Before you change anything in your .htaccess file, it’s a good idea to create a backup. If you mess up the code even a little bit, your whole website can crash.

Keep in mind that for websites that run on a shared web hosting plan, this method definitely won’t work. In this case, contacting your web hosting provider through their customer support is the best option. Then, they will simply open the .htaccess file themselves and change the limit.

  1. Upload and Install Anything with FTP

You might run into the 413 “Request Entity too Large” error when uploading a single file. In this case, probably the simplest solution is to upload the file manually through FTP. For those who are not familiar with FTP, it is the abbreviation of the term File Transfer Protocol. If you want to transfer files from one PC to another on the Web, you can use this internet protocol.

This is useful when you want to install WordPress to your website. You need an FTP first to be able to transfer the files of the CMS from your PC to the server. The interface that simplifies these tasks is the FTP client, a software that you need to install on your computer. Once it’s up and running, the file exchange between your PC and server can begin. Popular FTP software that are also user-friendly are WS_FTP and Filezilla.

If you know how to use FTP, you can solve a lot of problems. When you install new plugins or change something in the functions.php file, it can sometimes lead to a server crash. This can happen either because the plugin is not compatible or someone messed up the code. In these occasions, you can reach the server via the FTP client and get rid of the files that caused the malfunction.

Upload Your WordPress Files Manually with FTP

Uploading files to your WordPress website using an FTP client is actually a straightforward task. You just need to download and install the client on your PC and it will establish a connection between the website and your machine.

We will explain how the file transfer works with Filezilla and once you understand the process, it will be easy to use the other software as well. You can download and install Filezilla for free and it works on Linux, Mac and Windows as well.

First off, you can only start the FTP client by typing in your FTP credentials. This is necessary if you want to connect to your site and get access to the files. When you subscribe to a web hosting plan, the provider usually sends these credentials in an email or simply includes it in the cPanel admin interface.

If you have your username and password, launch Filezilla and click ’File’ then ’Site Manager’. A window will appear and there you can go ’New Site’. Under ’My Sites’, a new name will appear on the list called ‘My Website’ and there you can change the name. On the right, there are fields where you can add information about your site.

In the ‘Host’ field, type in your domain name, then select ‘Logon Type: Normal’ in the drop-down and you are ready to connect. If the information is correct, Filezilla will establish the connection and save everything for the next login so that you don’t need to type in again.

Every time when Filezilla notices that you want to connect from a new computer, an ‘Unknown certificate’ window will pop up. To keep up the connection and make the software trust the certificate, click the ‘Always trust certificate for future sessions’ checkbox and continue. After that, you will be able to see all the files that are on your website. The ‘Local site’ is your computer, while under the ‘Remote site’ are your website files.

To upload files to your website, just right-click on the file you want and click ‘Upload’.

Install Any WordPress Plugin via FTP

As we mentioned before, the 413 “Request Entity too Large” error can appear in cases when the plugin you are trying to add is too big and exceeds the limitations of your website. Luckily, there is a way to install WordPress plugins manually. As you can upload any file to your website by using an FTP client, this also means that you can upload the files of your plugin as well.

Start by downloading the source file of the plugin you want to use on your site. This is always a .zip file that needs to be extracted on your computer before you can do anything else. Once it’s done, a folder will appear with the same name and that’s what you need to upload via the FTP client.

Keep in mind that WordPress has a strict structure of files. More times than not, you need to know exactly where to upload a particular file on your website. In our example, a new plugin always needs to be uploaded to the /wp-content/plugins/ folder of every WordPress site, otherwise it won’t work.

So, here is what you need to do if you want to manually install a plugin to your WordPress site. Start up your FTP client and log in with your username and password. When the connection with your website is established, find the /wp-content/plugins/ folder on the ‘Remote site’. This is where you need to add the plugin from your computer – the one that you previously extracted.

The upload is done, but the plugin is not working yet. Login into the WordPress admin area of your website and go to ‘Plugins’. You can find the name of the new plugin there and it can be activated at any time.

Install Your WordPress Themes via FTP

Installing new WordPress themes is another way to run into the 413 “Request Entity too Large” error. If the theme is larger than usual, it can also exceed the upload limitations of your server. Fortunately, WordPress themes can also be uploaded manually. It can be done with the exact same method as when you install a plugin or upload any media through an FTP client.

The only difference will be the file path where you need to copy the theme. After you launched your FTP client, connect to your WordPress website by typing in your username and password. Once the file manager is up and running, find the /wp-content/themes/ path on the ‘Remote site’ side of the interface.

As themes are also available in .zip files, you need to extract them to your PC first. Then, find the extracted file in the client, then right-click and ‘Upload’ it to the /wp-content/themes/ directory. The next step is to log in into the WordPress admin panel of your site and make sure you can find the new theme in the ‘Appearance’ > ‘Themes’ menu. If done correctly, the theme will be listed there and you can also activate it with a single click.

These are the main methods that you can use to play around the 413 “Request Entity too Large” error message. Sometimes the first two methods can solve the problem right away, but if you are more experienced with using FTP on your websites, then it will take only a few minutes to upload new files of any size to your website.

avatar

David Cross

David is the chief editor at WebHostingMedia right from the beginning. He has a great passion for building and managing websites and creating helpful content. He is also interested in programming - currently learning python.