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

    So for me… I first deleted the WP Fastest Cache out of my Cpanel and THEN…I “bulk deactivated” all my plugins. Did a refresh…and it worked! Praise God!
    Then I activated the plugins I still needed. So far so good.
    Thanks so much!

    • WPBeginner Support

      Thanks for sharing what worked for you :)

      Admin

  3. nebiyu amde

    i have fixed it using the first method. but when i try to get back to my home page from other pages it’s showing me this error: Error establishing a database connection…how can i fix this

  4. Zeke Yoder

    If the problem still persists, you might want to check to see if mod_security is active and causing issues.

    I ran into this on a wordpress site hosted by Dreamhost and tried all of the options listed on this page before realizing this was my issue.

    • WPBeginner Support

      Thanks for sharing this should someone else run into the same issue :)

      Admin

  5. Ajit

    I’m still facing this issue.

    • WPBeginner Support

      If the methods in this article are not working then you would want to reach out to your hosting provider to see if the error could be caused on that end.

      Admin

  6. Bunmi

    Thank you.
    I have tried deactivating my plugins; I am using theme twenty sixteen. But still, my pages keep loading “the page can’t be found” when I use the custom permalink. I have done the .htaccess, but nothing is working. The post and categories load fine, but pages won’t load unless I use the plain permalink, which is not advisable for SEO purposes.
    Please help me.

    • WPBeginner Support

      You may want to check with your hosting provider if you haven’t done so already to see if it could be part of an error on their end.

      Admin

  7. Louis

    This did not work. .htaccess file is correct but nothing above helped. Still looking for a solution.

  8. miguel

    hello, thanks for the post, great.
    i have 404 error but cannot acces neither the site or the wordpress. how can you access wordpress admin to solve the problem??

  9. Rosy Allan

    THANK YOU SO MCUH! sorted :)

    • WPBeginner Support

      Glad our guide was able to help :)

      Admin

    • WPBeginner Support

      You’re welcome :)

      Admin

  10. Lars

    thank you so much – how quick a fix :D !

    • WPBeginner Support

      Glad our guide could be helpful :)

      Admin

  11. Avikar

    Great info, works perfectly. Got me running again

    • WPBeginner Support

      Glad our recommendations could help :)

      Admin

  12. Vhan

    Thank you so much my site is back.

    • WPBeginner Support

      Glad our recommendations could help :)

      Admin

  13. Gabriel Waju

    this tips really helpful…thank you so much

    • WPBeginner Support

      Glad our recommendations are helpful :)

      Admin

  14. Theodora

    Please i cannot even access the admin area of my page,i also can’t load the page itself at all. What can i do to solve this?

  15. sudhanshu

    Thanks. This been a great help

    • WPBeginner Support

      You’re welcome :)

      Admin

  16. Shahnawaz Ahmad

    When i am doing same thing and when i am clicking on Save Changes it also redirecting me to my website with 404 Error

    • WPBeginner Support

      You may want to reach out to your hosting provider to see if they are seeing any errors for your site on their end.

      Admin

  17. Victor Carlvin

    Came here at first, couldn’t see the solution in the post. Searched the internet for several hours, came back and decided to read the comment section, there I saw the solution to the issue.

    A plugin caused it and once I deactivate, update and reactive it, works fine thereafter. Thank you

    • WPBeginner Support

      Thank you for letting us know what solved the issue for you in case anyone else runs into the problem :)

      Admin

  18. Christos

    Thank you, i was just getting ready to jump off the building
    but your post saved me!

    • WPBeginner Support

      Glad our post could help solve the problem :)

      Admin

  19. Kurnia Sudiar

    Thankssss, it works !!!!! it solved my problem :D

    • WPBeginner Support

      Awesome, glad our guide was helpful :)

      Admin

  20. Fiona

    Hi

    Thank you very much !

    this article is really helpful and solved my problem .

    • WPBeginner Support

      Awesome, glad our article could help :)

      Admin

  21. chioma

    The permalink solution worked for me. Thanks so much

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  22. ahmed s

    thanks.. i was very close to pulling my hair out. lol.. i was getting the 404 on all my portfolio pages. yikes. easy fix.

    • WPBeginner Support

      Glad our article could help :)

      Admin

  23. Derin

    I have tried to click the save button on setting>permalink on my wordpress admin but the problem still persists. I can’t seem to locate the .htaccess on my FTP login. I noticed someone commented about editing the front. I tried checking out the storefront editor, but because I am not a programmer, I am being careful not to cause more damage to the theme. Any help on how to resolve the “404 Page Not Found” permalink problem. It started after a recent wordpress update.

  24. Babajide Adepoju

    a plugin was the problem for me; I deactivated it and had to edit the page somehow. It wasn’t that nice but it worked.

    • WPBeginner Support

      Thanks for sharing what solved your problem :)

      Admin

  25. Gary Leigh

    Thanks. This really helped and saved me a lot of stress.

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  26. Charles D

    Just have to smile, as I am not the only delighted person. Saved from 3 days of agony :-) kept getting a broken link mydomain.com/’/menu/category

    the /’/ was apparently not linking and your TIP on Go to Settings » Permalinks, and simply click on Save Changes button. worked like a charm cheers

    • WPBeginner Support

      Glad our tip could help :)

      Admin

  27. mark

    my issue not solve, 404 is returning when i am updating sub pages

    • WPBeginner Support

      You may want to reach out to your hosting provider to ensure there are no issues on the hosting’s end

      Admin

  28. Harry

    Perfect! You have saved me lots of time,
    So let me just Thank You here :)

    Cheers

    • WPBeginner Support

      You’re welcome :)

      Admin

    • WPBeginner Support

      Thank you :)

      Admin

  29. Moussa

    Thanks the first method works fine for me

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  30. godfrey

    After trying everything stated to solve error 404 and couldn’t I decide to edit with front editor and save, vola it started working again.

    • WPBeginner Support

      Thanks for sharing what solved the issue for you :)

      Admin

  31. Qadir Amin

    I have applied all tricks like
    Changed Permalinks
    Changed Theme
    Changed plugins

    but all in vain, how can i resolve my this error?

    • WPBeginner Support

      If you recreated the htaccess file you may want to reach out to your hosting provider to ensure there are no errors on the host’s end

      Admin

  32. Dave

    The 404 error has been haunting me for last 3 days now, my problem is that I cannot access anything, no WP dashboard, no website, no cPanel, it’s turning out to be quite a disaster please help me fix this

    • WPBeginner Support

      For a 404 on everything, you would want to start by reaching out to your hosting provider for what they see on their end.

      Admin

  33. dave

    do you service any word press sites? i need help.

    • WPBeginner Support

      Unless I hear otherwise, we do not have a maintenance service but you can feel free to send us the issue you are running into using our contact form.

      Admin

      • Reddemma

        i moved my local wordpress website to server.i changed composts table pointing to server ip and replaced all local host.changed config file and comoptions table also.
        But menu links not working in server site.How can i fix this?

        • WPBeginner Support

          You may want to try recreating your menu to update the links.

  34. Czarek

    Thank you very much! You save me with this solution :)

    • WPBeginner Support

      Glad our article could help :)

      Admin

  35. Rephin Perez

    Thanks so much !! You have saved my day. Didnt know that Saving the permanent links would fix this issue. :)

    • WPBeginner Support

      Glad our article could help :)

      Admin

  36. Decode Digital Market

    This post literally saved my life. I just had 404 error to all my posts.

    All I had to do was save changes in permalinks and it worked.

    • WPBeginner Support

      Glad our article could help :)

      Admin

  37. Carmen

    Thank you so much for the information, unfortunately I am still having issues. When I try to click into +Add New Page it takes me to a 404, if I click +Add New Plugin it also takes me to a 404, if I try to add anything new it will take me to a 404, my website is still in the creation process, it is not yet published. I tried to use filezilla, but after multiple attempts doesn’t connect to my file. Do you know what I should do, I would greatly appreciate your answer!

  38. alaa mohamed

    ok so am not sure if that’s the exact same issue am having. generally, when I access my website I don’t get any 404 errors yet on my SEO audit tool it is shown that my WordPress posts preview page is coming back with a 404 error, can anyone help me get this fixed ??

    • WPBeginner Support

      You would want to reach out to the support for your SEO tool to see if this is a known issue with the tool

      Admin

  39. Mathukutty P V

    Today enabled minify script/styles in swift performance lite and after that except home page all other links showed 404 error. searched and found this post and on checking found .htaccess empty, added the basic code from this post and 404 error gone. All links are working fine Thanks.

    • WPBeginner Support

      Glad our article could help :)

      Admin

  40. jeremy

    please help me out
    i dont know whats wrong with my WordPress website, i tried creating a new post when am done, i click on publish but it redirect me to a page not found which 404, please help me out as at now, i cant publish anything on my site nothing is working,
    thanks for your help in advance.

  41. Alexander Londono

    you just save me a lot of time.
    it had take me 2 hours with no solution

    • WPBeginner Support

      Glad our article could help :)

      Admin

  42. Ahmad WABBI

    This is a great post. I had a problem with the permalinks when I moved my WP site from a server to another. Your post saved me a lot of time searching for the reason.

    Thanks

    • WPBeginner Support

      Glad our article could help :)

      Admin

  43. Babar Waheed

    hi
    your all articles are easy to understand step by step with screen shots guide thanks for writing

    I have a free classified website in word press. advertisers are posting ads in my website but few of them not meet with our terms and conditions so we delete those ads when i delete ads i get a message by word press.
    (You just trashed a Post. Search engines and other websites can still send traffic to your deleted post. You should create a redirect to ensure your visitors do not get a 404 error when they click on the no longer working URL. With Yoast SEO Premium, you can easily create such redirects)

    My question is how to fix this problem without buying yoast seo premium?

  44. Priya

    Hello,
    My website is under construction right now.
    But I still receive 404 error while logging in.
    It does not allow me to open my account on wordpress as error arrives immediately after clicking on the log in button.

    How to solve this problem so that I can assess wp to complete my website?

    Plz give me directions so that I can proceed further as soon as possible.

    Thank you!

  45. Baba nee

    Good day, i installed a pluggin. So i can put the google addsense script to my the head section of my blog, after putting this code to the pluggin and updating my permalinks i saved it. It still telling me page not found! How do i fix the error! Is there any other way i can insert this script manually via my cpanel! Please help a brother who is so confused right now

  46. Sapna

    These steps seem so simple. But I tried everything. Changing the rights to 666 and 664. Deleting the .htaccess file. Copying and pasting the code didn’t help either.

    I even changed the permalink settings to which I desire and rewrite all the pages by hand again. To make sure they get the name I want and to have new page id’s

    I tried literally everything. I’m really clueless now. Can you please help me.

  47. Dasuni

    Fatal error: Class ‘Email_Before_Download_Form’ not found in /wp-content/plugins/email-before-download/includes/class-email-before-download-shortcode.php on line 65

    Why???

  48. Darshan Tejani

    Hi. I liked the simplicity in the Tutorial. Sadly, it didn’t work for me!

    The error goes away only If I change my permalink to ‘plain’. If I change back permalink to ‘post name’, then it shows the error! I’d be grateful If you’d help me out here. Thanks anyway for the post.

    • WPBeginner Support

      If recreating the htaccess method is not working then you would want to reach out to your hosting provider to see if the mod_rewrite rule is enabled on their server.

      Admin

    • WPBeginner Support

      You’re welcome :)

      Admin

Rispondi a Jon Annulla 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.