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.
Quais são as causas do erro 404 dos posts do WordPress?
O WordPress é um sistema de gerenciamento de conteúdo (CMS) avançado, mas uma pequena alteração pode, às vezes, tornar seu site do WordPress inacessível.
Em alguns casos, talvez não seja possível acessar a área de administração do WordPress ou o próprio site, como no caso do erro interno do servidor ou do erro ao estabelecer uma conexão com o banco de dados.
Por outro lado, quando as publicações do WordPress estiverem retornando erros 404, você ainda poderá acessar a área de administração e ver o site do WordPress no front end. Então, ao clicar em um post de blog, você verá uma mensagem dizendo “404 Not Found” (404 não encontrado).
Embora essa mensagem de erro possa ser assustadora, ela não significa que você perdeu suas publicações no WordPress. Em vez disso, seu arquivo .htaccess provavelmente foi excluído ou algo deu errado com as regras de reescrita em seu blog.
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:
Tutorial em vídeo
Se você preferir instruções por escrito, continue lendo.
Método 1: 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 2: 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 3: 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 4: 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.
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!
Moinuddin Waheed says
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 says
Glad we could share the other options
Administrador
mohadese esmaeeli says
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 says
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 says
Thank you for sharing this suggestion to check for multiple htaccess files.
Administrador
Eriab Nsereko says
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 says
Glad we could help!
Administrador
David Helleskov Fønsbo says
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 says
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 says
The updating permalinks fix worked. Fastest solution ever. Thank you for writing this piece
WPBeginner Support says
You’re welcome, glad our guide was helpful!
Administrador
Julie says
Thank you for the quick fix! Appreciate the help.
WPBeginner Support says
You’re welcome, glad our guide could help you!
Administrador
Frank Thomas says
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 says
You’re welcome, glad to hear the guide helped!
Administrador
anand says
i have try to your guideline but not working my website again showing same error 404
WPBeginner Support says
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 says
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 says
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 says
Thank you very much.solved my problem
WPBeginner Support says
Glad our guide was helpful!
Administrador
Emmanuel says
This is my lifesaver. My site is working fine after modifying the .htaccess files.
Thanks a ton!
WPBeginner Support says
Glad our guide could help!
Administrador
Jon says
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 says
Thanks for sharing this for those who may also have this issue!
Administrador
Mario Nwolisah says
Thank you! It worked. I really appreciate.
WPBeginner Support says
Glad our article was helpful!
Administrador
Jess says
Thank you – this saved me!
WPBeginner Support says
Happy to hear our guide could help!
Administrador
Cristian says
Thank you, it works for me!!!
WPBeginner Support says
Glad our recommendations were able to assist!
Administrador
Samir K Al Busaidy says
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 says
Glad our guide was able to help
Administrador
Udaykumar Posia says
This worked. Thank you so much.
WPBeginner Support says
Glad our guide could help
Administrador
Max Legault says
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 says
Glad you were able to find the solution for your issue
Administrador
Collin says
I love you for this! This was an easy fix. I was in full panic mode!
WPBeginner Support says
Glad our guide was able to help
Administrador
Zack says
Thank you so much. It worked!
WPBeginner Support says
Glad our guide was helpful
Administrador
Steve Barnard says
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 says
Glad our guide could help
Administrador
A.S.M. Arifur Rahman says
Thanks a lot, settings saved method works, Now my post open fine.
kris says
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 says
This article just saved me from a panic attack Lol. The solution worked great. Thanks for making this video.
Muhammad Tahir says
i didn’t solve this issue by using all the methods that you are discussed?
WPBeginner Support says
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 says
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 says
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 says
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 says
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 says
Glad our guide was able to help
Administrador
Islombek says
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 says
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 says
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 says
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 says
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 says
Glad our guide was helpful
Administrador
Rick says
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 says
Glad our guide was helpful
Administrador
Elroy says
Thanks a lot Wpbeginner it woked just fine.
WPBeginner Support says
Glad our guide was helpful
Administrador
Noble says
Thank you very much, it worked instantaneously!
WPBeginner Support says
Glad our guide could help
Administrador
carol hannah says
Help! It didn’t work and I can’t possibly work out how to do the .htaccessfile thingy?
WPBeginner Support says
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 says
Thank you, thank you, thank you!
WPBeginner Support says
Glad our guide was helpful
Administrador
Dan says
Man this fixed my WP site! THANK YOU!
WPBeginner Support says
Glad our guide was helpful
Administrador
Molly says
Thank you for a million time!!!!!
WPBeginner Support says
Glad our guide was helpful
Administrador
Amin Omer says
Thank you very much
WPBeginner Support says
You’re welcome
Administrador
Afan says
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 says
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 says
Saving the permalinks settings worked perfectly. Such a simple solution to what looked like a serious problem! Thank you!
WPBeginner Support says
Glad our recommendation was helpful
Administrador
mukhtar says
its works fine 100 %
and easy to solve my problem, we are very very thankful to you about it
WPBeginner Support says
Glad our guide was helpful
Administrador
Sarah says
Wow!! I’ve spent all evening trying to fix this and that’s how easy it was! THANK YOU!!
WPBeginner Support says
Glad our guide was helpful
Administrador
Rimzan farook says
Thanks fixed it as you described changed my post date to post name, thanks a ton
WPBeginner Support says
Glad our recommendations could help
Administrador
Muhammad Zeeshan says
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 says
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 says
I’m having error 404 issues on my website, I can’t access to the website at all what can I do?
WPBeginner Support says
You would use the htaccess method from this guide or reach out to your hosting provider to be able to assist you
Administrador
samith says
I can’t login my WP dashboard seen “nginx 404 not found error”
WPBeginner Support says
For that specific error, you would want to reach out to your hosting provider to take a look.
Administrador
Sammy says
A BIG Thank You… It solved the headache!
WPBeginner Support says
Glad our guide was helpful
Administrador
Mihir says
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 says
You would likely want to check under Settings>Permalinks to ensure everything is set correctly there
Administrador
Daniel says
Thank you,
It solved my problem!
WPBeginner Support says
Glad our guide was helpful
Administrador