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

Så här fixar du error 413 Request Entity Too Large i WordPress

Error ’413 Request Entity Too Large’ kan dyka upp när du försöker uploada en theme- eller plugin-fil i WordPress. Det betyder att filen är större än den tillåtna maximala limiten för uppladdning av filer på din website.

Vi har hjälpt WordPress-användare att troubleshoota error som gillar detta i flera år, så vi vet hur frustrerande det kan vara.

I dagens guide visar vi dig hur du troubleshootar error ’413: Request Entity Too Large’ genom att öka storleken på filuppladdningen.

WordPress 413 error - Request entity too large

Vad orsakar WordPress 413 Request Entity Too Large Error?

Detta error inträffar vanligtvis när du försöker uploada en fil som överskrider den maximala limiten för filuppladdning på din WordPress website.

Din web server kommer att misslyckas med att uploada filen, och du kommer att se felmeddelandet ”413 Request Entity Too Large”.

413 request entity too large error example

Normalt har de flesta WordPress webbhotell sina servrar konfigurerade så att WordPress användare enkelt kan ladda upp stora images och andra media.

Ibland är dock denna inställning inte tillräckligt hög för att uppladare stora theme- eller plugin-filer.

Konfigurationen av servern kan också hindra you från att uppladare stora filer till mediabiblioteket. I så fall kommer du att se ett annat message som tydligt anger att filstorleken överskrider den högsta tillåtna limiten.

File size exceeds maximum upload size limit

Med detta sagt, låt oss ta en titt på hur du fixar WordPress ’413 Request Entity Too Large’ error.

Fix 413 Request Entity Too Large Error i WordPress

Det finns flera sätt att fixa request entity too large error i WordPress. Vi kommer att täcka alla dessa metoder, och du kan prova den som fungerar bäst för dig.

Du kan använda snabblänkarna under för att hoppa till den metod du vill använda:

Experttips: Föredrar du att ej göra felsökningen själv? Våra premium WordPress Support Services kan fixa 413 error och alla andra issues på din WordPress website.

Metod 1: Öka gränsen för filstorlek för upload med WPCode (rekommenderas)

You could directly edit your theme’s functions.php file. Vi rekommenderar dock inte den här metoden eftersom även små misstag kan förstöra din website.

Det är därför vi rekommenderar att du använder WPCode istället. Det är det bästa WordPress code snippets plugin som tillåter dig att öka upload filstorleks limit utan att direkt editera functions.php-filen.

Först måste du installera och aktivera det gratis pluginet WPCode. För mer detaljer, se vår guide om hur du installerar ett plugin för WordPress.

Därefter måste du gå till Code Snippets ” Add Snippet i din WordPress admin sidebar. Sedan hoverar du musen över alternativet ”Add Your Custom Code (New Snippet)” och klickar på knappen ”Use snippet”.

Adding a custom code snippet to WordPress

Du kan enter en titel för code snippet högst upp så att du lätt kan hitta det.

Du måste nu enter följande kod i boxen ”Code Preview”:

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

Se till att du också väljer ”PHP Snippet” från dropdown-menyn ”Code Type”.

Increase file upload size with WPCode snippet

Du kan öka värdena i upload_max_size och post_max_size så att de blir större än den fil du försöker uploada.

Du måste också öka max_execution_time till den tid du tror att det tar för filen att uploada. Om du är osäker kan du prova att fördubbla detta värde.

Slutligen, se till att toggle code snippet från ”Inaktiverad” till ”Aktiv” högst upp på sidan och klicka på ”Update”. Detta kommer att exekvera code snippet på din WordPress site.

Switch the code snippet to Active and click Update in WPCode

För mer details, vänligen se vår guide om hur du enkelt kan lägga till custom code i WordPress.

Metod 2: Öka limiten för filstorlek för upload via .htaccess-filen

För den här metoden måste du komma åt och editera din .htaccess-fil med hjälp av en FTP-klient eller filhanteringsappen i adminpanelens cPanel på ditt webbhotell. Obs/observera att du inte kommer att ha tillgång till den här filen om din hosting provider använder NGINX istället för en Apache server.

För mer detaljer, se vår guide om hur du använder FTP i WordPress.

Sedan addar du bara till följande kod längst ner i .htaccess-filen:

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

Du kan ändra vart och ett av de numeriska värdena så att de är större än storleken på filen du försöker uploada. Se sedan till att save och ladda upp .htaccess-filen på nytt till din server.

Om du vill veta mer om hur du ökar limiten för filuppladdning kan du läsa vår guide om hur du ökar den maximala storleken för filuppladdning i WordPress.

Metod 3: Uppladda filen manuellt via FTP

Om error 413 bara uppstod när du uploadar en specifik fil, kan du överväga att uploada den manuellt via FTP.

Om du försöker uploada ett WordPress-tema, se vår guide om hur du installerar ett WordPress-tema och hoppa till section ”Installing a WordPress theme using FTP”.

Om du försöker uploada ett plugin, se vår guide om hur du installerar ett WordPress plugin och hoppa till ”Manually install a WordPress plugin using FTP” section.

För andra filer kan du se vår guide om hur du manuellt uppladdar WordPress-filer med FTP.

Vi hoppas att den här artikeln hjälpte dig att lära dig hur du fixar WordPress ’413 Request Entity Too Large’ error. Du kanske också vill lära dig hur du fixar error i WordPress och se våra expertval för de WordPress tillägg som måste finnas för att få din website att växa.

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.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

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.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

19 kommentarerLämna ett svar

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    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.

  3. fykto says

    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 says

      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!

      Administratör

    • WPBeginner Support says

      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.

      Administratör

  4. Kirsty says

    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 says

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

      Administratör

  5. Sally Pilkington says

    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 says

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

      Administratör

  6. Jakob says

    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 says

    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.

  8. Sujal says

    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 says

    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 says

        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.

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.