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.
Abs
It helps.. just on permalink, already fix my error..
Thanks for this article..
Julius
Mine is a little different. All the pages are working fine but I get “page not found” when working in some places in the dashboard. Let’s say for example I’m creating a new page from the dashboard. When I click on publish I get a 404 error.
And I’ve tried everything above but it’s not working.
Iron65
Thanks for the tip!! the permalink really saved me!!! In case if any other suffered this by updating Yoast SEO or by just deleting cache, try that one, it will fix it
Monica
I have been trying to fix this permalink issue in my site for months and now I did it with your instructions. I don’t know why I did everything you said already and after writing the 644 permissions to fix the httaccess file, it went back to non-writeable. Now I did it and fixed the permissions and wrote your code and it worked. i really don’t know which was the difference but this time it did. Maybe that I already fixed the httaccess in the original folder where I have a subfolder with my blog. That is the only thing I did differently. Thanks a lot
Rais Dar
I am getting a 404(page not found) on my site. What should i do as i tried your methods but still error persists
Chetan
I had faced the same kind of problem. I used to get 404 Page Not Found error for a page. But the reason was that I and used a permalink slug that was associated with some default page in WordPress. e.g. http://example.com/posts – This is WRONG. Because I cannot use ‘posts’ as permalink slug. It is already reserved for some WordPress page. When I changed it to ‘my-posts’, so that now my permalink read: http://example.com/my-posts, the error was gone!
md
hi ,
i had same htaccess .,however , i delete it and import new one but still same .
dumb
hay guys ….
when i change the permalink to anything other than default, my pages wont work i get this error message
“The requested URL /wordpress/home/ was not found on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80”
pl help me out
Ian Scofield
I just had this with one of my websites. All of my posts worked fine except for one though. Something was bad about the URL. I had to change the post URL.
neelesh
thanks a lot… ur website has helped me a lot of times and u guys are doing great job. i cant resist myself from thanking you…..
Hardik
Hi Wpbeginner,
Actually I just have migrated from hostinger to one of paid hosting. After migration all things are going good. But when I have tried to edit one my post it regularly shows the following error.
“Page not found error” ‘Apologies, but the page you requested could not be found. Perhaps searching will help.
When I have landed here I have tried all the solutions which you have share.
But nothing is working for me.
Please Help.
Thanks in advance
Hardik
Adrienne
Question? I have an url site, but the data is all new. so there are about 100 old posts that are not longer valid but linked to other sites.. How do I change it to forward to main website, so that Google Search Console can update they crawl records.
I’m looking, but I don’t see anything for posts that have been deleted and getting a 404 error.
Thanks,
David
Thanks was having exactly that issue and this fixed it perfectly!
Mark
Thank you! So nice to find such an easy fix for such a frustrating mysterious problem.
Xavier
Woohoo! Thanks for this. I thought my site content had gone to the birds. Doing the permalink “Save Changes” worked instantly for me.
Pablo
What if it doesn’t work no matter what you do?
HELP!
Fida
Hi Pablo Which server do you use? Shared server or VPS?
Steve Jackson
Thank you for this tip, it was a lifesaver and worked perfectly!
John
Thank you !!!!
abhishek
thank you very much it saved my links pretty well
Hugo Nascimento
Hello guys,
I have the same issue with a client blog. i’m trying to build a custom form inside post page and when I enable the custom permalinks, the form cannot be accessed.
When I change permalinks to default, it works out! :/
Really strange. :/
Sarah
Changing permalinks to default solved my problem too! Thank you!
mojamalenkost
Thank you so much!!!
victor
I have this problem .I can’t login to my WordPress dashboard, each time I try to it keeps giving me Error 404 not found. please help me fix this.
Dont Ask Real Name
Your tip was a life saver. All our posts were just not visible. Your tip helped a lot.
What i did:
Updated .htaccess set CHMOD to 666 instead of 660
Clicked – > Settings -> Permalinks
Clicked on Defaults and clicked Save Changes
Again,
Clicked on Post name and clicked on Save Changes. (since i used custom url that’s why)
You just saved me a ton of headache…
Clive Wales
That was a real life-saver – thought I’d totally screwed up a replacement site I’ve been working on, after trying to be clever with an .htaccess redirection. Thank you!
Marko Liuksiala
Great, that worked – thank you!!
Bill
I like the permalink structure of my posts and they seem to work. I have been using the same structure for several years.
However when I go to Settings–>Permalinks the actual structure is not even listed as one of the options available anymore.
Is this a problem?
Emily
Hi I am having this problem and to be honest, I feel sick because I don’t know what to do. I am a novice really and scared I am going to kill my website more than I already have.
Can someone please tell me what my custom permalink should look like and what I SHOULD hav in my .htaacess file? Right now it seems blank?
WPBeginner Support
Go to Settings » Permalinks choose a permalink structure that you like and then save your changes. Open your .htaccess file and you will notice that WordPress has automatically updated it. If it is blank and your chosen permalink structure is not working, then you can manually add this code into your .htaccess file:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Administrador
Viktor
Yes, that was the solution! Thanks a lot. My hosting service changed these settings as I changed the URL to custom error pages but just clicking on the permalink settings fixed that.
Matthew Shelton
“Go to Settings » Permalinks, and simply click on Save Changes button” – fantastic, that worked right away – thanks a lot!!
WPBeginner Staff
Check the .htaccess file.
Gretchen Louise
What about for a single post permalink that got changed and somehow created an internal redirect, and now it cannot be changed back without creating a 404 error? Trying to troubleshoot an issue for a client and wondering where those internal redirects are stored and where in the world to clear them. Thank you.
Thembi Ngema
Dudessss. You guys are legends :)…. Must say I have learnt a lot from you in the past week
bhupendra
hi
thanks I just updated parmalinks structure and site started working
Arpee Lazaro
i just updated t he permalink structures are pictured in this solution and it worked like a charm. thanks!
WPBeginner Staff
Please contact your web host.
Attiq Haroon
I tried the solutions you mentioned in you post bhut it didn’t seems to be working. What happened actually is that I wanted to add a rule to .htaccess file so I downloaded that files from FTP and edited it and uploaded that file again replacing the original one, and then the problem popped up. I have tried a couple of fixes such as deleting and putting new .htacces with default code, removing .htacces file, etc. The only fix that is making the posts accessible is to set the permalink to default option. This makes the posts to work but it can not be a permanent Fix as it is not recommended as an SEO prespective
Please try to find a working solution on that problem
WPBeginner Staff
backup your .htaccess file. Then delete the one from your server. Now log into WordPress admin area and go to Settings -> Permalinks choose your desired permalink structure and hit save changes.
After that connect to FTP and see if WordPress has created a new .htaccess file and it is not blank.
Attiq Haroon
I tried that solution, It created a .htaccess file which looks fine but doesn’t work.
gui
If you have Yoast WordPress SEO or any SEO plugin installed, check your SEO permalink section…
Tim Topham
Hey guys – I recently received an email from Google crawl as I suddenly had a heap 500+ of lost links. It seems that at some stage I must have changed the permalink structure so that lots of the links on old posts have the post date and then post name where as they now just have the post name.
Before I go mad trying to fix 500 links in my articles manually, is there an easy way to update the hyperlinks in articles when this sort of thing happens?
Cheers,
Tim.
Manuel Moreira
I was going insane with this 404 thing after a server move. Thanks for the help guys.
Cindy
thank you! My sites were hacked and all internal pages showed a 404 error. saving the permalink settings fixed it! cheers!
Joe Cutroni
Hi all, I’ve scoured the web to find help to resolve my issue, but
for the life of me cannot get anything to work. Starting just a couple
of weeks ago, all of my back end pages (home page was fine) started
turning out 404 errors on them.
The permalink that I have always used is “Custom structure” (/%category%/%postname%/)…here are some things that I’ve tried:
1 . Gone into my permalinks, clicked “save settings”, and that method provides a temporary fix, maybe for an hour or two, then the 404 errors return on all secondary pages. I’ve also set my permalinks to a different option, such as “Default”, but still get 404 errors shortly after.
2. Completely deleted my htaccess.php file, then went back and saved permalink settings…less than an hour later, 404 errors returned.
3. Commented out this line of code in my function.php file, also completely removed it altogether:
“$wp_rewrite->flush_rules();”. That didn’t do anything. I’ve tried
using both “//” and “#” before it and tested…still get 404 errors.
4. De-activated all of my plugins to see it one of them was the culprit,
but after a short time, my 404 errors resumed while none of the plugins were active.
Like I said, this issue just start a few weeks ago. I use Securi
Security and had them scan my site for any malware, etc…and the site
is clean.
Can someone PLEASE help me with this? Would bigtime appreciate it!
Kyle
Hey Joe,
Did you ever find a workable solution for this? I’ve gone through the same issues that you listed.
David
Hey Guys!
Did you find a solution to the returning 404-error as listed above by JOE CUTRONI?
I’m dealing with the same issue?
Some Feedback would be awesome!
Thank you!
Greetings from Germany,
David
Paul
Hey guys,
you are likely to have a virus on your site.
good luck
Paul
Katie
This is the problem I am having. I moved from Wordpress.com to .org and I am at my wits end. I understand the directions that say got admin—> settings —> permalinks. In fact, I remember when I was setting this up that I messed with that particular setting. Here’s my issues: WHERE do I find this admin–> settings–> permalinks?? Is it on my host, in the cpanel? Is it back on WP.com, or if it’s WP.org? And if it’s on WP.org I don’t have a clue how to get to all the admin features of my blog now. When I log in, it shows me my personal profile and allows me to edit it. But not any blog administration. I am at a loss and really losing my head.
Gabriel
If I’m understanding you correctly, just type in the domain name that you activated the wp.org tool and follow it up with “/wp-admin” (for instance “www.example.com/wp-admin”)log in and on the lower left hand side you would find the settings option.
mali suresh
how can change localhost paramalink step by step help me
Srihari K
I had the same problem.. adding the below line in httpd.conf and restarting apache fixed it.
Options +FollowSymLinks
Kym Penrose Clayton
Thank you thank you thank you
Iris Fritschi-Cussens
THANK YOU from the bottom of my heart! I had to delete my .htaccess file due to a hack and then just when I thought everything was fine again nothing worked apart from the home page. Pressing Save Changes on the permalinks solved it in one.
disqus_Hct2NXneXJ
Thanks Man. The Permalink Solution Fixed my Problem. Thanks & Cheers for You!
MEMEME
Thanks! You are God.
L
thanks! I was close to panic…
Thai
Thanks for the post! But sadly I tried these with on the local and nothing worked.. Any other tips?
SemLavana
Thank you. Saved my weekend!