Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coppa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Come correggere gli articoli di WordPress che ritornano con l’errore 404 (passo dopo passo)

I vostri articoli su WordPress restituiscono un errore 404 sul vostro sito web?

Questo errore si verifica quando è possibile accedere all’area di amministrazione di WordPress e al blog, ma quando si cerca di aprire un articolo, viene visualizzato “404: la pagina non è stata trovata”.

In questo articolo vi mostreremo come correggere gli articoli di WordPress che restituiscono errori 404.

How to fix WordPress posts returning 404 error

Perché gli articoli di WordPress restituiscono un errore 404?

Ci sono diversi motivi per cui gli articoli di WordPress potrebbero mostrare un errore 404: la pagina non è stata trovata. Questi possono essere:

  • Conflitti tra plugin o temi: A volte, i plugin o i temi installati sul sito possono interferire con il modo in cui WordPress gestisce i permalink. Ciò può causare la rottura dei colleghi e la comparsa di errori 404.
  • Problemi di codice personalizzato: Se avete aggiunto del codice personalizzato al vostro sito web, potrebbero esserci errori nel codice che influenzano i permalink o causano altri conflitti, con conseguenti errori 404 per gli articoli.
  • Problemi con il file .htaccess: Il file .htaccess ha un ruolo nel modo in cui WordPress struttura gli URL. Se questo file è danneggiato o mancante, può causare errori 404 per i vostri articoli.

Detto questo, vediamo come correggere gli articoli di WordPress che restituiscono errori 404. Potete usare i colleghi qui sotto per passare direttamente alle diverse soluzioni:

Non volete correggere da soli gli errori 404? I Servizi Pro di WPBeginner possono aiutarvi! Con la nostra conveniente Assistenza WordPress di emergenza, potete assumere esperti per la correzione di errori 404, link rotti, problemi di reindirizzamento e molto altro. Smettete di stressarvi per i problemi di WordPress e correggeteli! Programmate oggi stesso i servizi di assistenza WordPress di emergenza!

Video tutorial

Subscribe to WPBeginner

Se preferite le istruzioni scritte, continuate a leggere.

Metodo 1: Verificare la presenza di conflitti tra plugin o temi e problemi di codice personalizzato

A volte, i plugin, i temi o il codice personalizzato che avete aggiunto al vostro sito WordPress possono interferire con i permalink o causare conflitti, causando errori 404. Lo abbiamo sperimentato anche noi quando testiamo gli strumenti sul nostro sito demo.

Un modo per risolvere questo problema è disattivare temporaneamente i plugin. I plugin possono talvolta disturbare il modo in cui WordPress gestisce i colleghi.

Una volta disattivati i plugin, è possibile riattivarli uno per uno, selezionando se l’errore 404 ricompare dopo aver attivato ciascun plugin. Se l’errore compare dopo aver attivato un plugin specifico, il colpevole potrebbe essere quello.

È quindi possibile cercare soluzioni relative a quel plugin o contattare lo sviluppatore del plugin per ottenere assistenza.

Allo stesso modo, il tema di WordPress potrebbe essere la causa del conflitto.

Per selezionare, è possibile passare temporaneamente a un tema predefinito di WordPress, come Twenty Twenty-Three o Twenty Twenty-Four. Basta andare in Aspetto Temi e fare clic su ‘Attiva’ su un tema predefinito.

Activating a default WordPress theme

Se l’errore 404 scompare con il tema predefinito, ciò indica un potenziale conflitto con il tema corrente. Si può quindi provare a risolvere il problema del tema o prendere in considerazione l’utilizzo di un tema diverso.

Potete consultare la nostra selezione di esperti dei temi WordPress più popolari per avere consigli.

Se di recente avete inserito degli snippet di codice nel vostro sito web, potrebbero esserci degli errori nel codice che causano l’errore 404. Esaminate attentamente il codice che avete aggiunto e vedete se riuscite a individuare qualche errore.

Il modo più sicuro per aggiungere frammenti di codice a WordPress è il plugin WPCode. Questo plugin consente di inserire codice personalizzato senza intervenire direttamente sui file del tema, riducendo il rischio di rottura del sito web.

Inoltre, ogni volta che WPCode individua un errore nel codice, disattiva automaticamente lo snippet e chiede di selezionarlo. È anche possibile utilizzare la modalità di test per verificare se il codice funziona prima di inviarlo al sito web.

WPCode error warning

