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

Jak zwiększyć maksymalny rozmiar przesyłanego pliku w WordPress

Nasi czytelnicy często proszą nas o pomoc w rozwiązaniu problemów związanych z ograniczeniami przesyłania plików. To proste ustawienie witryny internetowej może mieć nieoczekiwane skutki dla twojej witryny.

Na przykład, czasami niski limit rozmiaru przesyłanych plików może uniemożliwić przesyłanie plików za pomocą narzędzia do przesyłania multimediów lub instalowanie większych wtyczek i motywów WordPress. Może to być bardzo frustrujące, zwłaszcza gdy nie masz pewności, jak zmienić limit.

W tym artykule pokażemy, jak łatwo zwiększyć maksymalny rozmiar przesyłanych plików w WordPress, aby poprawić te problemy.

How to increase the maximum file upload size in WordPress

Dlaczego warto zwiększyć maksymalny rozmiar przesyłanego pliku w WordPress?

Twój dostawca hostingu WordPress ustawi domyślny maksymalny rozmiar przesyłanych plików podczas rejestracji i instalacji WordPressa. Twój dostawca hostingu definiuje ten limit i zwykle wynosi on od 2 MB do 500 MB.

Dla większości właścicieli witryn internetowych WordPress limit ten będzie więcej niż wystarczający.

Zdarzają się jednak sytuacje, w których konieczne będzie zwiększenie tego limitu, aby uniknąć błędów przesyłania.

Na przykład:

  • Prowadzisz witrynę internetową poświęconą fotografii i musisz przesyłać duże obrazki.
  • Twoje portfolio projektowe lub fotograficzne zawiera duże obrazki.
  • Chcesz zainstalować większy motyw WordPress lub wtyczkę.
  • Chcesz sprzedawać produkty cyfrowe, takie jak eBooki, zdjęcia, filmy i inne.
  • Regularnie aktualizujesz treść i dodajesz pliki audio, zdjęcia i inne, które wykraczają poza obecny, aktualny limit.

Biorąc to pod uwagę, pokażemy ci, jak możesz zwiększyć maksymalny rozmiar przesyłanych plików na twojej witrynie WordPress.

Uwaga: Należy pamiętać, że wyświetlanie wielu dużych plików na twojej witrynie internetowej może poważnie spowolnić jej szybkość i wydajność. Dlatego też zazwyczaj zalecamy, aby nigdy nie przesyłać filmów do WordPressa.

Ponieważ większość użytkowników ma różne konfiguracje hostingu WordPress, omówimy następujące kwestie:

Film instruktażowy

Subscribe to WPBeginner

Jeśli wolisz pisemne instrukcje, czytaj dalej.

Jak sprawdzić twój maksymalny limit rozmiaru przesyłanego pliku w WordPress?

WordPress automatycznie wyświetli maksymalny limit rozmiaru przesyłanego pliku podczas przesyłania obrazków lub innych multimediów.

Aby to sprawdzić, po prostu przejdź do Media ” Utwórz nowy w panelu administracyjnym WordPress, a zobaczysz maksymalny limit rozmiaru przesyłanego pliku dla twojej witryny WordPress.

Check current file upload size limit

Teraz, gdy już wiesz, jak znaleźć limit rozmiaru, pokażemy Ci, jak zwiększyć maksymalny rozmiar przesyłania w WordPress.

Metoda 1: Skontaktuj się z dostawcą hostingu WordPress

Jednym z najprostszych sposobów na zwiększenie maksymalnego rozmiaru przesyłanych plików w WordPress jest skontaktowanie się z dostawcą hostingu WordPress.

Jest to stosunkowo proste zadanie dla ich zespołu obsługi klienta i można je wykonać w ciągu kilku minut.

Dla początkujących może to być znacznie łatwiejsze niż dodawanie kodu do WordPressa i edytowanie plików serwera.

Wystarczy przejść do witryny internetowej dostawcy hostingu, takiego jak Bluehost, i logować się.

Następnie kliknij ikonkę „Czat” u dołu ekranu. Następnie możesz poprosić pracowników pomocy technicznej o zwiększenie rozmiaru przesyłania plików na twojej witrynie WordPress.

Clicking the Bluehost live chat support button in the dashboard

Możesz również skontaktować się z pomocą techniczną z poziomu kokpitu Twojego konta hostingowego.

Metoda 2: Utwórz lub edytuj istniejący plik php.ini

Innym sposobem na zwiększenie maksymalnego rozmiaru przesyłanego pliku jest utworzenie lub edycja pliku o nazwie php.ini. Plik ten kontroluje wiele ustawień dla twojego środowiska hostingowego WordPress.

