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

    Hi,

    I have moved my two domains from a web hosting service provider to another web hosting service provider. The new web hosting service provider setup WordPress websites from the cPanel. Only the homepages are loading correctly but the other webpage links are showing Server Error 404 Page Not Found.

    The webhosting service provider told me to update my permalinks and the web.config code. I updated the permalinks to show “post name”. I don’t know how to update the web.config code. From watching these videos, I see that I should update the htaccess file. However, my htaccess do not show any missing text and it contains identical as shown in your video. What next should I do?

    Many thanks.

  3. Joe

    My problem is, I moved my blog to a self host. And changed my permalink to “post name” Ever since then,

    1. I noticed my traffic start reducing,

    2. Couldn’t get searches from Google/yahoo/bing linking to my blog again.

    3. Got a lot of broken links.

    What do I do please?

    I’ve started getting discouraged with this..

    • WPBeginner Support

      Hi Joe,

      You can change your permalink structure to whatever it was before by visiting Settings » Permalinks page.

      Admin

  4. David

    Thank you very much! This tutorial was very helpful.

  5. Bert Ramirez

    Worked like charm…THANK YOU!!

  6. Tejash

    Thanks so much. I was able to resolve the error

  7. prakhar

    when i try to see plugins it gives 404 error.
    add plugin is working fine but i can’t get to plugin.php when i try to see
    installed plugins.
    also update-core.php also gives 404 error.
    what could be the reason?

  8. jeff

    Hi,
    I have the same problem. I couldnt able to install a plugin which is this “themify-wc-product-filter.zip” .i always get file not found error 404 as result. can anyone help me out please? thanks guys in advance

  9. Marisol

    Hey thank you work for me took me 2 minutes to fix it!

  10. Sjoerd

    Hi,

    I have the same problem. The first solution worked for me, just now wordpress somehow keeps getting back tot the 404.
    So i click save changes, it works again. And then a few minutes later the 404 error is back. Anyone any ideas?

    Thanks.

    Kind regards,
    Sjoerd

  11. Ravi J

    I have the same issue too….

    1) Changed Permalink
    2) Manullay created the .htaccess file
    3) removed and created the site once again

    Amy help is greatly appriciated

    Note: I am setting up a local instance in Ubuntu 16 LTS.

  12. Biggles

    I have a similar problem: I moved hosting providers and now my WP login box is top left hand corner of my browser screen and, most critically, when I login, every page and link for WP gives me a 404.

    The website loads fine for my visitors but I am unable to gain access myself in WP. Well, I am, I can log in, but that’s all I am able to do. After many years of web design, this is a first.

    I have done the following:
    1. deleted the .htaccess file
    2. tried an old .htaccess file
    3. created a new .htaccess file
    4. changed the name of some and all of the plugin folder names via ftp to see if there’s an issue with a plugin

    FYI, that I was unable to load my sample website (subdomain) after the migration, and all that was showing was a ‘database error’ white screen. I finally managed to track down the issue, and I was a little bit upset about it: in my new cPanel, I noticed the username had disappeared next to the database name, and when I tried re-entering it again it wouldn’t take it because I had been limited to only a few characters in length. I created a new username and updated the config file, and it works okay now.

    So, I opened my new cPanel and my previous cPanel side by side and my old host didn’t restrict me on database username character length, whereas my new host did to about 7 or 8.

    …so, I’m starting to think that even though all of my other subdomains and client websites are now all loading fine, that it may be that a different version of cPanel and how my new hosting provider has set it up has affected how I interact in WP for my failing website.

    v. 68.0.23 new cPanel
    v. 66.0.34 old cPanel

    Do you think there is an issue with how my new host has setup WHM and / or cPanel.

    Many thanks in advance : )

  13. Wen

    Hi there, i did other test and the error show everytime, so any ideas??

    • Afroze

      for me, after going nuts, i had to enable the rewrite module… i forgot to do this when I migrated sites.

      in ubuntu:
      sudo a2enmod rewrite

  14. Wen

    Hi guys!
    I’ve tried everything and its shows still the error in my links, can you help me?

  15. Hank Wilson

    Thanks for this, permalinks idea worked. Bookmarked for future reference

  16. Alan Ross

    Thanks for the fix. Worked like a charm !

  17. Fahad Siddiqui

    I tried this .htaccess code but the error remains same as “Not Found
    The requested document was not found on this server.”

  18. TJ

    I am wondering if this would fix my admin login page? Keeps showing 404 error and not the login page. I don’t have issues with a 404 error on pages and post. I think it might be conflicting plugin I’m using called Hide MyWp, but they told me its working and reset the settings anway and said it’s beyond their plugin control.

  19. LaVonne Carlson

    Thank you! This worked for me. I did have to change the Common Settings from “Custom Structure” to “Post name”, but once I did that my blog came back.

  20. Nick

    I followed your instructions, but I still get the “white page of death” with my posts. Is there a way to actually remove “index.php”?

    • WPBeginner Support

      Hi Nick,

      The index.php file is crucial for your WordPress site to work properly. If you think it is causing the issue, then you can download a fresh copy of WordPress, unzip on your computer, locate the index.php file and upload it to your website replacing the old file.

      Admin

  21. Malik aadil

    Thanks so much
    It helped me to solve 404 error problem

  22. srinivas

    i dont know how to thank you…it really helps and solved my problem…thanks ….lovely post

  23. Demari

    Thank you so much for this!

  24. Christina

    Thank you very much! Your help solved the problem!

  25. Rafi ullah

    Hi every one..
    i have a website which is working properly but when i login to admin panel and want to edit a page it show me a error that “page not found” but in the front end it look fine this error show only on editing time ..
    please help me i am stuck
    Thanks in advance

  26. Jeremy

    THANK YOU SO MUCH! I’ve tried everything else thinking it was a timing error. You saved me lots of time.

    Thank you again!

  27. Serguei Kireev

    didn’t work for me. installed Yoast SEO, noticed it defaulted to weird permalinks with /index.php/ in them, went to change that to normal way – no more permalinks for me… only works via ?p=123

  28. mudi

    Hi, you guys are great it’s work for me

  29. Vikash

    Thanks, Its worked perfectly.

  30. Karen Holst

    You guys are the best!

    I always find your tutorials to be just what I need to update/fix my WordPress site!

    Regarding the 404 not found issues, I had some template pages (I purchased a WordPress theme from a vendor and had some live pages hidden that I wasn’t using) that were getting indexed that I didn’t want indexed. So I changed the pages to “unpublished” in WordPress.

    I ran an analysis on indexability and now all those pages are showing “404 Not Found” errors.

    Do you all suggest a way to keep these pages from being indexed altogether? What is the best practice for fixing something like this?

    Thank you again for all the great work you all do!

  31. Shahidul Islam

    Thanks So much! It works great!

  32. Azizul Haque

    Thanks, This worked for me too!

  33. Mark Quinn

    Many thanks. This worked a treat.

  34. vishnu

    Hi
    please help to fix the following.
    while submitting a comment in my webpage its working properly but after 3 or more submission it showing 404 page not found
    how can i fix this problem without using a plugin.

  35. Munesh Dagar

    wow,
    this is very helpful.. my website is not not load page cause of URL not found
    i am go to permalinks & select other links & again i selected postname & save settings my website is work properly

  36. zhivko

    The update in Settings Permalink worked perfectly for me.

  37. danny

    I had the problem with the permalinks and fixed the issue by saving as a plain permalink then saving as custom permalink. that worked but I am having a problem with the permalinks issue again. i fixed it by doing the above step again. is there a way to avoid it happening again. thanks!

  38. Milos Mitrovic

    Hello guys,
    I have the same problem, some pages appear as ‘not found’ but they are present in wordpress. Check this one:
    I have updated permalinks but it didn’t work.
    I wouldn’t dare accessing my FTP and would like to know if there is any other way to change it? I use hosted wordpress.
    Thanks

  39. Jheel

    Hey,
    I am getting error for rest of my pages , excluding the home page. The images & the videos are not visible. I have done all the required steps. Kindly help me out.

    • jora

      same probleme did you find any solution yet ? Thank you

  40. Kimberly

    Thank you so much!! Flushing the rewrite rules worked.

  41. Hemant Pandey

    It helped. Very nice. Can you suggest best permalink structure? Also how to get social counts back after changing permalink structure?

  42. Himaja

    I am trying to add the wordpress blog as a subdirectory in nginx server. Added blog under cakephp/app/webroot/blog . Main page works fine but not the post links and sublinks. Shows not found error. I tried your post but no result. Can you please help me to sort out this?

    Thanks.

  43. Mike

    Hello, I tried just about everything
    1. Deleted and uploaded new htaccess file
    2. Checked robots.txt
    3. Checked sitemap
    4. Disabled all plugins
    5. Checked google console
    6. Checked to see if my site is blacklisted
    Google will not communicate with my site all at.
    I only get “403 forbidden error”. I couldn’t even verify my site ownership with google until I verified through the “cname card”.
    During 1 test I did get a “200 server error”. Please help

  44. Lucky

    Many thanks for you help. It worked my site is back.

  45. Jill

    Hello! I downloaded the htaccess file and copy/pasted. I am still getting the 404 errors on my blog. Not sure what else to try. Any ideas?
    Thank you,
    Jill

  46. Dias, Wesley S.

    THANKS!!!!! Very much.

  47. Phoks

    not work :-( same probleme halp me please

  48. tauseef shah

    thank you so much buddy, it really help me

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.