Se nessuna di queste soluzioni funziona, passate al metodo successivo, che prevede la risoluzione dei problemi relativi alle impostazioni dei permalink.

Gli articoli di WordPress possono restituire errori 404 a causa di problemi con le regole di riscrittura nel file .htaccess. Nella maggior parte dei casi, è possibile correggere il problema aggiornando le impostazioni dei permalink.

Basta andare su Impostazioni ” Permalinks nell’amministrazione di WordPress e fare clic sul pulsante “Salva modifiche”.

Check Permalinks

Non è necessario modificare le impostazioni dei permalink. Questa operazione aggiornerà le impostazioni dei permalink e cancellerà le regole di riscrittura.

Nella maggior parte dei casi, questa soluzione corregge l’errore 404 degli articoli di WordPress. Tuttavia, se non funziona, probabilmente è necessario aggiornare manualmente il file .htaccess.

Metodo 3: Aggiornamento del file .htaccess di WordPress

Prima di iniziare, assicuratevi di eseguire un backup del file .htaccess di WordPress. Se qualcosa dovesse andare storto, potrete facilmente ripristinare il file originale.

A questo punto, è necessario connettersi al server utilizzando un client FTP come FileZilla o l’applicazione File Manager nella dashboard del vostro hosting WordPress.

Successivamente, dovrete trovare e modificare il file .htaccess, che si trova nella stessa posizione di cartelle come /wp-content/ e /wp-includes/.

È sufficiente fare clic con il tasto destro del mouse sul file e selezionare “Autorizzazioni file”.

.htaccess file permissions

È possibile rendere il file scrivibile cambiando le autorizzazioni a 666.

Inserite semplicemente “666” nella casella “Valore numerico” e fate clic su “OK”.

Change file attributes for the .htaccess file to 666

Quindi, è necessario ripetere i passaggi del primo metodo del nostro tutorial. Una volta fatto questo, non dimenticate di modificare le autorizzazioni in 660.

È anche possibile modificare il file e aggiungervi del codice.

Edit .htaccess file

Una volta aperto il file .htaccess con un editor di testo, è sufficiente inserire questo codice:

# 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

Metodo 4: contattare il fornitore di hosting

Se nessuna delle soluzioni sopra descritte ha corretto l’errore 404 degli articoli di WordPress, vi consigliamo di contattare il vostro fornitore di hosting WordPress. Potrebbe trattarsi di un errore on loro, oppure potrebbero aiutarvi a risolvere il problema.

NON SI TRADUCE la nostra guida su come richiedere correttamente l’assistenza WordPress e ottenerla.

Metodo 5: correggere gli articoli di WordPress che restituiscono l’errore 404 sui server locali

Se si utilizza un server locale a scopo di test, è necessario abilitare il mod_rewrite nella configurazione Apache del sito MAMP, WAMP o XAMPP.

Questo permetterà a WordPress di generare URL puliti e di evitare l’errore 404 per articoli e pagine sul server locale.

Il modo in cui farlo varia a seconda della piattaforma utilizzata. Chi usa XAMPP può aprire il proprio pannello di controllo e fare clic sul pulsante “Config” all’interno di Azioni. Quindi, selezionare “Apache (httpd.conf)”.

The Apache (httpd.conf) menu on XAMPP

Successivamente, è necessario trovare questa riga #LoadModule rewrite_module modules/mod_rewrite.so e rimuovere il ‘#’ per decommentarla.

Questo caricherà il mod_rewrite.

Finding the rewrite_module on httpd.conf file

Quindi, individuare tutte le istanze di AllowOverride None e modificarle in AllowOverride All.

Il valore “Tutti” significa che tutte le direttive possono essere sovrascritte.

Changing AllowOverride None to AllowOverride All

Una volta fatto, si può salvare il file httpd.conf e chiuderlo. Dopodiché, nel pannello di controllo di XAMPP, fate clic su ‘Stop’ sul modulo Apache e su ‘Start’ per riavviarlo.

Poi, tornate alla vostra Bacheca per vedere se i permalink funzionano.

Speriamo che questo articolo vi abbia aiutato a correggere gli articoli che restituiscono errori 404 in WordPress. Potreste anche voler consultare la nostra guida agli errori più comuni di WordPress e a come correggerli, insieme alle scelte dei nostri esperti sui migliori plugin WordPress per far crescere il vostro sito.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

