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. Dayo Olobayo

    Thanks for showing how to check the default limit. Just checked mine now and saw it’s 1GB. I think that’s good enough for me so I won’t be touching anything. I must also add that the wpcode method would have been my preferred method if I needed to change anything.

  3. Lisha Van Nieuwenhove

    This help was BRILLIANT. THANK YOU!

    • WPBeginner Support

      You’re welcome!

      Administrator

  4. Ray Konopka

    Thanks for the tips. My site is hosted in BlueHost so I first tried Method 2. However, after changing the upload_max_filesize value, the Add New media page for my site still showed 64 MB. I went back into the MultiPHP INI Editor and looked at the other values. One other value stood out:
    post_max_size
    Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size.

    After I increased the post_max_size value as well, then the Add New media upload page showed the new limit. Perhaps you can update the post to include this tip.

    • WPBeginner Support

      Thank you for sharing this, we’ll be sure to look into it and possibly add it to the article in the future :)

      Administrator

  5. Mark

    All my limits were increased as suggested, but I started getting 'files are too big’ after a plugin update. After double checking everything server and email side, the solution was changing from 5M to 5120kb in Contact Form 7 settings. The plugin suddenly stopped recognizing M when trying to override the default 1024kb setting.

    • WPBeginner Support

      Thanks for sharing this should someone else run into this issue!

      Administrator

  6. devshah

    Function.php method is not Working.

    • WPBeginner Support

      It would depend on your host and what else is set up on your server for what will work. If nothing else works you can always reach out to your host for assistance.

      Administrator

  7. Halil AHMAD

    The .htaccess worked for me. Thank you

  8. Muzoora Barnabas

    The .htaccess worked for me. Thank you

    • WPBeginner Support

      Glad our recommendation was able to assist :)

      Administrator

  9. Muhammad Farooqi

    You comments and thanks secion is almost 10 times longer..than the content of this page is guarantee of your amazing tips

    • WPBeginner Support

      We’re happy we can help so many WordPress users :)

      Administrator

  10. Jacob Alas

    The only method that worked for me was: htaccess Method

    Thank you.

    • WPBeginner Support

      Glad one of our methods was able to work for you :)

      Administrator

  11. Daniyar Nauryz

    htaccess Method has worked for me.

    • WPBeginner Support

      Glad our recommendation worked for you :)

      Administrator

    • WPBeginner Support

      If the recommendations are not working for you, we would recommend reaching out to your hosting provider and they should be able to assist if this is something they’ve set on their end.

      Administrator

  12. Abdullah Ashraf

    Thank you so much. I tried all the methods and the last method was helpful for me.
    I would like to know should I undo the second last step that was php.ini?

    • WPBeginner Support

      It is not required to remove that file but you can remove it if it is not working for your server.

      Administrator

    • WPBeginner Support

      If none of our recommendations work, we would recommend reaching out to your hosting provider to see if it is a restriction that they have set on their servers.

      Administrator

  13. Ben

    If you have access to the FTP, can I just upload the file in the wp-content/uploads/[year]/[month] folder?

  14. naved ahmed

    Thanks a lot
    .htaccess method worked for me.
    You saved my lot of time.
    Thanks again.

    • WPBeginner Support

      Glad our guide was able to help you :)

      Administrator

  15. Adio Usman

    Does this method works for restoring backup that is up to 3.5gb manually?

    • WPBeginner Support

      It would depend on the method you are using but it could help with restoring a backup that large.

      Administrator

  16. viren

    method 3 is perfectly worked for me.keep inspiring us.great work man.thnks

    • WPBeginner Support

      Glad our recommendation was helpful :)

      Administrator

  17. ayman

    .htaccess methode worked with me

    • WPBeginner Support

      Glad our recommendation was helpful :)

      Administrator

  18. Sanchit Setia

    Does this work on free hosting?

    • WPBeginner Support

      You would want to check with your hosting provider if you are concerned

      Administrator

    • WPBeginner Support

      Glad our recommendation helped you :)

      Administrator

    • WPBeginner Support

      If none of the recommendations worked we would recommend reaching out to your hosting provider for assistance.

      Administrator

  19. Ahmad

    I tried this but the size did not change… status is same please help what should I do know I am using localhost

    • WPBeginner Support

      You would want to try restarting your localhost service just in case, otherwise, you would want to ensure you added/editied the php.ini correctly for the most common reason.

      Administrator

  20. Vittorio

    I think
    @ini_set( 'upload_max_size’ , ’64M’ );

    should be
    @ini_set( 'upload_max_filesize’ , ’64M’ );

    • WPBeginner Support

      upload_max_size currently increases that value as well as a few other things which is why we don’t use upload_max_filesize

      Administrator

  21. MFoale

    Thank you. The 3rd method worked for me. Very useful post and video.

    • WPBeginner Support

      You’re welcome, glad we were able to help :)

      Administrator

    • WPBeginner Support

      Glad our guide could help you :)

      Administrator

  22. Oliver

    IT WORKS!!! THANKS

    I made a file ini.php then uploaded it, then renamed it from ini.php.txt to ini.php and it worked.

    thanks

    • WPBeginner Support

      You’re welcome, glad our guide was able to help :)

      Administrator

    • WPBeginner Support

      If our recommendations do not work you would want to reach out to your hosting provider to ensure they do not have it as part of their settings.

      Administrator

  23. Arivazhagan

    Method 2 worked for me thanks a lot ive been struggling with this for two days …

    • WPBeginner Support

      You’re welcome, glad our recommended solution was able to help you :)

      Administrator

  24. Sujan Chakraborty

    you are great.I fix my problem by reading you post.Tnx :D

    • WPBeginner Support

      Glad our article could be helpful :)

      Administrator

    • WPBeginner Support

      Glad our recommendation worked for you :)

      Administrator

  25. Tung

    Method 1 worked wonders for me. Thanks a bunch!

    • WPBeginner Support

      You’re welcome, glad our recommendation worked for you :)

      Administrator

  26. Trasadu

    Thanks Method 3 really worked for me.

    • WPBeginner Support

      Glad our recommendation was helpful :)

      Administrator

  27. Asad

    How can i increase the upload limit while i have the wordpress hosting also functions.php isn’t updating

    • WPBeginner Support

      If the file will not update, you would want to reach out to your hosting provider and they should be able to assist

      Administrator

  28. Chris

    I want to increase the limit to 250mb but i dont know if this exposes my site to security treats, though am only using gravity form and I have also set to disable php execution on my upload folder. And have allowed only jpg, and mp3 files.
    Please do you think this may affect my site load times as huge upload is coming from several users?

    • WPBeginner Support

      If multiple users attempt uploads at the same time it can have an effect on your site’s load time but it shouldn’t open you to security threats

      Administrator

  29. Vinod

    Thanks a lot!!! Method 3 worked for me

    • WPBeginner Support

      Glad our recommendation worked for you :)

      Administrator

  30. Janice

    Nice article, but I tried adding your 3 lines of code to the functions.php file, but got an „unknown @ rule” error. What’s that all about?

  31. Abduaziz

    Thanks a lot!!! Method 3 worked for me

    • WPBeginner Support

      Glad our recommendation could help :)

      Administrator

  32. Alexander Gartley

    Thanks, this helped me troubleshoot an upload limit. I’m on a WordPress multisite network install, so it ended up being a setting in the Network Admin Settings.

    I was confused at first, because my php settings were allowing larger uploads, but it was restricted in the Network Settings.

    • WPBeginner Support

      Thanks for sharing what solved the problem for you :)

      Administrator

  33. Ernesto

    Would have been great if you have included the .user.ini method.

    .user.ini uploaded in the root folder with the same value/text in your edited php.ini

    Most of the time, only this method works for shared hosting.

    ErnestPH

    • WPBeginner Support

      The php.ini file should work the same as the user.ini file unless your specific host ignores the php.ini but thank you for sharing your recommendation :)

      Administrator

    • Mark

      This is the only solution that works on my shared hosting server. Thanks Ernesto!

  34. Tamir Davidoff

    Not working for me.
    I have followed this guide and double checked the php.ini file to make sure that the changed are in fact saved. changed htaccess file to increase limits. and also tried modifying the phpMyAdmin httpd-app.conf and php-settings.conf file. All of these files reflect max upload higher than 40m and my WP site does not reflect Any of these changes. Really frustrated here.

    Please help me, thanks !

    • WPBeginner Support

      If you haven’t already, you would want to reach out to your hosting provider to ensure there is not a setting on their end that is overriding what you are setting :)

      Administrator

  35. rajesh

    i have tried all 3 method none of them worked. i am trying to upload newspaper theme in my in my wordpress site. but every time it show that php.ini file upload max file size.
    plz help me

    • WPBeginner Support

      You would want to reach out to your hosting provider to ensure they don’t have a setting that is overriding the changes you made.

      Administrator

  36. Adam Walsworth

    Watchout for hidden php.ini files. In my setup I found 2 of them. The one which I found actually resolved the issue was found under

    ./etc/php/7.0/apache2/php.ini

    modifying this file fixed my issue.

    • WPBeginner Support

      Thanks for sharing your solution, with where that file is located we would recommend most users reach out to their hosting provider before looking in locations like that.

      Administrator

  37. Rafiq khan

    Thanks buddy i have solved my problem by adopting method 2 by editing my php.ini file
    Thanks alot you are working great

    • WPBeginner Support

      Glad our article could help :)

      Administrator

  38. Carla

    None of the above worked for me. A matter of fact, editing the htaccess file broke my site even after deleting the above code. Overwriting with a new file fixed the problem though.

    I have a dedicated server on Bluehost. What worked for me was going in the WHM root, not cpanel nor FTP access. Search for MultiPHP INI Editor. Give it at least 5 minutes to load if you only see the title and icon. You can set you upload time, post size, etc. there. Works instantly, even if your site is using Cloudflare, without placing it in development mode or clearing the cache. I hope this helps someone.

    • WPBeginner Support

      Thank you for sharing what worked for you, should other users be on a dedicated server, if they reach out and let BlueHost know the need to increase the upload size then BlueHost can normally edit that for them :)

      Administrator

  39. Pezza

    Great Stuff! .htaccess worked for me!

    • WPBeginner Support

      Thank you, glad our guide could help :)

      Administrator

  40. ReineR

    htaccess metod worked for me, thanks!

    • WPBeginner Support

      Glad our article could help :)

      Administrator

  41. Ahmed

    Work for me

    3. htaccess Method

    you need to click (show hidden files to view and edit this file).

    • WPBeginner Support

      Glad our article could help :)

      Administrator

  42. rahul

    when i tried this
    Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.
    this happened to me
    whats the solution of this

  43. Ephraim

    I had been trying php.ini method but it never works please how will I set it..
    Or you should please tell me the were to paste at function.php

    • WPBeginner Support

      You would normally use a text editor to set the content in the php.ini file. For your functions.php it should go at the end normally so it can be removed later as needed. You may also want to check with your hosting provider if you are having trouble with these methods for if they can assist in increasing the file size for you.

      Administrator

  44. Ivos G.

    None worked for me. But this one fixed it – add to your .htaccess this line:

    LimitRequestBody 104857600

    • WPBeginner Support

      Thanks for sharing your solution for this issue :)

      Administrator

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