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

Come aumentare la dimensione massima di uploader dei file in WordPress

Avete mai provato a caricare un file sul vostro sito WordPress e vi siete scontrati con un muro di mattoni? È molto frustrante quando non si riesce a caricare l’immagine, il plugin o il tema di cui si ha bisogno. I nostri lettori ci chiedono spesso aiuto per i problemi di uploader dei file, perché possono portare il vostro flusso di lavoro a uno stallo.

A volte, questi limiti di uploader possono inaspettatamente impedirvi di aggiungere contenuti alla vostra libreria dei media o di installare i plugin e i temi più grandi di cui avete bisogno. È come essere bloccati con le mani legate. Ed è ancora più fastidioso quando non si sa come correggerlo!

Ma non preoccupatevi, siamo qui per aiutarvi. Ci piace che WordPress sia una piattaforma così configurabile e spesso ci sono più modi per risolvere lo stesso problema.

In questa guida vi mostreremo i modi più semplici per aumentare la dimensione massima dei file caricati in WordPress. Vi faremo superare queste limitazioni in modo che possiate tornare a fare ciò che amate: gestire il vostro sito web!

How to increase the maximum file upload size in WordPress

Perché aumentare la dimensione massima di uploader dei file in WordPress?

Il vostro fornitore di hosting WordPress imposterà una dimensione massima predefinita per l’uploader dei file al momento dell’iscrizione e dell’installazione di WordPress. Il fornitore di hosting definisce questo limite, che di solito varia da 2 MB a 500 MB.

Per la maggior parte dei proprietari di siti web WordPress, questo limite sarà più che sufficiente.

Tuttavia, a volte è necessario aumentare questo limite per evitare errori di uploader.

Ad esempio:

  • Gestite un sito web di fotografia e avete bisogno di caricare immagini di grandi dimensioni.
  • Il vostro portfolio di design o di fotografia contiene immagini di grandi dimensioni.
  • Si vuole installare un tema o un plugin per WordPress più grande.
  • Volete vendere prodotti digitali come eBook, foto, video e altro ancora.
  • È normale aggiornare i contenuti e aggiungere audio, foto e altro ancora oltre il limite attuale.

Detto questo, vi mostriamo come potete aumentare la dimensione massima di uploader dei file sul vostro sito WordPress.

Nota: tenete presente che la visualizzazione di molti file di grandi dimensioni sul vostro sito web può seriamente ridurne la velocità e le prestazioni. Per questo motivo, in genere raccomandiamo di non caricare mai video su WordPress.

Poiché la maggior parte degli utenti ospita configurazioni diverse di WordPress, copriremo quanto segue:

Come controllare il limite massimo di uploader dei file in WordPress

WordPress mostra automaticamente il limite massimo di dimensione dei file da caricare quando si caricano immagini o altri media.

Per verificarlo, basta andare su Media ” Aggiungi nuovo nel pannello di amministrazione di WordPress e si vedrà il limite massimo di uploader dei file per il sito WordPress.

Check current file upload size limit

Ora che sapete come trovare il limite di dimensione, vi mostriamo come aumentare la dimensione massima di uploader in WordPress.

Metodo 1: Contattare il fornitore di hosting WordPress

Uno dei modi più semplici per aumentare la dimensione massima di uploader dei file in WordPress è quello di contattare il fornitore di hosting di WordPress.

Si tratta di un’operazione relativamente semplice per il team del servizio clienti, che può essere eseguita in un paio di minuti.

Per i principianti, questo può essere molto più facile che aggiungere codice a WordPress e modificare i file del server.

È sufficiente collegarsi al sito web del proprio fornitore di hosting, come Bluehost, e accedervi.

Quindi, fare clic sull’icona “Chat” nella parte inferiore della schermata. Potete quindi chiedere al personale di supporto di aumentare la dimensione dei file caricati sul vostro sito WordPress.

Clicking the Bluehost live chat support button in the dashboard

È possibile contattare l’assistenza anche dalla Bacheca del proprio account di hosting.

Metodo 2: Creare o modificare un file php.ini esistente

Un altro modo per aumentare la dimensione massima dei file da caricare è creare o modificare un file chiamato php.ini. Questo file controlla molte impostazioni dell’ambiente che ospita WordPress.

La maggior parte dei fornitori di hosting WordPress, come Bluehost, dispone di un cPanel facile da usare per i principianti che aiuta a gestire il sito web.

Se il vostro host web ospita una Bacheca cPanel, potete aumentare la dimensione dell’uploader dei file attraverso gli strumenti integrati.

Nota: quanto segue è tratto dal cPanel di Bluehost. Tuttavia, la maggior parte dei fornitori di hosting condivisi prevede passaggi simili.

Il pulsante cPanel si trova in fondo alla scheda Hosting di Bluehost.

Open cPanel in Bluehost

Facendo clic su questo pulsante si apre la Bacheca di cPanel.

Ora è necessario scendere nella sezione Software e fare clic su ‘MultiPHP INI Editor’.

MuliPHP INI Editor in Bluehost's cPanel

Quindi, scorrere giù fino alla sezione etichettata “upload_max_filesize” e inserire una nuova dimensione massima dei file nel boxed.

Quindi, fare clic sul pulsante “Applica”.

Upload Max Filesize Setting

In alternativa, fate clic sulla scheda di menu “Modalità editore” e potrete modificare la dimensione massima dei file da caricare direttamente nell’editor.