Większość dostawców hostingu WordPress, takich jak Bluehost, ma przyjazny dla początkujących cPanel, który pomaga zarządzać twoją witryną internetową.

Jeśli twój hosting ma kokpit cPanel, możesz zwiększyć rozmiar przesyłanych plików za pomocą wbudowanych narzędzi.

Uwaga: Poniższe informacje pochodzą z cPanelu Bluehost. Jednak większość dostawców hostingu współdzielonego będzie miała podobne kroki.

Przycisk cPanel znajduje się w dolnej części karty Hosting w Bluehost.

Open cPanel in Bluehost

Kliknięcie tego przycisku otworzy twój kokpit cPanel.

Teraz należy przewinąć w dół do sekcji Oprogramowanie i kliknąć „MultiPHP INI Editor”.

MuliPHP INI Editor in Bluehost's cPanel

Następnie przewiń w dół do sekcji oznaczonej „upload_max_filesize” i wpisz nowy maksymalny rozmiar pliku w polu.

Następnie kliknij przycisk „Zastosuj”.

Upload Max Filesize Setting

Alternatywnie można kliknąć kartę menu „Tryb edytora”, a następnie zmienić maksymalny rozmiar przesyłanego pliku bezpośrednio w edytorze.

Musisz edytować sekcję „upload_max_filesize”, aby zwiększyć twój rozmiar przesyłanego pliku.

Po zakończeniu kliknij przycisk „Zapisz”.

Change max upload filesize in code editor

Edycja php.ini poprzez dodanie kodu

Jeśli twój obecny, aktualny dostawca hostingu nie oferuje opcji cPanel, będziesz musiał edytować ten plik ręcznie.

Aby to zrobić, możesz użyć klienta FTP lub opcji menedżera plików w twoim panelu sterowania hostingu WordPress.

Jeśli korzystasz z hostingu współdzielonego, możesz nie widzieć pliku php.ini w twoim katalogu hostingowym. Jeśli go nie widzisz, po prostu utwórz plik o nazwie php.ini i prześlij go do twojego katalogu głównego.

Następnie dodaj następujący fragment kodu do pliku:

upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 300

Możesz zmodyfikować limit „256M” do rozmiaru pliku, którego potrzebujesz dla twojego bloga WordPress.

Metoda 3: Dodanie kodu do pliku functions.php twojego motywu WordPress

Metoda ta bierze udział w dodaniu kodu do pliku functions.php w twoim motywie WordPress.

Zamiast edytować plik bezpośrednio, zalecamy użycie WPCode. Jest to najlepsza wtyczka do fragmentów kodu, która umożliwia dodawanie kodu do twojej witryny internetowej bez jej niszczenia.

Jeśli nie robiłeś tego wcześniej, zapoznaj się z naszym przewodnikiem dla początkujących, jak dodać własny kod w WordPress.

Najpierw należy zainstalować darmową wtyczkę WPCode. Aby uzyskać więcej informacji, zobacz nasz przewodnik krok po kroku, jak zainstalować wtyczkę WordPress.

Po włączaniu należy przejść do opcji Fragmenty kodu ” + Dodaj fragment kodu. Należy najechać kursorem myszy na opcję „Dodaj Twój własny kod”, a następnie kliknąć przycisk „Użyj fragmentu kodu”.

Add a Custom Snippet in WPCode

Na następnym ekranie musisz nadać swojemu nowemu fragmentowi kodu nazwę i zmienić rodzaj kodu na „PHP Snippet”.

Następnie możesz skopiować i wkleić poniższy fragment kodu w sekcji „Podgląd kodu”. Upewnij się, że zmieniłeś „256M” na maksymalny wymagany rozmiar pliku:

@ini_set( 'upload_max_size' , '256M' );
@ini_set( 'post_max_size', '256M');
@ini_set( 'max_execution_time', '300' );
Save Your Custom Snippet in WPCode

Na koniec przełącz przełącznik u góry na „Włączony”, a następnie kliknij przycisk „Zapisz fragment kodu”. Kod zostanie teraz wykonany na twojej witrynie internetowej.

Metoda 4: Dodaj kod do twojego pliku .htaccess

Innym sposobem na zwiększenie maksymalnego rozmiaru pliku jest modyfikacja pliku .htaccess. Plik ten kontroluje wysokopoziomowe ustawienia konfiguracyjne twojej witryny internetowej.

