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

Jak naprawić błąd 404 Sitemap WordPress SEO Yoast?

Radzenie sobie z błędem 404 w twojej mapie witryny Yoast SEO w WordPress może być frustrujące. Yoast SEO jest popularnym narzędziem, ale czasami konflikt wtyczek lub nieprawidłowe ustawienia mogą powodować ten błąd.

Tak więc, jeśli spróbujesz przejść na twoją mapę witryny XML i zobaczysz błąd 404, może cię to zatrzymać. Ale nie martw się, istnieją łatwe poprawki.

W WPBeginner napotkaliśmy i rozwiązaliśmy ten problem, jeśli nie sto razy. W tym artykule poprowadzimy Cię krok po kroku, jak poprawić błąd 404 w mapie witryny Yoast SEO. Postępuj zgodnie z instrukcjami, aby twoja mapa witryny znów działała płynnie.

Fixing Yoast SEO XML sitemap 404 error in WordPress

Co powoduje błąd 404 mapy witryny Yoast SEO w WordPress?

Mapa witryny Yoast SEO pomaga wyszukiwarkom znaleźć wszystkie treści na twojej witrynie internetowej, które mają zostać znalezione i zindeksowane.

Poprawka tego błędu zapewnia wyszukiwarkom dostęp do twojej mapy witryny i odkrywanie wszystkich stron i treści w twojej witrynie. Może to prowadzić do lepszej widoczności i rankingu w wyszukiwarkach, a także pomoże w szybszym pozycjonowaniu twojej treści niż bez mapy witryny.

WordPress ma domyślną mapę witryny XML, którą można przesłać do Google Search Console i innych wyszukiwarek.

Tę mapę witryny XML można przejść na stronę wpisując następujący adres URL w pasku adresu twojej przeglądarki:

https://example.com/sitemap.xml

Jednak ta domyślna mapa witryny generowana przez WordPress jest bardzo podstawowa. Aby to poprawić, wszystkie najlepsze wtyczki WordPress SEO, takie jak Yoast SEO i wtyczka All in One SEO, tworzą własne mapy witryn XML z większą liczbą funkcji.

Kiedy używasz mapy witryny XML wygenerowanej przez twoją wtyczkę WordPress SEO, wtyczka przepisuje domyślny skrót mapy witryny WordPress XML.

Oznacza to, że adres URL mapy witryny wspomniany powyżej będzie następnie wysyłał użytkowników do map witryn wygenerowanych przez twoją wtyczkę WordPress SEO.

Niestety, może to spowodować błąd 404 na niektórych witrynach internetowych z powodu konfliktów wtyczek lub nieprawidłowych ustawień WordPress.

W poniższych sekcjach pokażemy, jak łatwo poprawić błąd 404 mapy witryny WordPress we wtyczce Yoast SEO. Oto krótki przegląd wszystkich metod, które omówimy:

Gotowy? Przejdźmy od razu do rzeczy.

WordPress posiada przyjazną dla SEO strukturę adresów URL, zwaną bezpośrednimi odnośnikami. Ta struktura adresów URL wykorzystuje system przekierowań, aby powiedzieć twojemu serwerowi WWW, którą stronę wczytywać, gdy użytkownik wpisze adres URL w przeglądarce.

Zazwyczaj ustawienia bezpośrednich odnośników są automatycznie aktualizowane po wprowadzeniu zmian w twojej witrynie internetowej.

Zła wiadomość jest taka, że czasami WordPress nie jest w stanie odświeżyć struktury permalinków, co może powodować wyświetlanie błędu 404 mapy witryny Yoast SEO.

To powiedziawszy, można to łatwo poprawić, przechodząc do strony Ustawienia ” Permalinki z obszaru administracyjnego WordPress i po prostu klikając przycisk „Zapisz zmiany”.

Update permalinks

Spowoduje to odświeżenie ustawień bezpośredniego odnośnika WordPress. Możesz teraz przejść na stronę Twojej sitemapy XML, aby sprawdzić, czy poprawiło to Twój problem.

Jeśli to nie poprawiło problemu, to można czytać dalej.

Jeśli odświeżenie struktury permalinków WordPressa nie poprawi błędu 404, możesz ręcznie nakazać serwerowi WWW przekierowanie użytkowników na stronę mapy witryny Yoast SEO.

Aby to zrobić, musisz dodać następujący kod do twojego pliku .htaccess.

# Yoast SEO - XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 [L]
# END Yoast SEO - XML Sitemap Rewrite Fix