È necessario modificare la sezione ‘upload_max_filesize’ per aumentare le dimensioni dei file da caricare.

Una volta terminato, fate clic sul pulsante “Salva”.

Change max upload filesize in code editor

Modificare php.ini aggiungendo codice

Se il vostro attuale fornitore di hosting non offre l’opzione cPanel, dovrete modificare questo file manualmente.

Per farlo, potete utilizzare un client FTP o l’opzione di gestione dei file nel pannello di controllo del vostro hosting WordPress.

Se si utilizza un hosting condiviso, è possibile che non si veda il file php.ini nella directory dell’hosting. Se non lo si vede, è sufficiente creare un file chiamato php.ini e caricarlo nella cartella principale.

Quindi, aggiungere al file il seguente frammento di codice:

upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 300

È possibile modificare il limite di ‘256M’ in base alla dimensione dei file necessaria per il proprio blog WordPress.

Metodo 3: Aggiungere il codice al file functions.php del tema WordPress

Questo metodo prevede l’aggiunta di codice al file functions.php del tema WordPress.

Invece di modificare direttamente il file, si consiglia di utilizzare WPCode. È il miglior plugin per gli snippet di codice che permette di aggiungere codice al sito web senza romperlo.

Se non l’avete mai fatto prima, consultate la nostra guida per principianti su come add-on il codice personalizzato in WordPress.

Per prima cosa, è necessario installare il plugin gratuito WPCode. Per maggiori dettagli, consultate la nostra guida passo-passo su come installare un plugin di WordPress.

Dopo l’attivazione, si deve navigare in Code Snippets ” + Add Snippet.

Si dovrà passare il mouse sull’opzione “Aggiungi codice personalizzato (nuovo snippet)” e cliccare sul pulsante “+ Aggiungi snippet personalizzato”.

Add new snippet

Successivamente, è necessario scegliere “PHP Snippet” come tipo di codice dall’elenco di opzioni che appare.

Select the PHP snippet option

Nella schermata successiva, inserire un nome per il nuovo snippet, che può essere qualsiasi cosa che aiuti a ricordare a cosa serve il codice.

Quindi, è possibile copiare e incollare il seguente frammento di codice sotto “Anteprima codice”. Assicurarsi di modificare ‘256M’ con la dimensione massima del file desiderata:

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

Infine, spostare l’interruttore in alto su “Attivo” e fare clic sul pulsante “Salva snippet”. Il codice verrà ora eseguito sul sito web.

Metodo 4: Aggiungere codice al file .htaccess

Un altro modo per aumentare la dimensione massima dei file è modificare il file .htaccess. Questo file controlla le impostazioni di configurazione di alto livello del sito web.

Per farlo, è necessario effettuare l’accesso al server del sito web tramite FTP. Se non l’avete mai fatto prima, consultate la nostra guida su come usare l’FTP per l’uploader dei file su WordPress per i principianti.

Successivamente, è necessario individuare il file .htaccess nella cartella principale del sito web.

Open .htaccess file

Se non riuscite a trovare il vostro file .htaccess, potrebbe essere nascosto dal vostro file manager o client FTP. Per saperne di più, consultate la nostra guida sul perché non riuscite a trovare il file .htaccess sul vostro sito WordPress.

Successivamente, è necessario aggiungere il seguente frammento di codice al file .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

Per aumentare ulteriormente la dimensione massima dei file da caricare, è sufficiente modificare il valore ’64M’ con la dimensione desiderata.

Metodo 5: utilizzare un plugin di WordPress per aumentare le dimensioni dell’uploader dei file

Un altro modo per aumentare il limite massimo di upload dei file è utilizzare il plugin WP Increase Upload Filesize. Se non vi sentite a vostro agio nell’aggiungere codice a WordPress, questa potrebbe essere una buona opzione per voi.

La prima cosa da fare è installare e attivare il plugin. Per maggiori dettagli, consultate la nostra guida su come installare un plugin di WordPress.

Dopo l’attivazione, andare su Media ” Aumenta limite di uploader nel pannello di amministrazione di WordPress.

Si accede così a uno schermo in cui è possibile selezionare una nuova dimensione per l’uploader dei file nel menu a discesa “Scegli la dimensione massima del file caricato”.

Quindi, fare clic sul pulsante “Salva modifiche”.

Increase file upload size with plugin

Nota: la dimensione massima dei file da caricare è stabilita dal fornitore di hosting. Se avete bisogno di un limite di dimensioni dei file superiore a quello elencato nel menu a discesa, dovete contattare il vostro fornitore di hosting e chiedere di aumentare il limite.

Video tutorial

Se non vi piace seguire le istruzioni scritte, potete consultare il nostro video tutorial:

Subscribe to WPBeginner

Speriamo che questo articolo vi abbia aiutato ad aumentare la dimensione massima dei file caricati in WordPress. Potreste anche consultare la nostra guida su come add-on per caricare altri tipi di file in WordPress e la nostra selezione di plugin e suggerimenti per migliorare l’area di amministrazione di WordPress.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e 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.

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

405 commentiLeave a Reply

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

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

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

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

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

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

  6. 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 !

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

    • 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

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

  8. 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!

  9. 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).

  10. 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!

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

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

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

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

  15. 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 :)

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

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

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

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

    • 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!

    • 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!

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

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

  22. 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!

  23. 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!

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

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

  26. +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!

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

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

  29. 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 …

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

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

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.