Aby to zrobić, musisz logować się na twój serwer witryny internetowej przez FTP. Jeśli nie robiłeś tego wcześniej, zapoznaj się z naszym przewodnikiem na temat korzystania z FTP do przesyłania plików do WordPressa dla początkujących.

Następnie należy zlokalizować plik .htaccess w katalogu głównym witryny internetowej.

Open .htaccess file

Jeśli nie możesz znaleźć twojego pliku .htaccess, może on być ukryty przez menedżera plików lub klienta FTP. Aby dowiedzieć się więcej, zobacz nasz przewodnik na temat tego, dlaczego nie możesz znaleźć pliku .htaccess na twojej witrynie WordPress.

Następnie musisz dodać następujący fragment kodu do twojego pliku .htaccess:

php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value max_execution_time 300
php_value max_input_time 300

Aby jeszcze bardziej zwiększyć twój maksymalny rozmiar przesyłanego pliku, po prostu zmień „64M” na wymagany rozmiar.

Metoda 5: Użyj wtyczki WordPress, aby zwiększyć rozmiar przesyłanego pliku

Innym sposobem na zwiększenie maksymalnego limitu przesyłania plików jest użycie wtyczki WP Increase Upload Filesize. Jeśli nie czujesz się komfortowo dodając kod do WordPressa, może to być dobra opcja dla Ciebie.

Pierwszą rzeczą, którą musisz zrobić, jest zainstalowanie i włączanie wtyczki. Więcej szczegółów można znaleźć w naszym przewodniku na temat instalacji wtyczki WordPress.

Po włączaniu, przejdź do Media ” Increase Upload Limit w twoim panelu administracyjnym WordPress.

Spowoduje to wyświetlenie ekranu, na którym można wybrać nowy rozmiar przesyłanego pliku z listy rozwijanej „Wybierz maksymalny rozmiar przesyłanego pliku”.

Następnie kliknij przycisk „Zapisz zmiany”.

Increase file upload size with plugin

Uwaga: Maksymalny rozmiar przesyłanego pliku zostanie ustawiony przez twojego dostawcę hostingu. Jeśli potrzebujesz limitu rozmiaru pliku, który jest większy niż ten wymieniony w rozwijanym menu, musisz skontaktować się z dostawcą hostingu i poprosić o zwiększenie limitu.

Mamy nadzieję, że ten artykuł pomógł Ci zwiększyć maksymalny rozmiar przesyłanego pliku w WordPress. Zachęcamy również do zapoznania się z naszym przewodnikiem na temat wyboru najlepszego kreatora witryn internetowych oraz z zestawieniem najlepszych aplikacji do obsługi wirtualnych numerów biznesowych z bezpłatnymi opcjami.

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.

Ujawnienie: Nasze treści są wspierane przez czytelników. Oznacza to, że jeśli klikniesz na niektóre z naszych linków, możemy otrzymać prowizję. Zobacz jak WPBeginner jest finansowany, dlaczego to ma znaczenie i jak możesz nas wspierać. Oto nasz proces redakcyjny.

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.

Najlepszy zestaw narzędzi WordPress

Uzyskaj BEZPŁATNY dostęp do naszego zestawu narzędzi - zbiór produktów i zasobów związanych z WordPressem, które każdy profesjonalista powinien mieć!

Reader Interactions

