Suas postagens do WordPress estão retornando um erro 404 em seu site?
Esse erro ocorre quando você consegue acessar a área de administração e o blog do WordPress, mas, ao tentar abrir uma postagem, verá a mensagem “404 Not Found”.
Neste artigo, mostraremos a você como corrigir posts do WordPress que retornam erros 404.
Por que meus posts do WordPress estão retornando um erro 404?
Há vários motivos pelos quais seus posts do WordPress podem estar exibindo o erro 404 “Página não encontrada”. Esses motivos podem incluir:
- Conflitos de plugin ou tema: Às vezes, os plug-ins ou temas que você instalou em seu site podem interferir na forma como o WordPress lida com os permalinks. Isso pode levar a links quebrados e erros 404.
- Problemas de código personalizado: Se você adicionou código personalizado ao seu site, pode haver erros no código que estejam afetando os permalinks ou causando outros conflitos, resultando em erros 404 para suas postagens.
- Problemas com seu arquivo .htaccess: O arquivo .htaccess desempenha um papel importante na forma como o WordPress estrutura os URLs. Se esse arquivo estiver corrompido ou ausente, poderá resultar em erros 404 para suas publicações.
Dito isso, vamos dar uma olhada em como corrigir posts do WordPress que retornam erros 404. Você pode usar os links abaixo para ir direto às diferentes soluções:
Não quer corrigir erros 404 por conta própria? O WPBeginner Pro Services pode ajudar! Com o nosso Suporte de emergência para WordPress acessível, você pode contratar especialistas para corrigir erros 404, links quebrados, problemas de redirecionamento e muito mais. Pare de se estressar com os problemas do WordPress e resolva-os! Agende hoje mesmo os serviços de suporte emergencial para WordPress!
Tutorial em vídeo
Se você preferir instruções por escrito, continue lendo.
Método 1: Verifique se há conflitos de plug-ins ou temas e problemas de código personalizado
Às vezes, plugins, temas ou códigos personalizados que você adicionou ao seu site WordPress podem interferir nos permalinks ou causar conflitos, levando a erros 404. Nós mesmos já passamos por isso quando testamos ferramentas em nosso site de demonstração.
Uma maneira de resolver esse problema é desativar temporariamente os plug-ins. Às vezes, os plug-ins podem atrapalhar a maneira como o WordPress lida com os links.
Depois de desativar os plug-ins, você pode reativá-los um a um e verificar se o erro 404 reaparece após a ativação de cada plug-in. Se o erro aparecer após a ativação de um plug-in específico, ele pode ser o culpado.
Em seguida, você pode procurar soluções relacionadas a esse plug-in ou entrar em contato com o desenvolvedor do plug-in para obter suporte.
Da mesma forma, seu tema do WordPress pode estar causando o conflito.
Para verificar, você pode mudar temporariamente para um tema padrão do WordPress, como Twenty Twenty-Three ou Twenty Twenty-Four. Tudo o que você precisa fazer é acessar Appearance “ Temas e clicar em “Ativar” em um tema padrão.
Se o erro 404 desaparecer com o tema padrão, isso indica um possível conflito com seu tema atual. Você pode tentar solucionar o problema com o tema ou considerar o uso de um tema diferente.
Você pode dar uma olhada em nossa seleção de especialistas dos temas mais populares do WordPress para obter recomendações.
Se você inseriu recentemente trechos de código em seu site, pode haver erros no código que estão causando os erros 404. Dê uma olhada no código que você adicionou e veja se consegue identificar algum erro.
A maneira mais segura de adicionar trechos de código ao WordPress é com o plug-in WPCode. Esse plug-in permite que você insira código personalizado sem trabalhar diretamente com os arquivos do tema, reduzindo o risco de danificar seu site.
Além disso, sempre que o WPCode detectar um erro no seu código, ele desativará automaticamente o snippet e solicitará que você o verifique. Você também pode usar o modo de teste para verificar se o código funciona antes de colocá-lo no site ativo.
Se nenhuma dessas soluções funcionar, passe para o próximo método, no qual solucionaremos os problemas de suas configurações de permalink.
Método 2: Corrigir suas configurações de link permanente
Os posts do WordPress podem retornar erros 404 devido a problemas com regras de reescrita em seu arquivo .htaccess. Na maioria dos casos, você pode corrigir o problema atualizando suas configurações de permalink.
Basta acessar Configurações ” Permalinks em seu administrador do WordPress e clicar no botão “Salvar alterações”.
Não há necessidade de fazer alterações nas próprias configurações de permalink. Isso atualizará suas configurações de permalink e liberará as regras de reescrita.
Na maioria dos casos, essa solução corrige o erro 404 dos posts do WordPress. No entanto, se não funcionar para você, provavelmente precisará atualizar o arquivo .htaccess manualmente.
Método 3: Atualizar o arquivo .htaccess do WordPress
Antes de começar, certifique-se de fazer o backup do arquivo .htaccess do WordPress. Se algo der errado, você poderá restaurar facilmente o arquivo original.
Agora, você precisará se conectar ao seu servidor usando um cliente FTP como o FileZilla ou o aplicativo File Manager no painel de hospedagem do WordPress.
Em seguida, você precisará localizar e editar o arquivo .htaccess, que está localizado no mesmo local que pastas como /wp-content/ e /wp-includes/.
Basta clicar com o botão direito do mouse no arquivo e selecionar “File permissions” (Permissões de arquivo).
Você pode tornar o arquivo gravável alterando suas permissões para 666.
Basta digitar “666” na caixa “Valor numérico” e clicar em “OK”.
Em seguida, você precisa repetir as etapas do primeiro método do nosso tutorial. Depois de fazer isso, não se esqueça de alterar as permissões de volta para 660.
Você também pode editar o arquivo e adicionar código a ele.
Depois de abrir o arquivo .htaccess com um editor de texto, basta inserir este código:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Método 4: Entre em contato com o provedor de hospedagem
Se nenhuma das soluções acima tiver corrigido o erro de retorno 404 dos posts do WordPress, recomendamos entrar em contato com o provedor de hospedagem do WordPress. Pode haver um erro do lado deles ou eles podem ajudá-lo a solucionar o problema.
Consulte também nosso guia sobre como solicitar corretamente o suporte do WordPress e obtê-lo.
Método 5: Corrigir posts do WordPress que retornam erro 404 em servidores locais
Se estiver usando um servidor local para fins de teste, será necessário ativar o mod_rewrite na configuração do Apache do seu site MAMP, WAMP ou XAMPP.
Isso permitirá que o WordPress gere URLs limpos e evite o erro 404 para posts e páginas em seu servidor local.
A forma de fazer isso varia de acordo com a plataforma que você usa. As pessoas que usam o XAMPP podem abrir o painel de controle e clicar no botão “Config” em Actions. Em seguida, selecione “Apache (httpd.conf)”.
Em seguida, você precisará encontrar esta linha #LoadModule rewrite_module modules/mod_rewrite.so
e remover o ‘#’ para descomentá-la.
Isso carregará o mod_rewrite.
Em seguida, localize todas as instâncias de AllowOverride None
e altere-as para AllowOverride All
.
O valor “All” significa que todas as diretivas podem ser substituídas.
Uma vez concluído, você pode salvar o arquivo httpd.conf e fechá-lo. Depois disso, no painel de controle do XAMPP, clique em “Stop” (Parar) no módulo Apache e em “Start” (Iniciar) novamente para reiniciá-lo.
Em seguida, volte ao painel de administração para ver se os permalinks estão funcionando.
Esperamos que este artigo tenha ajudado você a solucionar os erros de mensagens que retornam 404 no WordPress. Talvez você também queira ver nosso guia sobre os erros mais comuns do WordPress e como corrigi-los, além de nossas escolhas de especialistas sobre os melhores plug-ins do WordPress para expandir seu site.
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.
Moinuddin Waheed
This is one of the most occuring error for wordpress websites.
this is really frustrating as it seems to get stuck and leading to nowhere.
I have solved the issue by saving the permalink.
I didn’t know about the other steps.
I really appreciate the efforts to make it holistic by including all the steps to resolve this error.
WPBeginner Support
Glad we could share the other options
Administrador
mohadese esmaeeli
Hello. The 404 error can be really frustrating, and we’ve all encountered it at least once. The situation becomes challenging when everything appears to be correct, there are no broken links, yet the 404 error persists. I faced this issue once, and it was resolved by adjusting the permalink settings.
amir
Hi
in my case, a plugin named as “WebP Express” create a htaccess file in uploads folder that restrict my access to some images.
try rename or remove it and see if the problem still exist.
WPBeginner Support
Thank you for sharing this suggestion to check for multiple htaccess files.
Administrador
Eriab Nsereko
Syed & the team u saved my whole entire day! My homepage was actually loading well.. but the other pages couldn’t load. So, I pasted the code in my .htaccess file and it did absolutely like magic.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
WPBeginner Support
Glad we could help!
Administrador
David Helleskov Fønsbo
Thanks – None of the suggested solutions did work for me. Looks like the typical permalink error but it isn’t.
Saving permalink again does not create a new .htaccess.
WPBeginner Support
If none of the methods in our guide are working for you, please reach out to your hosting provider and they should be able to help fix the issue.
Administrador
Victor
The updating permalinks fix worked. Fastest solution ever. Thank you for writing this piece
WPBeginner Support
You’re welcome, glad our guide was helpful!
Administrador
Julie
Thank you for the quick fix! Appreciate the help.
WPBeginner Support
You’re welcome, glad our guide could help you!
Administrador
Frank Thomas
Thank you for this post. I was missing the .htaccess files after moving sites and of course the wordpress code in them. I’ve replaced it all and voila! We are live at 5. Thanks.
WPBeginner Support
You’re welcome, glad to hear the guide helped!
Administrador
anand
i have try to your guideline but not working my website again showing same error 404
WPBeginner Support
If none of the recommendations from our guide could solve your error, please reach out to your hosting provider and they should be able to take a look and help!
Administrador
Harald
Hi,
saving permalink helped me too, but it keeps returning over and over again after some days.
I have no clue what causes it.
WPBeginner Support
If it is a constantly recurring error, we would recommend reaching out to your hosting provider and they can either look at their error logs for the site or keep an eye on your site for the specific error causing the problem.
Administrador
Mete
Thank you very much.solved my problem
WPBeginner Support
Glad our guide was helpful!
Administrador
Emmanuel
This is my lifesaver. My site is working fine after modifying the .htaccess files.
Thanks a ton!
WPBeginner Support
Glad our guide could help!
Administrador
Jon
For me the problem was I forced a redirect from mydomain.com to ww.mydomain.com, but in wordpress the site URL said mydomain.com. After changing the redirection to ww.mydomain.com -> mydomain.com everything worked.
WPBeginner Support
Thanks for sharing this for those who may also have this issue!
Administrador
Mario Nwolisah
Thank you! It worked. I really appreciate.
WPBeginner Support
Glad our article was helpful!
Administrador
Jess
Thank you – this saved me!
WPBeginner Support
Happy to hear our guide could help!
Administrador
Cristian
Thank you, it works for me!!!
WPBeginner Support
Glad our recommendations were able to assist!
Administrador
Samir K Al Busaidy
I was panicking and thinking that my website was hacked or had malware. As I read your writing and you wrote not to worry, I began to relax. The first option (permalink) worked for me immediately…
Thanks
WPBeginner Support
Glad our guide was able to help
Administrador
Udaykumar Posia
This worked. Thank you so much.
WPBeginner Support
Glad our guide could help
Administrador
Max Legault
On IIS there is no .htaccess file but the key is still the permalink settings. Just hitting Save didn’t fix it but changing the Custom Structure to Plain worked like a charm. Thanks for the push in the right direction.
WPBeginner Support
Glad you were able to find the solution for your issue
Administrador
Collin
I love you for this! This was an easy fix. I was in full panic mode!
WPBeginner Support
Glad our guide was able to help
Administrador
Zack
Thank you so much. It worked!
WPBeginner Support
Glad our guide was helpful
Administrador
Steve Barnard
Dang! Can’t thank you enough for this – super simple fix worked perfectly – just hit save changes on the permalinks settings page and viola’ – my pages are back. Thank you!!
WPBeginner Support
Glad our guide could help
Administrador
A.S.M. Arifur Rahman
Thanks a lot, settings saved method works, Now my post open fine.
kris
honestly thank you so much! without fail your site always comes thru with answers that work. thank you so much!
(now I just wish I knew what caused it to get out of whack in the first place. oh well.)
Chris
This article just saved me from a panic attack Lol. The solution worked great. Thanks for making this video.
Muhammad Tahir
i didn’t solve this issue by using all the methods that you are discussed?
WPBeginner Support
If none of our methods in this guide worked for you, we would recommend reaching out to the support for your hosting provider to ensure there is not an error on their end.
Administrador
Duane Wiese
None of the above suggestions worked so I did some further searching. I came across someone who suggested switching off the mod security under the security section in cpanel.
I tried this and it worked. I also tested it by switching it back on after a change and then trying another change and BAM, 404 error.
WPBeginner Support
Thanks for sharing this should someone else run into this issue. Not every host allows access to that specific file but if you reach out to your host they can normally disable or change it for you
Administrador
Dave Emma
Disabling ModSecurity fixed mine.
I actually tried permalinks plus rewriting .htaccess, but that didn’t solve my problem. I’m glad I read comments. Many thanks guys for sharing.
Elango
Thanks, it was so simple and the problem solved. No other pages were visible after I migrated to another server. I added the lines to .htaccess file and uploaded the same. Now all the pages are being displays without the 404 error and I am able to access my WP dashboard too. Thanks a lot.
WPBeginner Support
Glad our guide was able to help
Administrador
Islombek
My posts are showing 404 error after installing ssl certificate. How can I fix it? I tried everything mentioned above, but none helped.
WPBeginner Support
If you are changing your site’s URL to HTTPS you would want to follow our guide below:
https://www.wpbeginner.com/wp-tutorials/how-to-add-ssl-and-https-in-wordpress/
Administrador
Dennis Yildirim
My .htaccess file is exactly the same with that code but nevertheless I did whatever in the post. did not work, saved permalinks through admin console, did not work. Manually edits, no luck. Deleted the .htaccess and recreated it by saving it from admin console, again did not work. Nothing works. Don’t know how did it even work on others?
WPBeginner Support
If none of the recommendations from our article were able to help we would recommend reaching out to your hosting provider as that can be a sign that there is an issue on your host’s end.
Administrador
Kuldeep Singh
You saved my day. I got this issue after transferring my site from one hosting to another. I couldn’t believe it was so simple to fix the issue. Many Thanks WpBeginner team!
WPBeginner Support
Glad our guide was helpful
Administrador
Rick
I never reply to these things but just wanted to jump on here and say thank you! I’ve been having this issue a lot and having to wait ages for support to help me and so finally had a hunt around, found this, and can now fix it myself. You legend!! Much appreciated
WPBeginner Support
Glad our guide was helpful
Administrador
Elroy
Thanks a lot Wpbeginner it woked just fine.
WPBeginner Support
Glad our guide was helpful
Administrador
Noble
Thank you very much, it worked instantaneously!
WPBeginner Support
Glad our guide could help
Administrador
carol hannah
Help! It didn’t work and I can’t possibly work out how to do the .htaccessfile thingy?
WPBeginner Support
You would either need to use FTP which we cover on the page below:
https://www.wpbeginner.com/glossary/ftp/
Or reach out to your hosting provider and they would be able to assist.
Administrador
Christopher Krohn
Thank you, thank you, thank you!
WPBeginner Support
Glad our guide was helpful
Administrador
Dan
Man this fixed my WP site! THANK YOU!
WPBeginner Support
Glad our guide was helpful
Administrador
Molly
Thank you for a million time!!!!!
WPBeginner Support
Glad our guide was helpful
Administrador
Amin Omer
Thank you very much
WPBeginner Support
You’re welcome
Administrador
Afan
One of solutions to correct the issue with the Permalink change is simply delete the .htaccess file – Wordpress will recreate it again automatically.
But, before you delete it, copy the file on your computer, just in case…
WPBeginner Support
If someone has customized their htaccess file then that would be a good idea. Otherwise, WordPress should auto regenerate the default information in the file where most wouldn’t need to worry.
Administrador
James Monroe
Saving the permalinks settings worked perfectly. Such a simple solution to what looked like a serious problem! Thank you!
WPBeginner Support
Glad our recommendation was helpful
Administrador
mukhtar
its works fine 100 %
and easy to solve my problem, we are very very thankful to you about it
WPBeginner Support
Glad our guide was helpful
Administrador
Sarah
Wow!! I’ve spent all evening trying to fix this and that’s how easy it was! THANK YOU!!
WPBeginner Support
Glad our guide was helpful
Administrador
Rimzan farook
Thanks fixed it as you described changed my post date to post name, thanks a ton
WPBeginner Support
Glad our recommendations could help
Administrador
Muhammad Zeeshan
I’m facing 404 error while adding new plugin , theme , editing any post or product, editing any page ..
I’ve try to save permalinks and also tried to change .htaccess .. But not this given solution is working for me.
WPBeginner Support
You would want to reach out to your hosting provider to see if you are running into any errors on their server’s end.
Administrador
Ayobami
I’m having error 404 issues on my website, I can’t access to the website at all what can I do?
WPBeginner Support
You would use the htaccess method from this guide or reach out to your hosting provider to be able to assist you
Administrador
samith
I can’t login my WP dashboard seen “nginx 404 not found error”
WPBeginner Support
For that specific error, you would want to reach out to your hosting provider to take a look.
Administrador
Sammy
A BIG Thank You… It solved the headache!
WPBeginner Support
Glad our guide was helpful
Administrador
Mihir
I’m facing a problem where this is extension of my own website after every page and I don’t know how to fix it.
WPBeginner Support
You would likely want to check under Settings>Permalinks to ensure everything is set correctly there
Administrador
Daniel
Thank you,
It solved my problem!
WPBeginner Support
Glad our guide was helpful
Administrador