Fix: WordPress 413 Request Entity Too Large

Bulletproof Backups for Your WordPress Website

Fortify your business continuity with foolproof WordPress backups. No data loss, no downtime — just secure, seamless operation.

Fixing errors in WordPress site is like hitting a digital roadblock. It can be frustrating and disruptive. But, you’re also left wondering why this is happening to you. 

The “413 Request Entity Too Large” error may appear when you’re trying to upload a large file, like a hefty image or a complex plugin. Your website simply can’t handle the upload size. But don’t worry; there’s a quick fix ahead. 

In this article we’ll go over a few different ways to increase your upload limits or a way to bypass it. We’ll also go over why this is happening and how to prevent it. 

TL;DR: The first step to troubleshooting the “wordpress 413 request entity too large” error is to modify some core files. But, before making changes, use BlogVault to backup your WordPress site. This ensures you can restore your site if anything goes wrong.

What is the “413 request entity too large” error?

The “WordPress 413 request entity too large” error is an HTTP status code error. This means “Payload Too Large.” But what is a payload? A payload is any data you send to the server, like a file you want to upload. When you try to upload something big, like a video or a large image, this error might pop up. This happens because your file—your payload—is bigger than what the server settings allow. 

Web hosts usually set file upload limits to manage resources and ensure the server runs smoothly. These limits are in place to protect the server from being overwhelmed by very large files. Too-big files can cause server overloads, slow performance, or even crashes. 

Side note: If your website is slow, use a plugin like Airlift to optimize performance in minutes

The default file size limit can vary, but it’s often set around 2MB to 8MB by many hosts. For Cloudways, for example, the upload limit is typically set to 10MB. This means you can upload files up to this size without any issues. If you need to upload larger files, you can change the server settings to increase this limit. 

How to fix the “413 request entity too large” error?

Now we know that this error happens due to server upload limits. But if you need to upload larger files, you can adjust the server settings. In the next section, we’ll guide you on how to make these changes safely.

Manually upload the file via FTP

If you hit the upload limit error but don’t want to change server settings, there’s another option. You can bypass the limit by uploading your file directly to the wp-content folder. This method doesn’t rely on the standard WordPress upload limits.

How to do it?

  1. Install an FTP client like Cyberduck
  2. Connect to the server using your Ftp username, password, IP address and port number
  1. In the public_html folder, go to wp-content/uploads. This is where all media files are stored.
  1. Right click, click Upload and choose the right file

The upload can take time, depending on the size of the file. 

Pro tip: WordPress organizes files by year and month for better management. For example, if you’re uploading in October 2023, place your file in wp-content/uploads/2023/10/. If these folders don’t exist, you can create them manually.

Increasing the upload limit

If you’re facing the “wordpress 413 request entity too large” error due to upload limits, increasing the upload size is a solution. There are a few different ways to do this. Starting from the easiest, here are some ways to increase your upload limit:

Expert advice: Use a reliable backup plugin to take a backup before you make any changes. It will serve as insurance if something goes wrong. 

1. Use a WordPress plugin

If you’re new to WordPress or don’t want to dive into code, using a plugin is an easy way to increase the upload limit. For the sake of this article, we tried WP maximum upload file size and here is how to use it:

  1. Install and activate the plugin from the WordPress repository
  2. Go to Plugins and then click on Settings under this plugin.
  1. Enter your desired upload limit number and click Save Changes.

2. Edit the .htaccess file

For those comfortable with editing files, changing the .htaccess file can effectively increase limits. The .htaccess file is a configuration file used by servers to manage rules. You can do anything from improving security with .htaccess or increasing the file upload limit. 

  1. Connect to your server using an FTP client
  2. Find the .htaccess file in your root folder (often called public_html). The .htaccess file is a hidden file that you will need to reveal in the Vew tab. 
  3. Add the following lines:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

These settings increase the maximum file size and ensure uploads don’t time out.

3. Modify the functions.php file

If you have a child theme, modifying the functions.php file is a safe way to adjust upload limits directly from your theme’s settings.

Expert advice: By default, you can edit the functions.php file in the admin panel. But, we recommend you disable file editing. It’s a popular security hardening measure. 

  1. Connect to your server using an FTP client
  2. Navih\gate to the folder for the active theme
  3. In the theme folder, find the functions.php file and add the following code:
@ini_set('upload_max_size' , '64M' );
@ini_set('post_max_size','64M');
@ini_set('max_execution_time', '300');

This will increase the upload limit for your site.

If the above methods do not work, reach out to your hosting provider. They often have the ability to change server-level settings that you cannot access. They can adjust the upload limit to your needs or offer further advice. You can also migrate your site to a new host if the current one doesn’t offer enough bandwidth. 

