Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coppa WPB
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

I nostri lettori ci chiedono spesso di aiutarli a correggere i problemi legati alle limitazioni di uploader dei file. Questa semplice impostazione del sito web può avere effetti inaspettati sul vostro sito.

Ad esempio, a volte un limite di dimensioni di upload basso può impedire di caricare file con l’uploader dei media o di installare plugin e temi WordPress più grandi. Questo può essere molto frustrante, soprattutto quando non si sa come modificare il limite.

In questo articolo vi mostreremo come aumentare facilmente la dimensione massima dei file caricati in WordPress per correggere questi problemi.

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:

Video tutorial

Subscribe to WPBeginner

Se preferite le istruzioni scritte, continuate a leggere.

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 dovrà navigare su Code Snippets ” + Add Snippet. È necessario passare del mouse sull’opzione “Aggiungi codice personalizzato” e poi fare clic sul pulsante “Usa snippet”.

Add a Custom Snippet in WPCode

Nello schermo successivo, è necessario dare un nome al nuovo snippet e cambiare il tipo di codice in “Snippet PHP”.

Quindi è possibile copiare e incollare il seguente frammento di codice in “Anteprima codice”. Assicurarsi di cambiare ‘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.

Speriamo che questo articolo vi abbia aiutato ad aumentare la dimensione massima dei file uploader in WordPress. Potreste anche voler consultare la nostra guida su come scegliere il miglior sito web builder e la nostra selezione di esperti delle migliori app per numeri di telefono aziendali virtuali con opzioni gratuite.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

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.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

406 commentiLascia una risposta

  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. Alexander Gartley says

    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.

  3. Ernesto says

    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 says

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

      Admin

  4. Tamir Davidoff says

    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 says

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

      Admin

  5. rajesh says

    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 says

      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.

      Admin

  6. Adam Walsworth says

    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 says

      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.

      Admin

  7. Rafiq khan says

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

  8. Carla says

    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 says

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

      Admin

  9. rahul says

    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

  10. Ephraim says

    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 says

      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.

      Admin

  11. Ivos G. says

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

    LimitRequestBody 104857600

  12. Achilleas says

    I am using Nginx and i had already setup properly the values for php in the php.ini but what fixed it was puting the same value in the server block with the variable client_max_body_size xxxM;

    I am writing this hoping it will help someone.

  13. Adriana Sabo says

    None of the options worked for me. Nothing happened when I tried the first two, and the last one prompted an error 500. Any way you can help?

  14. Tom Allen says

    The above explanation is fine for hosted sites, bit what about us guys that locahost? I still can figure out the “upload_max_filesize” error when downloading Updfaftplus from WP Plugins or from a download zip file. I am a beginner and need hand-holding through this process. Help is appreciated.

  15. crystal says

    hta access worked.
    you guys must put the code before #END WordPress
    if you put after #end wordpress then site goes to 500 internal server error in my experience with godaddy hosting

  16. Jaime Lopes says

    On most of the shared cPanel sites I’ve setup:

    -changing .htaccess brings the whole site down (500 internal error)
    -adding php.ini or php5.ini files does nothing
    -there is no option to choose ‘Site Software’ in cPanel…

  17. Megan says

    Thank you! This was a huge help! I couldn’t even upload plugins because my limit was pre-set at 2MB…Now I’ve got it to 64MB and am able to work.
    Thanks!

  18. Martin Croker says

    On vidahost (now TSOhost).

    Adding the following php.ini worked for me… however (and I’m still a bit confused why), just putting it at http root didn’t work – I had to duplicate the php.ini file inside wp-admin and wp-include directories within wordpress.

  19. Dwayne S says

    I’m on HostGator and currently having issue with max execution time. It occurred a few weeks ago and HostGator support fixed the issue. It now reappeared and support is telling me that they can’t fix it because I’m on shared server. The agent even crashed my site by manually editing the htaccess file and didn’t verify if it was working or not. He did however recommend a plugin that would edit the htaccess file with code to increase the limit but it doesn’t work. I guess HostGator blocks it

  20. Jessany says

    I added the code into the .php functions folder, and now WordPress will not load. How do I fix this problem??

  21. Caleb says

    I have GoDaddy hosting and contacted them to help me increase my file upload size. It was a piece of cake — I didn’t have to create any files, add code to my theme, or anything like that. So for those of you who have GoDaddy or cPanel type controls, forget hacks and just use your admin settings.

    Here’s what support had me do:
    1. Go to your cPanel Admin (a similar hosting panel ‘might’ work somewhat the same)
    2. Scroll down to the ‘Software’ and click on ‘Select PHP Version’
    3. Click on ‘Switch to PHP Options’ in the top right And TADA! There’s all your PHP Options!
    4. Just go down and change the ‘post_max_filesize’ and ‘upload_max_filesize’ to whatever you want, apply and save your changes, and you’re now a safe and happy non-coding website owner.

    Good luck!

    • Rich Perozich says

      This worked for me but in order to even find these files, I had to call godaddy where I was walked through these steps or I never would have been able to navigate to the cpanel Admin without their help.
      1. Sign on to godaddy
      2. Click on my products upper left
      3. Under web hosting click manage all
      4. Click web hosting with C panel
      5. Click C panel Admin icon
      6. Scroll down to Software and click Select php version
      7. Click on switch to php options
      8. At bottom of page click on the number upload_max_filesize and select # you wish as the max filesize
      9. Click apply. It works. Now file sizes can be uploaded to the selected max.

  22. Chris Sandford says

    Multisite Users:
    If your a dumb dumb like me, you may have tried everything to no avail.
    Don’t forget if you’re using WordPress Multi-site, to change the upload settings for individual sites.
    Network Admin > Settings > Max upload file size

    You may still need to use the tips in this article, but without changing the upload settings for multi-site, you won’t know if it’s working.

  23. mara says

    Anyone on here get this to work with Godaddy? There are very unhelpful. I know I need to create the php.ini file, (and I did), but none of the solutions you posted worked. Any help is appreciated.

  24. Lynn says

    Wish you wouldn’t assume everyone looking for this solution knows what you mean by our “Theme Functions File” – do you mean functions.php? I’m not an expert, and I’m really good at following precise directions, and don’t want to even put a toe in the water of editing files if I don’t know EXACTLY what file you’re talking about! No clues were provided, like what other code I might look for in the file to know I’m in the right place, etc. So…this didn’t help me at all :-(

  25. Alex says

    Thank you, method 3 really worked for me
    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 300

  26. Mituka says

    This worked for me.

    Open your .htacess file with notepad.

    Skip everything you see and at the bottom.

    Paste the following and save.

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

    • Thomas says

      Where exactly did you paste it?

      # BEGIN WordPress

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

      # END WordPress

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

      Is it before the #END WordPress statement? ( I get error when I do that)

      Or should it be after the #END WordPress statement?

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.