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 am unable to import my blogger exported xml file to wordpress.
    My blogger imported xml file size is 24 mb.
    Please solve this problem, i shall be thankful to you.

  2. Has anyone ever told you that the copy and paste YOUR code all throughout your site always has the:

    1: code
    2: code
    3: code

    So it’s a bit of a edit to get it to work right when a simple copy/paste would be stressfree for your readers! Just sayin…

    • Thanks! This is the only thing that worked for me. Worth noting, I already had a php5.ini file in there w/ the same code, it did nothing. A tad confusing.

  3. After 2 hours of frustration, the htaccess method mentioned here worked out for my local environment.

    Thank you very much. :)

  4. I change my .htaccess and put

    php_value memory_limit 2G
    php_value upload_max_filesize 2G
    php_value post_max_size 2G
    php_value max_execution_time 99999
    php_value max_input_time 99999

    when I go for upload a fine it shows 2GB but when I upload any file that larger then 128MB it shows HTTP error. Need help please.

    Thanks

  5. I add on my .htaccess

    php_value memory_limit 2G
    php_value upload_max_filesize 2G
    php_value post_max_size 2G
    php_value max_execution_time 99999
    php_value max_input_time 99999

    and it shows 2GB but when I upload larger then 128M file it gives me HTTP error. can anyone help me please.

    Thanks

  6. I DO NOT recommend putting that code in the Theme Functions file. I tried it and it completely blew up my site. And if you don’t know how to use FTP or the File manager to change the Functions file BACK, you’ll be very unhappy. I haven’t tried the other options but if I find something that works I’ll let you know :)

    • Hello Elisabeth,ive tried it and it has also blown up my site,i cant acces it…may i please know how you fixed it?

  7. Just contacted godaddy. I am using cpanel hosting through them. He added a file .user.ini in the public/html file with the following:

    memory_limit = 128M
    max_execution_time = 300
    post_max_size = 128M
    upload_max_filesize = 256M

  8. I heard as an alternative you could just directly upload via the ftp cpanel, but when I do that the PDF does not show up in my WP media dashboard?

    • Hi Cornelius,

      You can upload a PDF file but yes you are right it will not be visible in the Media library on your WordPress site. To see a file in the media library and be able to easily add it, you would need to upload it using the built in media uploader.

      Admin

      • You can upload anything via FTP/SFTP and then add it to the database using a plugin like Add From Server.

  9. This worked for me (as nothing else would):

    – Open wp-config.php
    – At the very bottom add this line:

    define(‘WP_MEMORY_LIMIT’, ‘128M’);

    – Save (and upload your file)

  10. So i’m not a developer so i dont feel like messing with php and some functional stuff.
    i found from a post above php settings and all is set right, max file size is 30MB so i’m confused why i still can’t upload media bigger than 5mb.
    is there a wordpress thing that i’m missing
    i didn’t find anywhere place to change that,

  11. If you are using cPanel most of the time you edit via the PHP Version settings, you can check if you are on 5.6 or 7.0 and edit all the settings via cpanel. For me this is the only way my host has all the others locked down, but its real handy and there are simple ways to enable PHP modules and tweak any setting.

  12. Thanks.

    This is what finally worked for me:

    In wp-config, before wp-settings:

    define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
    define( ‘WP_MAX_MEMORY_LIMIT’, ‘256M’ );
    ini_set( ‘memory_limit’, ‘256M’ );

    In .htaccess:

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

  13. Hello

    I am building a woocommerce store for selling audio files. Some of my files are over 100MB so uploading straight from wordpress wont work. What I am trying to do is Upload the file to cpanel and than post that link in the downloadable product on WP. But I dont know how to do it. I view the file in cpanel and copy that link but that just takes the person to cpanel login. I dont know hot to get the link of my file in cpanel so others can download it when they buy a product?

    Do you have a tutorial on this?

    or can you help?

    Thanks

    • You would need to look more into this because you would need security for that file url, generally the file url is accessible to everything and therefore can be downloaded without making a purchase.

  14. Absolutely DO NOT try to enter that code into the Theme Functions file!!!!! Now I am getting error messages and can’t get to the dashboard for my site. I won’t DARE try any of their other suggestions.

  15. Thanks. the .htaccess version worked for me. I just had to remember to show hidden files in my cpanel file manager.

  16. Just wanted to say thanks. I’ve been able to solve three wordpress related issues in one day, all with help from this website. Kudos on the good work. :D

  17. Thanks.
    The php.ini edits helped. I had to make sure to also up the post_max size as well. I failed to edit this on first update, and nothing changed. Edit all parameters and presto. Thanks again!

  18. It was great. Very helpful! Had to upload a theme, used the second method. added a ner php.ini file and the theme is installed. Thanks a lot :)

  19. Thanks for helping

    making the changes in the .htaccess method made the website crash
    however changing the php.ini file worked for me.

  20. or try another method like mine,

    on cpanel > click the “select php version” > then click “switch to php options” > find the “upload_max_filesize” then change it whatever you want.

  21. ‘upload_max_size’ is not a php.ini variable name. it’s ‘upload_max_filesize’. that’s stated wrong in solution 1

  22. I tried your first suggestion, and apparently threw some bad code into the functions.php file and now I have lost access to my website’s dashboard, the actual website cannot be accessed by anyone, and the problem is obviously not solved.

  23. Hi, where i should put that code to my .htaccess file.
    I have tried put this code to my htaccess file but it always 500 internal server error when i open my live site.

    # BEGIN WordPress

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

    php_value max_input_vars 5000
    php_value max_execution_time 300
    php_value post_max_size 50M

    # END WordPress

    • Try this:

      php_value upload_max_filesize 50M
      php_value post_max_size 50M
      php_value max_execution_time 300
      php_value max_input_time 300

  24. Hi,

    I have used the first method of adding code to child theme functions.php file, but it does not have the desired effect. In localhost, the limit is 3 MB and in shared server, the limit is 32 MB. Any idea why it is happening so?

    Thanks.

  25. i have followed this even contacted my host increased my uploads to 64mb however in wordpress it still only allows 8mb.
    any other suggestions please help.

  26. Same problem for wordpress 3.9 / 4 version and having a look to Chrome console or firefox I saw an error 413 of NGINX when uploading

    Maybe this thread can help to nginx users ;)

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.