How to prevent the “413 request entity too large” error?

To ensure your WordPress site functions without hitches and avoids the “413 request entity too large” error, it’s crucial to take some preventative measures. By optimizing file uploads and managing server resources systematically, you can greatly reduce the chances of encountering this error. Here’s how:

  • Set appropriate upload limits: Setting clear upload limits that match your needs protects your server from becoming overloaded. It ensures that users can upload necessary files without exceeding the server’s capacity. Evaluate the types of files you generally upload and their sizes. Use server settings or plugins to configure upload limits that accommodate typical use without being excessive. This can be managed through your hosting control panel or via plugins that allow upload limit configurations.
  • Optimize file sizes before upload: Smaller file sizes are  easier for servers to handle, reducing strain and risk of exceeding upload limits. Use tools like image compressors or video editing software to reduce file sizes before uploading. WordPress also has plugins like Airlift that optimize files for you.
  • Use a CDN for large files: A CDN distributes the load of serving files over multiple servers worldwide, preventing a single server from becoming overloaded. Choose a CDN provider and configure your WordPress site to use their service. This can typically be done through a plugin or by modifying your site settings to integrate with the CDN. Airlift and other performance plugins may offer CDN services as part of their performance optimization plans. 
  • Enable chunked uploads in plugins: Chunked uploads divide large files into smaller parts, easing the upload process and reducing server load. Look for upload or file management plugins that support chunked uploads. Activate this feature within the plugin settings to improve upload efficiency. Upload Large Plugins is free plugins that can help you do this. 
  • Monitor server resources regularly: By keeping track of how much of your server’s resources you’re using, you can predict and prevent issues before they happen. Utilize hosting control panels or third-party monitoring tools that provide real-time insights into memory, CPU, and disk usage.
  • Adjust server configurations proactively: Regularly updating server settings can prevent outdated configurations from causing errors. Routinely review server settings, especially when you update your site or add significant new content. Consulting your hosting provider for recommendations can also be helpful.
  • Educate users on file requirements: When users know what is required, they’re less likely to upload huge files that could cause errors. Provide clear guidelines or create a help page outlining acceptable file types and sizes for uploads.
  • Use efficient media management plugins: These plugins help manage and optimize media files, ensuring they stay within size limits and are well-organized. Research and install media management plugins that offer features like auto-optimization and organization of media files.
  • Use good themes and plugins: Choose plugins that are light, and frequently updated. Test an update on a staging site before you push it onto the full site. Avoid nulled plugins for a smooth website too. 
  • Consider upgrading hosting plan: If your site has grown, a more robust hosting plan can provide additional resources and higher upload limits. Compare current usage and future needs with what your host offers. Selecting a plan that offers better support for your growing site can prevent future upload-related issues.

Final thoughts

The upload limit for your WordPress site largely depends on your hosting provider. This means you might need to adjust the limit to suit your website’s needs, especially if you work with larger files. Remember, changing these settings is a sensitive task. Before making any modifications, always backup your site using a backup service like BlogVault. This ensures that if anything goes wrong, you can quickly restore your site to its previous state. Prioritizing backups gives you peace of mind while working on improving your site’s performance.

FAQs

How to fix the 413 request entity too large error in WordPress?

To fix this error, you can increase the file upload size limit in your WordPress settings. This can be done by using a plugin that adjusts settings, modifying the .htaccess file, or editing the functions.php file in your theme. If these methods don’t work, contact your hosting provider for assistance. Always remember to back up your site with a tool like BlogVault before making any changes.

How do I fix a 413 request entity too large?

Fixing the “413 request entity too large” error involves increasing the file size limits. You can edit server configuration files like .htaccess, php.ini, or nginx.conf, or use a WordPress plugin to change these limits easily. If you’re unsure how, your hosting provider can adjust these settings for you.

What is 413 content too large?

The “413 content too large” error is an HTTP status code indicating that the data being sent to the server (like a file upload) exceeds the server’s current limits. This error can be resolved by increasing these limits in the server’s configuration settings.

Tags:

You may also like


Fix: WordPress 403 Forbidden
Fix: WordPress 403 Forbidden

Stuck with a “403 Forbidden” error while trying to access your WordPress site? It’s a little scary and quite cumbersome but you can troubleshoot WordPress errors like this.  It’s a…

How do you update and backup your website?

Creating Backup and Updating website can be time consuming and error-prone. BlogVault will save you hours everyday while providing you complete peace of mind.

Updating Everything Manually?

But it’s too time consuming, complicated and stops you from achieving your full potential. You don’t want to put your business at risk with inefficient management.

Backup Your WordPress Site

Install the plugin on your website, let it sync and you’re done. Get automated, scheduled backups for your critical site data, and make sure your website never experiences downtime again.