Deseja aumentar o tamanho máximo de upload de arquivos no WordPress?
Às vezes, um limite baixo de tamanho de upload de arquivo pode impedi-lo de fazer upload de arquivos com o carregador de mídia ou de instalar plug-ins e temas maiores do WordPress.
Neste artigo, mostraremos como aumentar facilmente o tamanho máximo de upload de arquivos no WordPress para corrigir esses problemas.
Por que aumentar o tamanho máximo de upload de arquivos no WordPress?
Seu provedor de hospedagem WordPress definirá um tamanho máximo de upload de arquivo padrão quando você se inscrever e instalar o WordPress. Seu provedor de hospedagem define esse limite, que geralmente varia de 2 MB a 500 MB.
Para a maioria dos proprietários de sites WordPress, esse limite será mais do que suficiente.
No entanto, há ocasiões em que você precisará aumentar esse limite para não ter erros de upload.
Por exemplo:
- Você administra um site de fotografia e precisa fazer upload de imagens grandes.
- Seu portfólio de design ou fotografia tem imagens grandes.
- Você deseja instalar um tema ou plug-in maior do WordPress.
- Você deseja vender produtos digitais, como livros eletrônicos, fotos, vídeos e muito mais.
- Você atualiza regularmente o conteúdo e adiciona áudio, fotos e outros itens que estão além do limite atual.
Dito isso, vamos mostrar como você pode aumentar o tamanho máximo de upload de arquivos em seu site WordPress.
Observação: lembre-se de que a exibição de muitos arquivos grandes em seu site pode reduzir seriamente a velocidade e o desempenho dele. É por isso que normalmente recomendamos nunca fazer upload de vídeos para o WordPress.
Como a maioria dos usuários tem diferentes configurações de hospedagem do WordPress, abordaremos o seguinte:
- 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
Tutorial em vídeo
Se você preferir instruções por escrito, continue lendo.
Como verificar o limite máximo de tamanho de upload de arquivos no WordPress
O WordPress mostrará automaticamente o limite máximo de tamanho de upload de arquivos quando você estiver fazendo upload de imagens ou outras mídias.
Para verificar isso, basta ir para Mídia ” Adicionar novo no painel de administração do WordPress e você verá o limite máximo de tamanho de upload de arquivo para o seu site WordPress.
Agora que você sabe como encontrar o limite de tamanho, vamos mostrar como aumentar o tamanho máximo de upload no WordPress.
Método 1: Entre em contato com o provedor de hospedagem do WordPress
Uma das maneiras mais fáceis de aumentar o tamanho máximo de upload de arquivos no WordPress é entrar em contato com o provedor de hospedagem do WordPress.
Essa é uma tarefa relativamente simples para a equipe de atendimento ao cliente e pode ser feita em alguns minutos.
Para iniciantes, isso pode ser muito mais fácil do que adicionar código ao WordPress e editar arquivos do servidor.
Basta acessar o site do seu provedor de hospedagem, como a Bluehost, e fazer login.
Em seguida, clique no ícone “Chat” na parte inferior da tela. Em seguida, você pode solicitar à equipe de suporte que aumente o tamanho do upload de arquivos em seu site do WordPress.
Você também pode entrar em contato com o suporte no painel da sua conta de hospedagem.
Método 2: Criar ou editar um arquivo php.ini existente
Outra maneira de aumentar o tamanho máximo de upload de arquivos é criar ou editar um arquivo chamado php.ini. Esse arquivo controla várias configurações do seu ambiente de hospedagem do WordPress.
A maioria dos provedores de hospedagem WordPress, como a Bluehost, tem um cPanel amigável para iniciantes para ajudar a gerenciar seu site.
Se o seu host da Web tiver um painel cPanel, você poderá aumentar o tamanho do upload de arquivos por meio das ferramentas integradas.
Observação: o texto a seguir foi extraído do cPanel da Bluehost. No entanto, a maioria dos provedores de hospedagem compartilhada terá etapas semelhantes.
Você encontrará um botão do cPanel na parte inferior da guia Hosting na Bluehost.
Clicar nesse botão abrirá o painel do cPanel.
Agora você precisa rolar para baixo até a seção Software e clicar em ‘MultiPHP INI Editor’.
Em seguida, role para baixo até a seção denominada ‘upload_max_filesize’ e insira um novo tamanho máximo de arquivo na caixa.
Em seguida, clique no botão “Apply” (Aplicar).
Como alternativa, você pode clicar na guia do menu “Editor Mode” e alterar o tamanho máximo de upload de arquivos diretamente no editor.
É necessário editar a seção “upload_max_filesize” para aumentar o tamanho do upload do arquivo.
Quando terminar, basta clicar no botão “Salvar”.
Editar o php.ini adicionando código
Se o seu provedor de hospedagem atual não oferecer a opção cPanel, você precisará editar esse arquivo manualmente.
Para isso, você pode usar um cliente FTP ou a opção de gerenciador de arquivos no painel de controle da hospedagem do WordPress.
Se você estiver usando hospedagem compartilhada, talvez não veja o arquivo php.ini no diretório de hospedagem. Se não encontrar um, basta criar um arquivo chamado php.ini e carregá-lo em sua pasta raiz.
Em seguida, adicione o seguinte trecho de código ao arquivo:
upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 300
Você pode modificar o limite de “256M” para o tamanho de arquivo necessário para o seu blog do WordPress.
Método 3: Adicionar código ao arquivo functions.php do tema do WordPress
Esse método envolve a adição de código ao arquivo functions.php em seu tema do WordPress.
Em vez de editar o arquivo diretamente, recomendamos o uso do WPCode. É o melhor plug-in de snippets de código que permite adicionar código ao seu site sem danificá-lo.
Se você nunca fez isso antes, consulte nosso guia para iniciantes sobre como adicionar código personalizado no WordPress.
Primeiro, você precisa instalar o plug-in gratuito WPCode. Para obter mais detalhes, consulte nosso guia passo a passo sobre como instalar um plug-in do WordPress.
Após a ativação, você deve navegar até Code Snippets ” + Add Snippet. Você precisará passar o mouse sobre a opção “Add Your Custom Code” e, em seguida, clicar no botão “Use snippet”.
Na próxima tela, você precisa dar um nome ao seu novo snippet e alterar o tipo de código para “PHP Snippet”.
Em seguida, você pode copiar e colar o seguinte trecho de código em “Code Preview” (Visualização de código). Certifique-se de alterar “256M” para o tamanho máximo de arquivo que você precisa:
@ini_set( 'upload_max_size' , '256M' );
@ini_set( 'post_max_size', '256M');
@ini_set( 'max_execution_time', '300' );
Por fim, alterne a alternância na parte superior para “Active” (Ativo) e, em seguida, clique no botão “Save Snippet” (Salvar snippet). O código agora será executado em seu site.
Método 4: Adicionar código ao seu arquivo .htaccess
Outra maneira de aumentar o tamanho máximo do arquivo é modificar o arquivo .htaccess. Esse arquivo controla as definições de configuração de alto nível do seu site.
Para fazer isso, é necessário fazer login no servidor do site via FTP. Se você nunca fez isso antes, consulte nosso guia sobre como usar o FTP para fazer upload de arquivos no WordPress para iniciantes.
Depois disso, você precisa localizar o arquivo .htaccess na pasta raiz do seu site.
Se você não conseguir encontrar o arquivo .htaccess, ele pode estar oculto pelo gerenciador de arquivos ou pelo cliente FTP. Para saber mais, consulte nosso guia sobre por que você não consegue encontrar o arquivo .htaccess em seu site WordPress.
Em seguida, você precisa adicionar o seguinte trecho de código ao seu arquivo .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
Para aumentar ainda mais o tamanho máximo de upload de arquivos, basta alterar o valor “64M” para o tamanho desejado.
Método 5: Use um plug-in do WordPress para aumentar o tamanho do upload de arquivos
Outra maneira de aumentar o limite máximo de upload de arquivos é usar o plug-in WP Increase Upload Filesize. Se você não se sente à vontade para adicionar código ao WordPress, essa pode ser uma boa opção para você.
A primeira coisa que você precisa fazer é instalar e ativar o plug-in. Para obter mais detalhes, consulte nosso guia sobre como instalar um plug-in do WordPress.
Após a ativação, navegue até Mídia ” Aumentar limite de upload no painel de administração do WordPress.
Isso o leva a uma tela em que você pode selecionar um novo tamanho de upload de arquivo no menu suspenso ‘Choose Maximum Upload File Size’.
Em seguida, clique no botão “Save Changes” (Salvar alterações).
Observação: o tamanho máximo de upload de arquivos será definido pelo seu provedor de hospedagem. Se precisar de um limite de tamanho de arquivo maior do que o listado no menu suspenso, será necessário entrar em contato com o provedor de hospedagem e solicitar o aumento do limite.
Esperamos que este artigo tenha ajudado você a aumentar o tamanho máximo de upload de arquivos no WordPress. Talvez você também queira ver nosso guia sobre como escolher o melhor construtor de sites e nossas escolhas de especialistas dos melhores aplicativos de número de telefone comercial virtual com opções gratuitas.
Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.
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!
Abduaziz says
Thanks a lot!!! Method 3 worked for me
WPBeginner Support says
Glad our recommendation could help
Administrador
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.
WPBeginner Support says
Thanks for sharing what solved the problem for you
Administrador
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
Administrador
Mark says
This is the only solution that works on my shared hosting server. Thanks Ernesto!
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
Administrador
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.
Administrador
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.
Administrador
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
WPBeginner Support says
Glad our article could help
Administrador
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
Administrador
Pezza says
Great Stuff! .htaccess worked for me!
WPBeginner Support says
Thank you, glad our guide could help
Administrador
ReineR says
htaccess metod worked for me, thanks!
WPBeginner Support says
Glad our article could help
Administrador
Ahmed says
Work for me
3. htaccess Method
you need to click (show hidden files to view and edit this file).
WPBeginner Support says
Glad our article could help
Administrador
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
WPBeginner Support says
You would need to use FTP rather than WordPress itself to add the code: https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/
Administrador
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.
Administrador
Ivos G. says
None worked for me. But this one fixed it – add to your .htaccess this line:
LimitRequestBody 104857600
WPBeginner Support says
Thanks for sharing your solution for this issue
Administrador
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.
Editorial Staff says
Thank you for sharing this with us
Administrador
RAHUL says
That worked for me thanx
WPBeginner Support says
Glad our tutorial could help
Administrador
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?
Carl says
Very helpful, thank you!
Md. Rana says
The third option is worked for me.
WPBeginner Support says
Hey Rana,
Glad it worked out for you. Don’t forget to follow us on Facebook for more WordPress tips and tutorials.
Administrador
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.
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
Luis Felipe Lino says
Thanks.
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…
Joseph says
Thanks so much. The .htaccess file worked for me
John S says
Thanks so much. The .htaccess file worked for me!
Karina says
Thanks you so much!!! The .htaccess version worked for me
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!
Okimi Solomon says
Thanks a lot. The second option worked for me. God bless you
Benj says
Modifying .htaccess file worked for me. Thanks a lot..
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.
Kabelo says
Very helpful. Thanks very much.
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
Jessany says
I added the code into the .php functions folder, and now WordPress will not load. How do I fix this problem??
WPBeginner Support says
Hi Jessany,
You can delete the code you added by accessing your website via FTP or File Manager in cPanel.
Administrador
bala says
upload the above given code to .htaccess file it is working
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!
ZafB says
Thanks that worked perfect
Alissa says
Thank you for posting this! It worked great!
Alejandra says
Thanks a lot! That worked indeed!!
Paul Palmer says
Brilliant solution – worked perfectly and easily! Many thanks.
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.
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.
Stef Thoen says
You’re my hero. I’ve been researching this issue for way to long until I finally saw your post. Thanks so much.
Ron says
Thank you for this! This should be in the body of this article!
Hitesh L. says
WORKED! kudos to you!!!!!!!
Emanuel Pietri says
Method 3 – with .htaccess – works fine for me with theme
Stefanos Kargas says
Thanks!! I changed .htaccess file and it worked.
haadi says
hi. thanks a lot. the 3rd one worked for me
Jim R says
Option 2 worked good. Thanks for the info.
Tor Helge says
It worked when I did the last one with .htaccess
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.
WangTuanJie says
after 3 method, i couldn’t see success.
Mahadi says
Thanks man!! .htacces worked for me!
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
WPBeginner Support says
Hi Lynn,
Yes you need to add it to your theme’s functions.php file.
Administrador
Justin says
Yea, but where does it go in the functions.php. At the top, bottom, in the middle? Inside the “”
WPBeginner Support says
Hi Justin,
At the end.
jack says
thank you all those steps helped me
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
vikram says
HI
Do you use shared hosting
shahrin says
great! htaccess method work for me. I’m so relieve,guys! Thanks in advance
Samba Siva says
.htaccess method worked for me
nelson says
htaccess worked for me ,thank you
Sagar says
php.ini is worked for me.
cheers.
thnks man !!
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?
WPBeginner Support says
Hi Thomas,
You need to paste it at the end of your .htaccess file after the #END WordPress line.
Administrador