Uwaga: Jeśli twoja witryna internetowa WordPress jest zainstalowana w podkatalogu lub katalogu (np. https://example. com/mywebsite/ ), musisz użyć następującego kodu.

# Yoast SEO - XML Sitemap Rewrite Fix
RewriteEngine On
RewriteBase /mywebsite/
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 [L]
# END Yoast SEO - XML Sitemap Rewrite Fix

Nie zapomnij zastąpić /mywebsite/ nazwą twojego podkatalogu.

Ten kod po prostu mówi twojemu serwerowi WWW, które strony mają być wyświetlane, gdy użytkownicy uzyskują dostęp do map witryn XML Yoast SEO.

Możesz teraz spróbować zobaczyć twoją mapę witryny XML, aby sprawdzić, czy rozwiązuje to twój problem.

3. Przejście na wtyczkę XML Sitemaps

Jeśli powyższe metody nie rozwiązały błędu 404 na stronie mapy witryny XML Yoast SEO, możesz spróbować użyć osobnej wtyczki do generowania map witryn XML dla twojej witryny internetowej. Dobrą wtyczką do tego celu jest XML Sitemaps plugin.

Wadą tego podejścia jest to, że będziesz musiał polegać na oddzielnej wtyczce do generowania map witryn XML i Yoast SEO dla innych funkcji SEO.

Najpierw należy zainstalować i włączyć wtyczkę XML Sitemaps. Więcej szczegółów można znaleźć w naszym przewodniku krok po kroku, jak zainstalować wtyczkę WordPress.

Ponieważ korzystasz z Yoast SEO, automatycznie otrzymasz powiadomienie o wyłączeniu wtyczki XML Sitemaps lub funkcji map witryn Yoast SEO.

Yoast SEO XML Sitemap conflict warning

Następnie możesz kliknąć przycisk „Toggle Yoast SEO’s XML Sitemap”, aby kontynuować.

Spowoduje to przejście do karty „Funkcje” w sekcji SEO ” Ogólne. W tym miejscu należy przewinąć w dół do opcji „Mapy witryn XML” i wyłączyć ją.

Disabling XML sitemaps in Yoast SEO

Nie zapomnij kliknąć przycisku „Zapisz zmiany”, aby zapisać twoje ustawienia.

Możesz teraz przejść do strony Ustawienia ” XML-Sitemap, aby skonfigurować twoją mapę witryny. W przypadku większości witryn internetowych ustawienia domyślne będą działać po wyjęciu z pudełka.

XML Sitemaps settings

Zawsze jednak możesz skonfigurować ustawienia w oparciu o twoje potrzeby.

Teraz można przesłać adres URL mapy witryny XML do konsoli wyszukiwania Google i innych wyszukiwarek.

Sitemap URL

4. Przejdź na All in One SEO for WordPress

Jeśli wszystkie powyższe sposoby zawiodą i nie chcesz używać oddzielnej wtyczki do generowania map witryn XML, ta metoda może pomóc poprawić problem z błędem mapy witryny 404.

Do tej metody będziesz potrzebować All in One SEO for WordPress. Jest to najlepsza wtyczka WordPress SEO na rynku i znacznie lepsza alternatywa dla Yoast SEO.

Więcej szczegółów na temat różnic można znaleźć w naszym porównaniu Yoast vs All in One SEO.

All in One SEO (AIOSEO) zawiera zaawansowane mapy witryn XML i łatwe w zarządzaniu opcje, które dają pełną kontrolę nad tym, co ma być w nich uwzględnione lub wykluczone.

Najpierw zainstalujmy i włączmy wtyczkę All in One SEO for WordPress. Aby uzyskać więcej informacji, zobacz nasz przewodnik krok po kroku, jak zainstalować wtyczkę WordPress.

Uwaga: Istnieje również darmowa wersja All in One SEO for WordPress, która zawiera większość funkcji mapy witryny z filmami XML, z wyjątkiem filmów i wiadomości.

Po włączaniu wtyczka przeprowadzi Cię przez kreator konfiguracji. Jeśli potrzebujesz pomocy podczas konfiguracji, postępuj zgodnie z naszym przewodnikiem, jak poprawnie skonfigurować wtyczkę All in One SEO dla WordPress.

All in One SEO setup

All in One SEO pozwoli również importować dane SEO z Yoast SEO.

Dzięki temu wszystkie twoje poprzednie meta tagi i tytuły SEO pozostaną niezmienione.

Import Yoast SEO data

Po wstępnej konfiguracji można przejść do strony All in One SEO ” Sitemaps, aby skonfigurować ustawienia mapy witryny XML.

Możesz kliknąć przycisk „Otwórz mapę witryny”, aby sprawdzić, czy poprawiono błąd 404 mapy witryny w WordPress.

All in One SEO sitemaps settings

Następnie w razie potrzeby należy skonfigurować ustawienia mapy witryny.

All in One SEO pozwala na przykład wybrać, co ma być zawarte w twojej mapie witryny. Możesz dodawać lub usuwać typy treści, taksonomie, poszczególne wpisy i strony.

All in One SEO sitemaps advanced settings

All in One SEO umożliwia również tworzenie map witryny z filmami, wiadomościami, RSS i HTML dla Twojej witryny internetowej.

Wystarczy przejrzeć jego karty, aby sprawdzić, czy chcesz skonfigurować więcej ustawień.

Additional sitemaps settings

Te mapy witryn mogą być również przesyłane do Google Search Console i innych wyszukiwarek. Pomaga to wyszukiwarkom szybko znaleźć nowe treści na twojej witrynie internetowej.

Porada eksperta: Nie chcesz sam poprawiać tego błędu WordPressa? Nie martw się – mamy dla Ciebie rozwiązanie! Pożegnaj się z frustrującymi błędami i skup się na tym, co kochasz. Pozwól nam zająć się sprawami technicznymi i zarezerwuj naszą awaryjną pomoc techniczWordPress już teraz!

Mamy nadzieję, że ten artykuł pomógł ci poprawić błąd Yoast SEO Sitemap 404 w WordPress. Następnie możesz również zapoznać się z naszym kompletnym przewodnikiem rozwiązywania problemów WordPress lub zobaczyć, jak poprawić typowe błędy WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Ujawnienie: Nasze treści są wspierane przez czytelników. Oznacza to, że jeśli klikniesz na niektóre z naszych linków, możemy otrzymać prowizję. Zobacz jak WPBeginner jest finansowany, dlaczego to ma znaczenie i jak możesz nas wspierać. Oto nasz proces redakcyjny.

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.

Najlepszy zestaw narzędzi WordPress

Uzyskaj BEZPŁATNY dostęp do naszego zestawu narzędzi - zbiór produktów i zasobów związanych z WordPressem, które każdy profesjonalista powinien mieć!

Reader Interactions

243 komentarzeZostaw odpowiedź

  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. Reyhan Emilia

    Thank you because yoast had brought me to an impossible point. I will always read your blogs. You are perfect.

    • WPBeginner Support

      You’re welcome, glad we could help!

      Administrator

  3. Scott Baranek

    Thank you so much for this article!!! I have been speaking with multiple people and support teams and I always knew it was something easy. Article was broken down for easy understanding as well. Thank you!!!

  4. Mark the martian

    Thanks so much for explaining. Was pulling my hair out over this.

    • WPBeginner Support

      Glad our guide was helpful :)

      Administrator

  5. ahmed

    try to delete caches after first solution and it will work

    • WPBeginner Support

      Thanks for sharing your recommendation :)

      Administrator

  6. Deepak kumar

    Due to this tutorial. My issue fix thankyou so much………..

    • WPBeginner Support

      You’re welcome, glad our guide could be helpful :)

      Administrator

  7. Adam

    I was getting the same 404 error and the first solution solved the issue for me.
    Many thanks!

    • WPBeginner Support

      You’re welcome, glad our guide was helpful :)

      Administrator

  8. Binod Raj Joshi

    Hey, wpbeginner, I was in sitemap trouble from a few days, now it have been solved. Learning a lot from you guys about wp error fixing, thanks!

    • WPBeginner Support

      You’re welcome, glad our guide could help :)

      Administrator

  9. saurab

    Hi
    After moving to https from http, Sitemap address is displaying 404 error, Is it possible know the solution for this ?

  10. Ashish Sharma

    Nice pluging , but when I am creating sitmap using yoast and submitting it to webmaster it is showing 404 error for multiple urls. I searched in my site no where those urls exist. But y these are coming into sitemap I don’t understand any expert to help me

  11. RAJEEV KUMAR

    Sir, In my WordPress blog, 410 Response code error are showing in Yoast SEO’S Search Console feature. How I fix It.

  12. Tracy Pope

    I tried to download the Yoast SEO plug in and I received this error message:

    Fatal error: Call to undefined function apply_filters_deprecated() in /websites/websitename/wp-content/plugins/wordpress-seo/admin/menu/class-admin-menu.php on line 246

    I now can’t get into my back end of the website at all I just keep getting this error? What can I do??

    • WPBeginner Support

      Hi Tracy,

      You need to connect to your website using FTP or File Manager app in your cPanel account. Go to wp-content/plugins/ and delete wordpress-seo folder. After that you will be able to login to your WordPress admin area and reinstall the plugin.

      Administrator

  13. Amit

    Hi,

    To edit the .htaccess file do we need to remove the existing code and add your code

    or

    keep the existing code and add your code also?

    Need help.

  14. Keitai

    hmm,

    Tried every suggestion but still got a 404. somehow i can’t redirect xml html htm php file extensions.

    when i try
    RewriteRule ^sitemap_index.xl$ /site/index.php?sitemap=1 [L] and not
    RewriteRule ^sitemap_index.xml$ /site/index.php?sitemap=1 [L]

    Hence, i removed the „m”, and the redirect works but sitemap_index.xml doesn’t

    Any more tips?

  15. Carol

    I did the first option and now I have an internal server error!

  16. Tony

    Thanks for listening. I got the solution cheers

  17. Tony

    @wpbeginner support. I have already gotten the sitemap, the issue when I submit it to google for test it bring out an error http 404. I have read your post on how to edit .ht access file and wp seo. I have also check and unchecked the yoast plugin. But it hasn’t resolved the http 404. Please help

  18. Tony

    i just opened a new WordPress site. I have tried everything still the site app generated by yoast seo is still showing http 404 error. What do I do. The website is . please note I have edited my .htaccess file, edited wp-content/Wordpress. Pap, unchecked and checked site map settings for seo, saved permalinks. I even used a free sitemap generator upload the file via my Cpanel but still am getting the same error

  19. nageswarao

    hi bro my website Google XML Sitemaps not showing last 5 months (sitemap-pt-post-2016-06.xml end after not showing) and also sitemap-tax-post_tag.xml not showing how to solve my problem

  20. Brandon Still

    This worked for me, thank you!!!

  21. Nik

    Thanks! I was having the hardest time getting it to work and the first section with the .htaccess code did the trick!

  22. Andy Johnston

    Worked for me. Thank you!

  23. Kunal Sarkar

    Hi all,

    I was facing the same problem while I came across this blog post. But I guess I found a better solution for non-tech guys.

    You can simply install JetPack from WordPress and Activate its Sitemap functionality and disable the Sitemap of Yoast. Additionally Jetpack has a lot of essential features that I guess every WP admin should have.

    Thanks,
    Kunal Sarkar

  24. Shivam

    For me there is a different issue. Its just showing plain text instead of links. Can some one help please

  25. Naman Kumar

    Hey, I’m using the same code goy fixing yoast xml sitemap but what to do for google analytics by yoast?

  26. Mohammed Jhosawa

    Hi Guys,

    Please follow this steps if you are facing 404 error issue with Yoast XML Sitemap :

    1. Go to > Yoast SEO Plugin.
    2. Yoast SEO Plugin > XML Sitemap.
    3. Uncheck the user XML Sitemap functionality > Save Changes.
    4. Again Check XML Sitemap functionality > Save Changes.
    5. Click on XML Sitemap and you’ll see your sitemap_index.xml right there.

    Hope this information is useful to you.

    Thanks.

    • Alx Diesel

      @Mohammed Your suggestion worked. Thanks a lot.

    • Amar

      Thnks bro this worked for me.

    • Mr. Dif

      This worked for me also although I did implement the .htacess change as well.

    • Mohammed

      Your idea was good and thanks a lot

  27. Felix

    Yo here is an easy way to fix it and should work fine for all!

    Go to settings in wordpress

    Select permalinks

    Don’t change anything

    Just Press save changes at the bottom of the page

    Now click on your XML Site Map button again in Yoast

    404 error should no longer show

    You welcome homies

    • Pankaj

      Yah This is fixed! Thanks a lot!

    • Christian

      thanks man, this worked.

    • Grant

      Reply to say that this method worked for me. Just go to permalinks page in settings, and click save.

  28. Deborah

    Thank you so much! Worked like a charm to reduce the number from 1000 to 100.

  29. Tim

    Simply untick „Check this box to enable XML sitemap functionality.” in the SEO plug-in and Save Changes, then renable again. Problem solved.

  30. Arshad

    Thanks Joshua
    Had the same problem. Changing the rows from 1000 to 100 will fixed it for me.

    • Klick

      Thx i have change it too from 1000 to 100 now it work Thanx

    • Ridfay

      Now work with this tips thanx

  31. Miro

    After adding the first code to your htacces file disable sitemap functionality flush your cache (if you use any of caching tools like w3 total cache) and then enable the functionality again.
    It worked for me that way.

    Thank you for the tutorial! It helped!

  32. aaron

    I seem to be getting this for my posts. I suspect yoast is deleting my .htaccess file.

  33. Jeremy Vandermeer

    Unchecking and rechecking the XML SItemap option also worked for me. Thanks!

  34. Joe

    Hey guys. I fixed it! I turned this sitemap option off in this flawless plugin and used a different plugin. It was that easy. It was probably my crummy theme though. Probably.

  35. Atanas Tanev

    Ok guys. I was struggling with this issus for a day or so and finally I found the solution!

    Skip the mentioned plugins and the codes which may harm your website. I’ve tried everything!

    Simply uncheck the „remove strip” from yoast plugin and instead of this option just download and install the plugin: „Remove Category URL” from wordpress plugin section.

    The plugin supports WPML and sitemaps and the 404 error is fixed!

    Now you can buy me a beer for saving all your headaches!

    Cheers!

    Atanas Tanev

    • Nirav Dave

      Hey ATANAS!

      No way man! This solution worked for me mate. Thank you so much for sharing this.

      Nirav

  36. Bas

    i placed the code in my .htaccess file and saved it. Now every page gives a 500 internal server Error!!!
    What can i do?

    • Jay

      Same with me!!!? Have you managed to fix this?

    • Miles O'Brien

      What I did was I went to the xml sitemap page under the SEO plugin and under user sitemap I unchecked disable user sitemap. then when I put in the sitemap into webmasters it worked successfully. I can’t help you with your 500 internal error, But if you do this fresh it should work instead of using the code.

    • Rafael

      BAS: Remove the code you entered into your.htaccess file, resave it to the server and reload the website.

  37. Henry

    If anyone is using iThemes security plug in and has set it to guard the .htaccess file, disable it and create your sitemap, then re-enable.

  38. Rami Alloush

    Uncheck then re-check indeed solved that for me.
    Thanks

    • Chris

      LOL This worked for me too. I looked at 25 pages before I saw your comment.

  39. Nikos Kavvadas

    I add the code in the .htaccess and then i uncheck the sitemap option in the Yoast’s SEO plugin and save their settings. After that i re-checking the sitemap’s option and the the error is solved!

    Thanks!

  40. Henk Valk

    Thanks Joshua
    Had the same problem. Changing the rows from 1000 to 100 will fixed it for me.

  41. Morteza

    Thanks a lot, but not works for me. I do all of these ways and check/save/uncheck/save/XML Sitemap process after one & both of them… but ERROR 404!
    I’ll try another plugins for this.
    thanks for your great site..

  42. TimValDen

    Worked for me too… I had the 404page problem when loading the sitemap generated by Yoast SEO.

  43. Joshua Largent

    This is what worked for me – Go to the yoast XML sitemap on your dashboard. Change the Max Entries per sitemap from 1000 to 100. Worked like a charm for me. :)

    • Tony

      Easy does it again, change from 1000 to 100 did the job, without changing the code. Thank You!

  44. onarto

    It looks like htaccess edition disappear since yesterday… nothing in the menu anymore…

  45. Adrienne McCue

    Just checking and unchecking takes care of the issue. I will check this plugin out now! I did so much seo before, but I like so many features here!

  46. David Bell

    I found the same thing as Jane below. Thank you!

  47. smaug

    adding the following code to my .htaccess fixed the sitemap for me:

    https://gist.github.com/jdevalk/5345872

    (note this code is for if your wordpress installation is in a subdirectory named wordpress, if your is in a different folder, change the directory name in the code)

  48. Awais

    i have photography website . Should i uncheck the exclude media option or it’s ok?

Zostaw odpowiedź

Dziękujemy za pozostawienie komentarza. Pamiętaj, że wszystkie komentarze są moderowane zgodnie z naszymi polityka komentarzy, a Twój adres e-mail NIE zostanie opublikowany. NIE używaj słów kluczowych w polu nazwy. Przeprowadźmy osobistą i konstruktywną rozmowę.