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!

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:
- How to Check Your Maximum File Upload Size Limit in WordPress
- Method 1: Contact Your WordPress Hosting Provider
- Method 2: Create or Edit an Existing php.ini file
- Method 3: Add Code to Your WordPress Theme functions.php File
- Method 4: Add Code to Your .htaccess File
- Method 5: Use a WordPress Plugin to Increase File Upload Size
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.

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.

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

Facendo clic su questo pulsante si apre la Bacheca di cPanel.
Ora è necessario scendere nella sezione Software e fare clic su ‘MultiPHP INI Editor’.

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

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

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:
1 2 3 | 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”.

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

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:
1 2 3 | @ ini_set ( 'upload_max_size' , '256M' ); @ ini_set ( 'post_max_size' , '256M' ); @ ini_set ( 'max_execution_time' , '300' ); |

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.

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:
1 2 3 4 | 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”.

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:
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.
Manish
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.
Hashim
3. htaccess Method worked for me.
Thanks
John
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…
John Delaney
Create php.ini file and place it in wp-admin folder, not the root. Fixes it every time.
Michael Kelley
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.
Mudassar
htaccess worked
Robert
After 2 hours of frustration, the htaccess method mentioned here worked out for my local environment.
Thank you very much.
Robin
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
Zain Zaheer
Set max limit to 128M instead of 2G
Robin
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
Elisabeth Parker
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
kennedy Odhiambo
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?
Caki
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
razib ahmed
thank you so much! it,s working for me
Tino
I’m with Axxess and this also worked for me!
Mukhiiii
You made my day!
Thanks
Paul Vijay
Thanks a lots this Worked for me . I too use Godaddy Hosting, Still the Template fails to load from Online database can u help
Bob
do you name it .user.ini or user.ini ??
Jesse
This method worked for me! Thank you so much for sharing!!!
Craig
in the .htaccess solution, where in the file do you enter the code, i put it at the end and got a 500 error?
Cornelius
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?
WPBeginner Support
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
Christopher Eller
You can upload anything via FTP/SFTP and then add it to the database using a plugin like Add From Server.
Nitus
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)
Maja
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,
Niall Flynn
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.
yaser
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
mohammad
thanks man you made my day it worked
Evan Olsen
This worked for me! Thank you!
Rudrax
Thanks Friend It Worked!
Yna Capumpue
How do you get to the wp-config? I mean where do you input the code itself? Thanks.
maneesh naithani
made my day. thank you man.
Rahadian
Thank you for this valuable post, .htaccess method works for me
Abhishek
Thanx a lot php.ini option works thanx a lot
Sean
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
Ian
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.
Larry Scott
The second suggestion of creating a php.ini file works like a charm.
john
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.
WPBeginner Support
Hi John,
You can easily edit your functions.php file using an FTP client to undo the changes you made.
Admin
Fred Preston
Thanks. the .htaccess version worked for me. I just had to remember to show hidden files in my cpanel file manager.
John
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.
WPBeginner Support
Thanks John
Don’t forget to join us on Twitter for more WordPress tips and tutorials.
Admin
Shameer
Very HelpFull
David
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!
Alyse
Is there a specific place to add it in the theme functions file? The beginning? The end?
Shambo
Modifying .htaccess file worked for me. Thanks a lot..
Celal Erdogdu
It works, thank you.
WPBeginner Support
You are welcome
Admin
Bentham
Thank you so much ,option one gave me a hint
Mohsin
.htaccess method worked for me. Thanks for this article.
Aswani Somarajan
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
John
Thanks for helping
making the changes in the .htaccess method made the website crash
however changing the php.ini file worked for me.
Don
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.
Aoun
Thanks…… Its very helpful and working perfectly
Jose
Thnxs dude, you saved my job
Md Robiul Islam
Thanks you so much… for your comment I fix my issue after try long time.. thanks a lot…..
Miaka
The methods in the article didnt work for me but this did! Thank you so so much, Don! Article author, hope you could edit this method as one of the solutions in your article!
DAVID
@DON Thank you!
Rudi
Thank you so much, I used the htaccess Method and it’s worked for me.
bob hildegard
‘upload_max_size’ is not a php.ini variable name. it’s ‘upload_max_filesize’. that’s stated wrong in solution 1
Eric
First thing I tried was modifying the .htaccess file. Worked for me!
sumit
thanks a ton , u saved me
Reza
htaccess option returns a 500 Internal Server error when reloading my website and wp admin
kashyapkumbhani
sir i Tried all But my Xml File Not Imported Please Help me:) thank u
Trevor
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.
WPBeginner Support
Please see our guide on what to do when you are locked out of the admin area.
Admin
Aakarshit
None of then worked ; (
Even contacted the hosting provider, no reply from them ; (
frizzy lee
thanks .. the htacess method worked for me too .. thumbs up bro
Okie Wardoyo
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
John Jones
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
Jitender Singh
.htaccess works nicely.
subodeep ray
thanks .htaccess works smoothly
Bukunmi
Where exactly do I put those codes in my Theme function? because i’m kind of lost
Galuh Prasetyawan
in Appearance -> editor, find function.php
Eóin Kilroy
Right, but where exactly in the function file?
Manas Mitra
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.
Bouguezzi
the .htaccess modification methode worked with me
thx a lot
WPBeginner Support
Glad you found it useful. Make sure you follow us Facebook to get more WordPress tips.
Admin
cathy belyea
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.
Guillermo
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