Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Fix the 413 Request Entity Too Large Error in WordPress

The ‘413 Request Entity Too Large’ error can pop up when you are trying to upload a theme or plugin file in WordPress. It means that the file is larger than the allowed maximum file upload limit on your website.

We’ve been helping WordPress users troubleshoot errors just like this one for several years, so we know how frustrating it can be.

In today’s guide, we will show you how to troubleshoot the ‘413: Request Entity Too Large’ error by increasing the file upload size.

WordPress 413 error - Request entity too large

What Causes the WordPress 413 Request Entity Too Large Error?

This error usually happens when you are trying to upload a file that exceeds the maximum file upload limit on your WordPress website.

Your web server will fail to upload the file, and you will see the ‘413 Request Entity Too Large’ error message.

413 request entity too large error example

Normally, most WordPress hosting companies have their servers configured so that WordPress users can easily upload large images and other media.

However, sometimes, this setting is not high enough to upload large theme or plugin files.

The server configuration can also stop you from uploading large files to the media library. In this case, you will see a different message clearly stating that the file size exceeds the maximum allowed limit.

File size exceeds maximum upload size limit

That being said, let’s take a look at how to fix the WordPress ‘413 Request Entity Too Large’ error.

Fixing 413 Request Entity Too Large Error in WordPress

There are multiple ways to fix the request entity too large error in WordPress. We will cover all these methods, and you can try the one that works best for you.

You can use the quick links below to jump to the method you want to use:

Expert Tip: Prefer not to do the troubleshooting yourself? Our Premium WordPress Support Services can fix the 413 error and any other issues on your WordPress website.

Method 1: Increase Upload File Size Limit Using WPCode (Recommended)

You could directly edit your theme’s functions.php file. However, we recommend against this method because even small mistakes can break your website.

That’s why we recommend using WPCode instead. It is the best WordPress code snippets plugin that allows you to increase the upload file size limit without directly editing the functions.php file.

First, you will need to install and activate the free WPCode plugin. For more details, see our guide on how to install a WordPress plugin.

Next, you need to go to Code Snippets » Add Snippet in your WordPress admin sidebar. Then, hover your mouse over the ‘Add Your Custom Code (New Snippet)’ option and click the ‘Use snippet’ button.

Adding a custom code snippet to WordPress

You can enter a title for the code snippet at the top so that you can find it easily.

You now need to enter the following code into the ‘Code Preview’ box:

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

Make sure that you also select ‘PHP Snippet’ from the ‘Code Type’ dropdown menu.

Increase file upload size with WPCode snippet

You can increase the values in upload_max_size and post_max_size to be more than the file you are trying to upload.

You will also need to increase the max_execution_time to the time you think it would take for the file to upload. If you are unsure, then you can try doubling this value.

Finally, make sure to toggle the code snippet from ‘Inactive’ to ‘Active’ at the top of the page and click on ‘Update’. This will execute the code snippet on your WordPress site.

Switch the code snippet to Active and click Update in WPCode

For more details, please see our guide on how to easily add custom code in WordPress.

Method 2: Increase Upload File Size Limit via .htaccess File

For this method, you will need to access and edit your .htaccess file using an FTP client or the file manager app in your web hosting dashboard’s cPanel. Note that you won’t have access to this file if your hosting provider uses NGINX instead of an Apache server.

For more details, see our guide on how to use FTP in WordPress.

Then, simply add the following code at the bottom of the .htaccess file:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

You can change each of the numerical values to be more than the size of the file you are trying to upload. Then, make sure to save and reupload the .htaccess file to your server.

To learn more about increasing the file upload size limit, see our guide on how to increase the maximum file upload size in WordPress.

Method 3: Manually Upload File via FTP

If the 413 error only occurs when you are uploading one specific file, then you may want to consider uploading it manually via FTP.

If you are trying to upload a WordPress theme, then see our guide on how to install a WordPress theme and jump to the ‘Installing a WordPress theme using FTP’ section.

If you are trying to upload a plugin, then see our guide on how to install a WordPress plugin and jump to the ‘Manually install a WordPress plugin using FTP’ section.

For other files, you can see our guide on how to manually upload WordPress files using FTP.

We hope this article helped you learn how to fix the WordPress ‘413 Request Entity Too Large’ error. You may also want to learn how to fix errors in WordPress and see our expert picks for the must-have WordPress plugins to grow your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

18 CommentsLeave a Reply

  1. Jiří Vaněk

    I tried both WP COde and .htaccess and unfortunately it didn’t work. Only after contacting the provider did I find out that these options were deliberately blocked and they had to allow a higher limit. Therefore, these options are not always available. Otherwise, thanks for a great article on another error I might encounter in WordPress.

    • WPBeginner Support

      Thanks for sharing another thing for users to check. :)

      Admin

  2. fykto

    In instances where you get an immediate 413 response and you are certain the PHP file upload limits are set appropriately, check the web server (Apache or Nginx) settings on max allowed body size.

    • WPBeginner Support

      Thank you for sharing another option to try, for most beginner users we would recommend reaching out to your host for checking if this can help!

      Admin

  3. Harry

    I am getting it on one site in the admin side when trying to update a site

    • WPBeginner Support

      If you continue to receive the error after trying our recommendations, we would recommend reaching out to your hosting provider and they can normally assist.

      Admin

  4. Kirsty

    This is so frustrating. I’ve done the functions.php and amended and it still isn’t working.

    I’ve never had an issue uploading this theme anywhere else

    • WPBeginner Support

      Your host may be overriding any changes. If you reach out to your hosting provider they should be able to assist

      Admin

  5. Sally Pilkington

    Hi, I think the code in Method 1 should go in the wp-config.php file, not the functions.php file as you suggested – could you check this? I think it would break functions.php and cause white screen…

    • WPBeginner Support

      The code should still go in the functions.php and would not cause a while screen error.

      Admin

  6. Jakob

    Hello,

    I´m not that much into coding..

    Where exactly should i put the code in the functions.php file, recommendod in the first solution? and are there any special signs needed? to start / end it f.e.?

    Thanks

  7. Ken

    Since this is one of the first hits on Google, I will add this-

    If you are using a CDN like Cloudflare and continue to receive error 413 after making the adjustments, bypass your CDN, either by turning it off, or adding an entry to your hosts file to bypass the CDN. Sometimes the CDN has a limit set below what you have and you are just ramming your head against a wall needlessly.

    • WPBeginner Support

      Thank you for adding your recommendation :)

      Admin

  8. Sujal

    I have tried even I have changed the limit and clearly showing the limit upto 5GB but couldn’t be uploaded ?? said same error ?? please help?

  9. sachin

    I got the following message while updating menu in Wordpress dashboar.

    [Request Entity Too Large
    The requested resource
    /wp-admin/nav-menus.php
    does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.]

    Could you please tell me the solution for it.

      • Brian

        The 413 error is a response from the web server, so you need to add a line to the configuration file. In my case it was nginx, so I added the following to nginx.conf in the html section of the file…

        client_max_body_size 32m;

        After that I restarted nginx and the upload worked.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.