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

Uwaga redakcyjna: Otrzymujemy prowizję z linków partnerskich na WPBeginner. Prowizje nie mają wpływu na opinie i oceny naszych redaktorów. Dowiedz się więcej o Proces redakcyjny.

Czy chcesz zwiększyć maksymalny rozmiar przesyłanego pliku w WordPress?

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.

W tym artykule pokażemy, jak łatwo zwiększyć maksymalny rozmiar przesyłanego pliku 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 WordPress. 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 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. Steve S says

    I figured out a work-around that does not involve messing with php.ini, .htaccess, functions.php, or any other systtem files. All I did was the following:

    * FTP the file up to /wp-content/uploads/year/month/filename.mp4
    * New Post –> Add Media –> Insert from URL
    * Cut and paste the appropriate URL based on where you uploaded the file.
    * Hit Insert Into Post. Done.

    • kenny says

      Perfect! ps if you are inserting an image for a slide background in slider Revolution, use option 'External URL’

  3. Matt says

    Thanks. I want to also know how to make a website portal using wordpress. Any information from you will be highly appreciated.

  4. RT says

    Please try below steps as well after creating the php.ini

    (1) Go to My Sites -> Network Admin -> Settings from WordPress admin dashboard.

    (2) Uncheck the checkbox for „Site upload space: Limit total size of files uploaded to 10 MB” and Save changes.

    (3) Done.

    Regards,

    -RT

  5. Abhishek says

    I’m on goddady hosting, none of the 3 solutions worked for me.
    But some users reported .user.ini file worked for them in goddady.
    can anybody tell me where to put this file?
    I have tried root folder and wp-admin folder nothing worked.

  6. DVR says

    If you are hitting a wall. Go to your host. Advance setting for PHP. Scan the code looking for max upload & file size. Change it to your required setting.

    Done.

    See NICOLAS’ reply above.

    • martin kendall says

      Hi DVR I had tried everything and nothing worked, with what had been posted here. I tried multi times in every why to get it to work. Nothing, but your post put me on the correct answer. Thanks very much for that.
      Ok this is what i did, Signed into my host server, where my website is. the host server runs on cPanel and the theme is paper_lantern. It should not matter what your sever is or the theme. If you do not have access to this area you will have to get your host to make the changes y cotacting your technical help.
      In the panel you will have categories like = files, database, domains, email etc and what you are looking for is software, under software / apps look for multiPHP INI Editor or something like that. Its going to be different on other platforms but should be in that area. What you are looking for is configure PHP INI basic settings or editor mode. I got offered home directory or my domain name. I picked the domain name but maybe need to change both but I did not need to. Scrolled down to upload_max_filesize and changed to 64M but this did not work as you have to also change the momory_limit to 64M also. They have to be the same figure. and then it will work.
      Has I understand, when you make the changes in wordpress code. the instruction talk to your data base through the PHP files and instruct the server software to change the database settings. For some reason It would not work for me. So this route, bypass that and making the changes on the server software and not on the wordpress software. In future I will go this way as it was really quick. I hope this helps as a last resort. Martin p.s. this was WordPress 4.8.1 and I found that it did not have, after loading it any PHP.INI or .htaccess files. I did install them but made no difference and or where I put them.

  7. Gopi krishnan says

    For me, this is not working, but i did this in htaccess file in this way,

    php_value post_max_size 10M
    php_value upload_max_filesize 40M
    php_value memory_limit 500M

    This works !

  8. Michael Serovey says

    I have my websites hosted with GoDaddy and so far, NONE of the above suggestions have worked! I have paid for this plugin and now I that I wasted my money!

    • Paul says

      Hi,
      To avoid the plugin upload limit you can just upload the plugin with filezilla to your plugin directory. After uploading you can extract the zip file in the file manager and after you have done this the plugin is visible and ready to activate in your admin –> plugin panel

      Hope this helped.

      Cheers

      • Pooya says

        WOW! THANK YOU PAUL!!

        This worked perfectly for me!

        and it is MUCH easier and more reliable than any of those methods.

        just go to File Directory under the cPanel -> Public-html -> [ you site folder] -> wp-content ->themes or plugins

        Then upload the zip file here and extract it.

        login to your wp-admin dashboard. and bam, you got yourself the theme or plugin.

  9. Nicolas says

    Just go to your hosting control pannel -> Advanced -> PHP Settings -> upload_max_filesize ( it usually is on 2M you can change it up to 8M in my case… the point is that it shouldn’t be higher than your post_max_size)
    You are welcome!

  10. Steven Gliebe says

    functions.php is not the best place to put the code because raising the PHP max upload size limit is unrelated to a specific theme. Users shouldn’t be changing theme files directly anyway. wp-config.php is probably a better place. The .htaccess or php.ini method is even better (or just ask the host).

  11. Stephanie says

    php.ini needs to be in wp-admin folder. This article states it needs to be in the root, which I tried but it made no difference. FYI

    Thank you for the information!

  12. Matt says

    Worked Immediately! Thanks! By the way if anyone else wants to know, my host is BlueHost and I am using a Genesis Theme.

  13. Panagiotis Sakalakis says

    Using the .htaccess I got an Internal Error, and then I just removed the code and it fixed. After that, I created a php.ini file in /public_html/wp-admin, pasted the code and saved it. Everything’s work like a charm now and I can upload my files just fine without any problem.

  14. hol says

    Hi

    Does anyone know why if the PHP.INI file is changed as mentioned why when the file has completed to 100% nothing happens and it displays http error.

    I can upload small files and small videos.
    I cant upload anything bigger than say 200mb

    I had this working and accepting larger files then I had a restore done on website.

    I have changed the PHP.INI…

    Is there any reason why just large files don’t work ?

    do I need to edit the hta.access file ?

    thanks

  15. Ian says

    .htaccess method worked for Media Temple grid hosting, others didnt affect it, just in case anyones wondering…

  16. Jay says

    IF YOUR STILL FINDING NOTHING IS WORKING..
    (In my case the problem was with WP MULTISITES)..,

    FIRST CHECK THE FOLLOWING:
    1. check your hosting limits (although this was not my problem) make sure your hosting allows the limit you are trying to set ie if on a shared hosting you might find the maximum is 64M.

    NOTE: The following solution may also apply If in WordPress, Maximum upload file size will not change even when changed in the php.ini file etc.

    The 1M max upload problem lies with WP MULTISITES default settings!!

    To change this, do the following to change the Maximum upload file size within WP admin:

    LOG INTO YOUR ADMIN DASHBOARD:
    1. At the top, hover over My Sites and then click Network Admin.
    2. At the left, hover over Settings and then click Network Settings.
    3. Scroll to the bottom of the page and change the Max upload file size to whatever you would like in KB.
    4. Click Save Changes.

    Hope this helps :)

  17. AmanDeep Singh says

    Working !.I use Create or Edit an existing PHP.INI file method and after applying the settings as mentioned in the article now i am able to upload themes and plugins which are large in size.Thanks for sharing solution.

  18. Judy says

    I am new to WordPress, I usually use Joomla but I have a new client that wants a WordPress site. When trying to upload images the WordPress message was that the file limit was 3Mb. I spent hours searching websites for an answer. I am using WAMP and localhost to create the site. Through localhost phpinfo() I could verify which php.ini was active, the one in Apache. I had a file limit of 64Mb but still WordPress had a 3Mb limit. This site gave the instructions under #3 to edit the .htaccess file in the WordPress folder. I copied and pasted the text into this file and IT WORKED! Thank you wpbeginner.

  19. KenSanDiego says

    forgot to mention, my WP site is in a subdirectory with a domain pointer. Powweb’s php applies to everything in all subdirectories. So if you have any installations in subdirectories the change applies to all installations.

  20. Ugyen Zangmo says

    Create php.ini in wp-admin folder

    In the file put the following 3 lines:

    upload_max_filesize = 2048M
    post_max_size = 2048M
    max_execution_time = 3000

    Goto to your website as admin and check the upload new media page, it should now display Maximum upload file size: 2 GB.

    Thanks to Yasir Imran for sharing your tip!

    This worked for me. Thank you James for sharing the Yasir Imran tip. Cheers

    • Ben says

      Holy crap! Thanks so much man, after the last wordpress update to 4.3.1 my upload size reverted back to the default of 50 MB even though my php.ini, .htaccess, and wp-config.php files hadn’t changed and were still reflecting a max upload size of 512 MB! You’re a hero!

    • Alain says

      Thank you very much!
      I tried ALL of the three methods with no results.
      I asked the webhost and the raised the limit to 40 MB.
      Then, finally, I tried yours and it worked fantastically!

  21. dominio público says

    post_max_size should be larger than upload_max_filesize to allow room for other information. The defaults are 2MB max file size and 8MB max post size.

    From PHP’s documentation:

    post_max_size integer
    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.

  22. Dan says

    php.ini file worked perfectly for me. I simply changed the existing values to 100M. All good. Thanks for the advice.

  23. James says

    Create php.ini in wp-admin folder

    In the file put the following 3 lines:

    upload_max_filesize = 2048M
    post_max_size = 2048M
    max_execution_time = 3000

    Goto to your website as admin and check the upload new media page, it should now display Maximum upload file size: 2 GB.

    Thanks to Yasir Imran for sharing your tip!

  24. Markus Aurelius says

    Nothing of the above worked for me on GoDaddy so I had to use .user.ini instead of php.ini and that worked fine. Thanks for pointing me in the right direction!

  25. sam says

    1:- open „C:wampbinapacheapache2.4.9bin” folder and find „php” which is a configuration file and open it in ur notepad and again find „upload_max_filesize” and „post_max_size” and change both and save.

    2:- open „C:wampbinphpphp5.5.12” folder and find „php” and „phpforapache” which are configuration file and open both in ur notepad and again find „upload_max_filesize” and „post_max_size” and change both and save.

    3:- finally restart all services of wamp and enjoy…lov u all

  26. Decb says

    Hi Guys, I’m REALLY new to this but can you look at what I see when I click to edit the .htaccess file – where do i add the code? at the start? at the end? Do I put my cursor at the begining and click return (then put it in) ??? Please help

    • Gerard ONeill says

      Deb, it wouldn’t matter where you added it; but make sure its outside of a block. To be safe, just add it at the end.

      However, the better way (as of php5.5) is to modify the .user.ini file in a per directory basis. If you did the top level directory, it would apply to all sub directories (unless overridden).

      http://php.net/manual/en/configuration.file.per-user.php

      And obviously the system wide php.ini works too.

  27. BenPDX says

    +1 for Alex’s solution. Upload php.ini folder to wp-admin folder worked for me on Lithium Hosting. 30 second Google search and 1 min to create text file and upload to server!

  28. Vineesh says

    Hi alex, you are right. php.ini file should be added to wp-admin folder. It will work perfectly…. thanks alex

  29. Tony_atf says

    I keep getting http error even with your suggestion. im on godaddy I have filesize 300m but anything over 150Mb chokes. it uploads, sits for a few seconds and then the http error displays. wordpress never shows the error.

  30. Nitesh Magan says

    Hey I added the 1st code to my theme function file, but now everything on my site went blank. I cant even access my wp-admin of my site !!

    Please Help …

  31. Chris says

    If you’re just trying to upload files yourself in the admin panel (media), make a new plain text document, save it as whatever name (including extension) of the large file you’re trying to upload. So if you’re trying to upload „files.zip,” save a blank text document as files.zip. Upload this blank text file you just created in WordPress. Then, go to FTP or file manager, go to wp-content/uploads/(whatever year it is)/(whatever month it is). You should fine files.zip there. Delete that file (which is just a plain text file) then upload the real files.zip, making sure the names match up. Then when you go back to media it will be the right file.

  32. Yasir Imran says

    I tried htaccess method and found 500 internal server error, then placed php.ini with 3 given lines in root directory, again didn’t work. Then I placed it in wp-admin folder and it worked. I think the author should mention it.

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