768 commentiLascia una risposta

  1. Syed Balkhi

    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!

  2. Mario Nwolisah

    Thank you! It worked. I really appreciate.

    • WPBeginner Support

      Glad our article was helpful!

      Admin

  3. Jess

    Thank you – this saved me!

    • WPBeginner Support

      Happy to hear our guide could help!

      Admin

  4. Cristian

    Thank you, it works for me!!!

    • WPBeginner Support

      Glad our recommendations were able to assist!

      Admin

  5. 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 :)

      Admin

  6. Udaykumar Posia

    This worked. Thank you so much.

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  7. 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 :)

      Admin

  8. 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 :)

      Admin

  9. Zack

    Thank you so much. It worked!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  10. 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 :)

      Admin

  11. A.S.M. Arifur Rahman

    Thanks a lot, settings saved method works, Now my post open fine.

  12. 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.)

  13. Chris

    This article just saved me from a panic attack Lol. The solution worked great. Thanks for making this video.

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

      Admin

  15. 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 :)

      Admin

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

  16. 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 :)

      Admin

  17. Islombek

    My posts are showing 404 error after installing ssl certificate. How can I fix it? I tried everything mentioned above, but none helped.

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

      Admin

  19. 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 :)

      Admin

  20. 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 :)

      Admin

  21. Elroy

    Thanks a lot Wpbeginner it woked just fine.

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  22. Noble

    Thank you very much, it worked instantaneously!

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  23. carol hannah

    Help! It didn’t work and I can’t possibly work out how to do the .htaccessfile thingy?

  24. Christopher Krohn

    Thank you, thank you, thank you!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  25. Dan

    Man this fixed my WP site! THANK YOU!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  26. Molly

    Thank you for a million time!!!!!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  27. Amin Omer

    Thank you very much

    • WPBeginner Support

      You’re welcome :)

      Admin

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

      Admin

  29. 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 :)

      Admin

  30. 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 :)

      Admin

  31. 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 :)

      Admin

  32. 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 :)

      Admin

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

      Admin

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

      Admin

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

      Admin

  36. Sammy

    A BIG Thank You… It solved the headache!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

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

      Admin

  38. Daniel

    Thank you,
    It solved my problem!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  39. Mellissa

    This is a great solution but it didn’t fix my issue so in case anyone else is in the same boat, here’s what went wrong for me; my index.php file went missing from the server. Added a new copy and everything is back

    • WPBeginner Support

      Thanks for sharing what worked for you :)

      Admin

  40. Brahim

    thank you, that help a lot

    • WPBeginner Support

      You’re welcome :)

      Admin

  41. Logan

    Thanks for your articles. My issue is that I can’t log in to my website even though I’m logged in to the host server… When I try to log in my wordpress the message goes :

    Not Found

    The requested URL was not found on this server.

    My website isn’t published yet as I’ve just started.

    • WPBeginner Support

      You would want to check with your hosting provider to ensure there isn’t an issue on their end or where your site is installed

      Admin

  42. Danish

    My main page is working but all other pages are showing 404 error. They are visible in admin panel but can’t view them.

  43. Peck-Secia Tangi

    Hi,

    Below is the error that i am getting which is similar to the one described above

    “The requested URL was not found on this server.”

    • WPBeginner Support

      For that error, if you haven’t done so already you would want to reach out to your hosting provider to see if the error could be server related.

      Admin

  44. Kathryn

    This worked beautifully. Thank you!

    • WPBeginner Support

      You’re welcome, glad it helped :)

      Admin

  45. Parvinder Singh

    Yes, WPBEGINNER rocks !!!!

    • WPBeginner Support

      Glad our guides were helpful :)

      Admin

  46. clay

    Crazy how helpful this article is. Such a simple solution to a very frustrating problem.

    • WPBeginner Support

      Glad we could help make the solution easy :)

      Admin

  47. Shoeb Khan

    This is very helpful thank you.

    • WPBeginner Support

      You’re welcome :)

      Admin

  48. Calvin

    I’m having the same problem with category links. They return a 404 error and it’s a new website. I’m afraid not all pages are going to be indexed.

  49. Oluebube

    This was very helpful…

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  50. Dominus MMP

    Thanks, this was helpful for me.

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  51. Ian

    I just build my website. I was able to go into dashboard. I changed the url (IP address) to my domain. Now mydomain.com and mydomain.com/wp-admin give me “Not Found”.
    Any suggestions? Thanks.

    • WPBeginner Support

      If your site is on your hosting provider you would want to reach out to your host’s support to ensure the site is in the correct location and your domain is pointing correctly.

      Admin

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.