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

Nota editoriale: guadagniamo una commissione dai link dei partner su WPBeginner. Le commissioni non influenzano le opinioni o le valutazioni dei nostri redattori. Per saperne di più su Processo editoriale.

Volete aumentare la dimensione massima di uploader dei file in WordPress?

A volte un limite di dimensioni di upload basso può impedire l’upload di file con l’uploader dei media o l’installazione di plugin e temi WordPress più grandi.

In questo articolo vi mostreremo come aumentare facilmente la dimensione massima di uploader dei file 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 quando vi registrate e installate WordPress. Il fornitore di hosting definisce questo limite, che di solito varia da 2MB a 500MB.

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, fate clic sull’icona “Chat” nella parte inferiore dello schermo. Potete quindi chiedere al personale di supporto di aumentare le dimensioni di uploader dei file 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 interromperlo.

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. Ray Konopka says

    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 says

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

      Admin

  3. Mark says

    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 says

      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.

      Admin

  4. Muhammad Farooqi says

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

    • WPBeginner Support says

      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.

      Admin

  5. Abdullah Ashraf says

    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 says

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

      Admin

    • WPBeginner Support says

      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.

      Admin

  6. Ben says

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

    • WPBeginner Support says

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

      Admin

    • WPBeginner Support says

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

      Admin

  7. Ahmad says

    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 says

      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.

      Admin

  8. Vittorio says

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

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

    • WPBeginner Support says

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

      Admin

  9. Oliver says

    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 says

      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.

      Admin

  10. Asad says

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

    • WPBeginner Support says

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

      Admin

  11. Chris says

    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 says

      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

      Admin

  12. Janice says

    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?

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

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

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

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

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

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

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

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

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

  22. Ivos G. says

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

    LimitRequestBody 104857600

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

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.