407 komentarzyZostaw odpowiedź

  1. Syed Balkhi

    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. Manish

    I am unable to import my blogger exported xml file to wordpress.
    My blogger imported xml file size is 24 mb.
    Please solve this problem, i shall be thankful to you.

  3. Hashim

    3. htaccess Method worked for me.

    Thanks

  4. John

    Has anyone ever told you that the copy and paste YOUR code all throughout your site always has the:

    1: code
    2: code
    3: code

    So it’s a bit of a edit to get it to work right when a simple copy/paste would be stressfree for your readers! Just sayin…

  5. John Delaney

    Create php.ini file and place it in wp-admin folder, not the root. Fixes it every time.

    • Michael Kelley

      Thanks! This is the only thing that worked for me. Worth noting, I already had a php5.ini file in there w/ the same code, it did nothing. A tad confusing.

  6. Robert

    After 2 hours of frustration, the htaccess method mentioned here worked out for my local environment.

    Thank you very much. :)

  7. Robin

    I change my .htaccess and put

    php_value memory_limit 2G
    php_value upload_max_filesize 2G
    php_value post_max_size 2G
    php_value max_execution_time 99999
    php_value max_input_time 99999

    when I go for upload a fine it shows 2GB but when I upload any file that larger then 128MB it shows HTTP error. Need help please.

    Thanks

    • Zain Zaheer

      Set max limit to 128M instead of 2G

  8. Robin

    I add on my .htaccess

    php_value memory_limit 2G
    php_value upload_max_filesize 2G
    php_value post_max_size 2G
    php_value max_execution_time 99999
    php_value max_input_time 99999

    and it shows 2GB but when I upload larger then 128M file it gives me HTTP error. can anyone help me please.

    Thanks

  9. Elisabeth Parker

    I DO NOT recommend putting that code in the Theme Functions file. I tried it and it completely blew up my site. And if you don’t know how to use FTP or the File manager to change the Functions file BACK, you’ll be very unhappy. I haven’t tried the other options but if I find something that works I’ll let you know :)

    • kennedy Odhiambo

      Hello Elisabeth,ive tried it and it has also blown up my site,i cant acces it…may i please know how you fixed it?

  10. Caki

    Just contacted godaddy. I am using cpanel hosting through them. He added a file .user.ini in the public/html file with the following:

    memory_limit = 128M
    max_execution_time = 300
    post_max_size = 128M
    upload_max_filesize = 256M

    • razib ahmed

      thank you so much! it,s working for me

    • Tino

      I’m with Axxess and this also worked for me!

    • Paul Vijay

      Thanks a lots this Worked for me . I too use Godaddy Hosting, Still the Template fails to load from Online database can u help

    • Bob

      do you name it .user.ini or user.ini ??

    • Jesse

      This method worked for me! Thank you so much for sharing!!!

  11. Craig

    in the .htaccess solution, where in the file do you enter the code, i put it at the end and got a 500 error?

  12. Cornelius

    I heard as an alternative you could just directly upload via the ftp cpanel, but when I do that the PDF does not show up in my WP media dashboard?

    • WPBeginner Support

      Hi Cornelius,

      You can upload a PDF file but yes you are right it will not be visible in the Media library on your WordPress site. To see a file in the media library and be able to easily add it, you would need to upload it using the built in media uploader.

      Administrator

      • Christopher Eller

        You can upload anything via FTP/SFTP and then add it to the database using a plugin like Add From Server.

  13. Nitus

    This worked for me (as nothing else would):

    – Open wp-config.php
    – At the very bottom add this line:

    define(’WP_MEMORY_LIMIT’, '128M’);

    – Save (and upload your file)

  14. Maja

    So i’m not a developer so i dont feel like messing with php and some functional stuff.
    i found from a post above php settings and all is set right, max file size is 30MB so i’m confused why i still can’t upload media bigger than 5mb.
    is there a wordpress thing that i’m missing
    i didn’t find anywhere place to change that,

  15. Niall Flynn

    If you are using cPanel most of the time you edit via the PHP Version settings, you can check if you are on 5.6 or 7.0 and edit all the settings via cpanel. For me this is the only way my host has all the others locked down, but its real handy and there are simple ways to enable PHP modules and tweak any setting.

  16. yaser

    Thanks.

    This is what finally worked for me:

    In wp-config, before wp-settings:

    define( 'WP_MEMORY_LIMIT’, '256M’ );
    define( 'WP_MAX_MEMORY_LIMIT’, '256M’ );
    ini_set( 'memory_limit’, '256M’ );

    In .htaccess:

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

    • mohammad

      thanks man you made my day it worked

    • Evan Olsen

      This worked for me! Thank you!

    • Yna Capumpue

      How do you get to the wp-config? I mean where do you input the code itself? Thanks.

    • maneesh naithani

      made my day. thank you man.

  17. Rahadian

    Thank you for this valuable post, .htaccess method works for me

  18. Abhishek

    Thanx a lot php.ini option works thanx a lot :)

  19. Sean

    Hello

    I am building a woocommerce store for selling audio files. Some of my files are over 100MB so uploading straight from wordpress wont work. What I am trying to do is Upload the file to cpanel and than post that link in the downloadable product on WP. But I dont know how to do it. I view the file in cpanel and copy that link but that just takes the person to cpanel login. I dont know hot to get the link of my file in cpanel so others can download it when they buy a product?

    Do you have a tutorial on this?

    or can you help?

    Thanks

    • Ian

      You would need to look more into this because you would need security for that file url, generally the file url is accessible to everything and therefore can be downloaded without making a purchase.

  20. Larry Scott

    The second suggestion of creating a php.ini file works like a charm.

  21. john

    Absolutely DO NOT try to enter that code into the Theme Functions file!!!!! Now I am getting error messages and can’t get to the dashboard for my site. I won’t DARE try any of their other suggestions.

    • WPBeginner Support

      Hi John,

      You can easily edit your functions.php file using an FTP client to undo the changes you made.

      Administrator

  22. Fred Preston

    Thanks. the .htaccess version worked for me. I just had to remember to show hidden files in my cpanel file manager.

  23. John

    Just wanted to say thanks. I’ve been able to solve three wordpress related issues in one day, all with help from this website. Kudos on the good work. :D

  24. David

    Thanks.
    The php.ini edits helped. I had to make sure to also up the post_max size as well. I failed to edit this on first update, and nothing changed. Edit all parameters and presto. Thanks again!

  25. Alyse

    Is there a specific place to add it in the theme functions file? The beginning? The end?

  26. Shambo

    Modifying .htaccess file worked for me. Thanks a lot..

  27. Celal Erdogdu

    It works, thank you.

  28. Bentham

    Thank you so much ,option one gave me a hint

  29. Mohsin

    .htaccess method worked for me. Thanks for this article.

  30. Aswani Somarajan

    It was great. Very helpful! Had to upload a theme, used the second method. added a ner php.ini file and the theme is installed. Thanks a lot :)

  31. John

    Thanks for helping

    making the changes in the .htaccess method made the website crash
    however changing the php.ini file worked for me.

  32. Don

    or try another method like mine,

    on cpanel > click the „select php version” > then click „switch to php options” > find the „upload_max_filesize” then change it whatever you want.

    • Aoun

      Thanks…… Its very helpful and working perfectly

    • Jose

      Thnxs dude, you saved my job

    • Md Robiul Islam

      Thanks you so much… for your comment I fix my issue after try long time.. thanks a lot…..

    • Miaka

      The methods in the article didnt work for me but this did! Thank you so so much, Don! Article author, hope you could edit this method as one of the solutions in your article!

  33. Rudi

    Thank you so much, I used the htaccess Method and it’s worked for me.

  34. bob hildegard

    ’upload_max_size’ is not a php.ini variable name. it’s 'upload_max_filesize’. that’s stated wrong in solution 1

  35. Eric

    First thing I tried was modifying the .htaccess file. Worked for me!

  36. Reza

    htaccess option returns a 500 Internal Server error when reloading my website and wp admin

  37. kashyapkumbhani

    sir i Tried all But my Xml File Not Imported Please Help me:) thank u

  38. Trevor

    I tried your first suggestion, and apparently threw some bad code into the functions.php file and now I have lost access to my website’s dashboard, the actual website cannot be accessed by anyone, and the problem is obviously not solved.

  39. Aakarshit

    None of then worked ; (

    Even contacted the hosting provider, no reply from them ; (

  40. frizzy lee

    thanks .. the htacess method worked for me too .. thumbs up bro

  41. Okie Wardoyo

    Hi, where i should put that code to my .htaccess file.
    I have tried put this code to my htaccess file but it always 500 internal server error when i open my live site.

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    php_value max_input_vars 5000
    php_value max_execution_time 300
    php_value post_max_size 50M

    # END WordPress

    • John Jones

      Try this:

      php_value upload_max_filesize 50M
      php_value post_max_size 50M
      php_value max_execution_time 300
      php_value max_input_time 300

  42. Jitender Singh

    .htaccess works nicely.

  43. subodeep ray

    thanks .htaccess works smoothly :-)

  44. Bukunmi

    Where exactly do I put those codes in my Theme function? because i’m kind of lost

    • Galuh Prasetyawan

      in Appearance -> editor, find function.php

      • Eóin Kilroy

        Right, but where exactly in the function file?

  45. Manas Mitra

    Hi,

    I have used the first method of adding code to child theme functions.php file, but it does not have the desired effect. In localhost, the limit is 3 MB and in shared server, the limit is 32 MB. Any idea why it is happening so?

    Thanks.

  46. Bouguezzi

    the .htaccess modification methode worked with me :) thx a lot

  47. cathy belyea

    i have followed this even contacted my host increased my uploads to 64mb however in wordpress it still only allows 8mb.
    any other suggestions please help.

  48. Guillermo

    Same problem for wordpress 3.9 / 4 version and having a look to Chrome console or firefox I saw an error 413 of NGINX when uploading

    Maybe this thread can help to nginx users ;)

Zostaw odpowiedź

Dziękujemy za pozostawienie komentarza. Pamiętaj, że wszystkie komentarze są moderowane zgodnie z naszymi polityka komentarzy, a Twój adres e-mail NIE zostanie opublikowany. NIE używaj słów kluczowych w polu nazwy. Przeprowadźmy osobistą i konstruktywną rozmowę.