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

YoastのWordPress SEOサイトマップ404エラーを修正する方法

WordPressのYoast SEOサイトマップに404エラーが表示されると、イライラすることがあります。Yoast SEOは人気のあるツールですが、プラグインの競合や誤った設定がこのエラーを引き起こすことがあります。

そのため、XMLサイトマップにアクセスしようとしたときに404エラーが表示されると、足が止まってしまいます。でもご心配なく、簡単に修正できます。

WPBeginnerでは、100回とは言わないまでも、この問題に遭遇し、解決してきました。この投稿では、Yoast SEOのサイトマップ404エラーを解決する方法を順を追って説明します。サイトマップを再びスムーズに動作させるために、ぜひお付き合いください。

Fixing Yoast SEO XML sitemap 404 error in WordPress

WordPressのYoast SEO Sitemap 404エラーの原因は?

Yoast SEO サイトマップは、検索エンジンがあなたのサイト上のすべてのコンテンツを見つけ、インデックスさせるのに役立ちます。

エラーを修正することで、検索エンジンがサイトマップにアクセスし、サイト内のすべてのページとコンテンツを発見できるようになります。これにより、検索エンジンからの視認性と順位が向上し、サイトマップがない場合よりもコンテンツの順位が早く上がります

WordPressには、Google Search Consoleやその他の検索エンジンに送信できるXMLサイトマップが初期設定されています。

このXMLサイトマップは、ブラウザーのアドレスバーに以下のURLを入力することで閲覧できます:

https://example.com/sitemap.xml

しかし、この初期設定のWordPressが生成するサイトマップは非常に基本的なものです。これを解決するために、Yoast SEOやAll In One SEOプラグインのようなWordPressのトップSEOプラグインはすべて、より多くの機能を備えた独自のXMLサイトマップを作成します。

WordPress SEOプラグインが生成したXMLサイトマップを使用すると、プラグインはWordPress XMLサイトマップの初期設定のショートカットを書き換えます。

つまり、上記のサイトマップURLは、WordPress SEOプラグインによって生成されたサイトマップにユーザーを送ることになる。

残念ながら、プラグインの競合やWordPressの設定が正しくないために、サイトによっては404エラーが 発生することがあります。

以下のセクションでは、Yoast SEOプラグインでWordPressサイトマップの404エラーを簡単に修正する方法をご紹介します。ここで取り上げるすべての方法を簡単に説明します:

準備はいいかい?さっそく始めよう。

WordPressには、パーマリンクと呼ばれるSEOに適したURL構造が用意されています。このURL構造は、リダイレクトシステムを使用して、ユーザーがブラウザーにURLを入力したときにロードするページをウェブホスティングサーバーに伝えます。

通常、これらのパーマリンク設定は、サイトに変更を加えると自動的に更新されます。

悪いニュースは、WordPressがパーマリンク構造を更新できないことがあり、Yoast SEOのサイトマップ404エラーが表示されることがあるということです。

これは、 WordPress管理エリアから設定 ” パーマリンクの ページに行き、「変更を保存」ボタンをクリックするだけで簡単に修正できます。

Update permalinks

そうすることで、WordPressのパーマリンク設定が更新されます。これでXMLサイトマップのページにアクセスして、問題が解決したかどうかを確認できます。

それでも問題が解決しない場合は、このまま読み進めても構わない。

WordPressのパーマリンク構造をリフレッシュしても404エラーが直らない場合は、手動でユーザーをYoast SEOのサイトマップページにリダイレクトするようウェブサーバーに指示することができます。

そのためには、.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

注: WordPressサイトがサブディレクトリまたはフォルダー(例:https://example.com/mywebsite/ )にインストールされている場合は、以下のコードを使用する必要があります。

# 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

mywebsite/をあなたのサブディレクトリ名に置き換えることを忘れないでください。

このコードは、ユーザーがYoast SEOのXMLサイトマップにアクセスした際に、どのページを表示させるかをウェブサーバーに伝えるだけです。

XMLサイトマップを表示し、問題を解決するかどうかを確認することができます。

3.XML Sitemapsプラグインに切り替える

上記の方法でYoast SEOのXMLサイトマップページの404エラーが解決されなかった場合は、XMLサイトマップを生成するプラグインを区切りとして使用してみてください。そして、これに適したプラグインがXML Sitemapsプラグインです。

この方法の欠点は、XMLサイトマップを生成するプラグインと、その他のSEO機能をYoast SEOに区切らなければならないことだ。

まず、XML Sitemapsプラグインをインストールして有効化する必要があります。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

Yoast SEOを使用しているため、XML SitemapsプラグインまたはYoast SEOのサイトマップ機能を無効化する通知が自動的に届きます。

Yoast SEO XML Sitemap conflict warning

そして、「Toggle Yoast SEO’s XML Sitemap」ボタンをクリックして次に進みます。

すると、SEO ” Generalの下にある’Features’タブが表示されます。ここから、「XMLサイトマップ」オプションまでスクロールダウンし、設定をオフにする必要があります。

Disabling XML sitemaps in Yoast SEO

変更を保存」ボタンをクリックして、設定を保存することを忘れないでください。

これでSettings ” XML-Sitemapページに切り替えてサイトマップを設定することができます。ほとんどのサイトでは初期設定で問題ありません。

XML Sitemaps settings

しかし、あなたのニーズに応じていつでも設定を変更することができる。

これで、XMLサイトマップのURLをGoogleサーチコンソールやその他の検索エンジンに送信できるようになりました。

Sitemap URL

4.All In One SEO for WordPressに切り替える

上記の方法がすべてうまくいかず、XMLサイトマップを生成するプラグインを区切りたくない場合は、この方法でサイトマップ404エラーの問題を解決できるかもしれません。

この方法には、All In One SEO for WordPressが必要だ。これは市場で最高のWordPress SEOプラグインであり、Yoast SEOの代替となるものだ。

詳細な違いについては、YoastとAll In One SEOの比較をご覧ください。

All-in-One SEO (AIOSEO)は、高度なXMLサイトマップと管理しやすいオプションを備えており、XMLサイトマップに含めるもの、除外するものを完全にコントロールすることができます。

まず、All In One SEO for WordPressプラグインをインストールして有効化しましょう。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

注: All In One SEOfor WordPressには無料版もあり、動画とニュースを除くほとんどのXMLサイトマップ機能が含まれています。

プラグインを有効化すると、セットアップウィザードが表示されます。セットアップ中にヘルプが必要な場合は、WordPress用All In One SEOプラグインを正しくセットアップする方法についてのガイドに従ってください。

All in One SEO setup

All In One SEOでは、Yoast SEOからSEOデータをインポートすることもできます。

これにより、以前のSEOメタ情報とタイトルがすべて変更されないようになります。

Import Yoast SEO data

初期設定後、All In One SEO ” SitemapsページでXMLサイトマップの設定を行うことができます。

サイトマップを開く」ボタンをクリックして、WordPressのサイトマップ404エラーが修正されたかどうかを確認できます。

All in One SEO sitemaps settings

その後、必要に応じてサイトマップの設定を行う。

例えば、All In One SEOでは、サイトマップに含めるものを選択することができます。投稿タイプ、タクソノミー、個々の投稿、ページを追加または削除することができます。

All in One SEO sitemaps advanced settings

All In One SEOでは、動画、ニュース、RSSサイトマップHTMLサイトマップも作成できます。

より多くの設定を行いたい場合は、タブを探せばいい。

Additional sitemaps settings

これらのサイトマップは、Google Search Consoleやその他の検索エンジンにも送信することができます。これは、検索エンジンがあなたのサイトの新しいコンテンツを素早く見つけるのに役立ちます。

専門家のアドバイス WordPressのエラーを自分で直したくないですか?ご心配なく!イライラするエラーとはおさらばして、好きなことに集中しましょう。WordPressの緊急サポートを今すぐご予約ください!

この投稿がWordPressのYoast SEO Sitemap 404エラーの解決にお役に立てば幸いです。次に、WordPressトラブルシューティングの完全ガイド、または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.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

アバター

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.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

242件のコメント返信を残す

  1. D Moran

    I just bought the Genesis Framework theme and then installed the yoast seo plugin and activated. I then tried to generate my sitmap and get this same 404 error.

    “Not found, error 404
    The page you are looking for no longer exists. Perhaps you can return back to the site’s homepage and see if you can find what you are looking for. Or, you can try finding it by using the search form below.”

    Does this mean that the theme I got from Genesis is badly coded? Did I waste my money??

    • WPBeginner Support

      It is highly unlikely, Genesis Child Themes purchased from StudioPress are very well coded. Try deactivating all your plugin to find out if a plugin is causing this issue.

      管理者

      • Chris Sparks

        I had a similar issue after installing Yoast SEO. I deactivated the plugin, then restarted and the URL system picked up and started working as expected. This seems to be related to how the permalink structure is set up as only one of our sites has experienced this issue.

        Thanks for posting!

  2. Kase Dean

    I don’t know what just happened.

    But that fixed it!

    Thank you :-)

  3. john

    hello I tried fixing the 404 error code and now I get the following messege:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    and after that i remove the folder of plugin seo and nothing is working again what can i do???

  4. Eoin Healy

    Another easy way to fix the sitemaps is to simply disable sitemap functionality and enable it again…. works for me every time, doesn’t matter what plugins i have installed.

    In Admin, to go SEO > XML SItemaps
    Under ‘XML Sitemap’ uncheck ‘Check this box to enable XML sitemap functionality.’, hit save, check the box again and hit save.

    • Brent G

      Eoin, Thanks for the great solution!!!!

    • George

      This worked for me as well. Thanks!

    • Fred Higson

      This worked for me too! Cheers Eoin!

    • Jeremy Hogan

      So simple and yet so effective. This was the answer for me as well. Thanks!

    • Tyler

      Great solution, Eoin! Thanks so much for letting us know!

  5. Margot Barrios

    I already fixed using the first option, how would I know if it’s working already? Should I need to wait for Google’s webmaster report? This is where I saw the 404 error on my site.

  6. Eric Kuhn

    I replaced the edit files with the XML sitemap fix and completely removed what was there initially. Google webmaster tools has accepted the sitemap however, my sitemap doesn’t show a 404 or anything. Does that mean everything is ok?

  7. Melissa

    I tried fixing the 404 error code and now I get the following messege:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at artattackfx.com Port 80

    I cannot access the WP Admin Site… How can I revert to before I added this code :

    # WordPress SEO – XML Sitemap Rewrite Fix
    2

    3
    RewriteEngine On
    4
    RewriteBase /
    5
    RewriteRule ^sitemap_index\.xml$ /index.php?sitemap=1 [L]
    6
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
    7

    8
    # END WordPress SEO – XML Sitemap Rewrite Fix

    to the htacess code in YOAST? Please Help.

    • WPBeginner Support

      As the tutorial suggests you added the code in .htaccess file on your webserver? If yes, then simply edit the .htaccess file and remove the code you added.

      管理者

      • Remi

        I thought I followed to the letter your second suggestion but have the same issue as Melissa. Now waiting for the Webhost for a solution. What about adding a warning in your second solution that it can lead to a 500 Internal Server Error.

        • WPBeginner Support

          You can also revery back by editing the file your modified through FTP. Connect to your website using an FTP client. Locate the file you modified (.htaccess or class-sitemaps.php) and remove the code you added. Alternately, you can also delete the WordPress SEO folder from your wp-content/plugins/ directory through FTP.

  8. Todd

    Thanks a lot. The first fix worked for me as well.

  9. icejava

    Thanks, I had to apply both fixes to get mine too work! Job well done.

  10. Andy

    Thank you very much for this. Works perfectly!

  11. Toni

    Can anyone advise on how to delete the post-sitemap.xml as I cannot find it in my root directory! I have turned of the generate sitemap in Yoast.

  12. Koen

    Hi,
    I have wordpress 3.6 with Avada theme and Wordpress SEO by Yoast plugin.
    First I got the 404 error page.
    Then I applied the .htaccess fix without any result.
    Then I applied the class-sitemaps.php fix, now the sitemap returns a blank page.
    What to do?
    Please help. Avada isn’t a crappy theme, I think.
    Cheers, Koen

    • Frank

      Koen,

      I’m having the same problem I was thinking it was a Nginx issue because I’m not hosting on an Apache server.

      are you hosted on a Apache server?

    • glowzar

      I know more than 1 with avada theme an the same problem.

  13. Gbenga Adebayo

    Hi,

    Appears i still have a few issues to sort out. Google webmaster reporting http 403 errors with my sitemap. I can’t find the sitemap anymore in my root folder. I can navigate to the sitemap using my browser without getting a 404 error message.

    Any suggestions or help is appreciated.

  14. Gbenga Adebayo

    Many thanks! .htaccess addition fixed the error for me

  15. Madhu

    Phew … Thanks again!
    I updated my SEO pluggin and the sitemaps had the same issue.
    I had to incorporate both the fixes.

  16. Rajesh Thakur

    Thanks First one did worked for me need to clear w3 cache after that and wait a little also disable XML sitemap checkbox and check it again

  17. Erica

    I tried the second set of instructions and it resulted in a “Fatal Error” message and I was unable to access my WP site, or even the login page. Scary!

  18. Nyla

    Hi all

    I’m an very frustrated to say that I am too getting 404 error, I’m using kriesi replete theme.

    I have tried both options however nither worked

    I’m not sure if I’m doing it write, can somebody explain…. In simple terms are we deleting and replacing the existing code on both options? Or just adding? It’s not clear or does it make a difference if the prexisting remains

    Thanks in advance

  19. Jonny R

    Awesome thanks, implementing both worked perfectly!

  20. Fin O'Suilleabhain

    Worked like a charm. Grateful for the helpful post.

  21. Ahmed Alahdal

    Thanks for the fix :)

  22. Joyce

    Thank you so much!
    this worked — had to make both changes, (edited the class-sitemaps.php file).

  23. Anudeep

    Thanks a lot!
    It worked :)

  24. Rohin

    Damn helpful.
    One of my clients had this problem and just took 5 minutes to solve the issue. Just because of this post.
    Thanks a lot.
    :)

  25. Ron MacGregor

    I am new to WordPress and have only begun a using the Canyon theme. I got the 404 message as I was attempting to install a “contact info” plugin. Does anyone know if I just begin at the very beginning again, i.e. go through my GoDaddy account to reinstall WordPress and then reinstall the Canyon theme – might that solve the 404 problem?

  26. Ricky

    Thanks for the fix!

  27. Jack Logan

    I have two sets of websites (Wordpress Multisite installs) and I have no issues with sitemaps on one of them and I get a 404 error with category_sitemap.xml on the other one.

    I tried both fixes suggested in this post, but they don’t solve the issue. The only thing that works is going to Posts -> Categories – Edit and changing from “Auto detect” to “Always include” on all categories.

    The issue here is that I have over 200 sites, and about 8 categories per page, so it would take too long to do it just to get category sitemaps, even though I could use it….

    Is there any way to mass change all the categories on WP Multisite to “Always include”. I think this would be a solution that would work for everyone.

    Thank you.

  28. Jacques Karsten

    If none of this works try create a file named sitemap_index.xml on your html root through ftp and make sure the permissions are set and the plugin should then take care of the rest.

    • Kevin

      Thanks!! your suggest worked perfectly!

      • John

        I did both and it started working. It sounds pretty obvious, but make sure if you copy and paste that you take the line numbers out. I forgot to and broke my .htaccess file for a few minutes.

  29. Hector Torres

    Hi, just wanted to give my thanks, used the second option suggested ad it fixed my 404 error. Thanks!

  30. Adam

    I’m not sure which part worked for me, but I found this page because I was getting the 404, too. I disabled the XML Sitemaps in the plugin, then enabled it and checked the boxes to exclude posts (since I only have pages). Now, it is working perfectly.

    • Prashant

      Thanks Mate Perfect ! Suggestion for Me !!!!!!!!!!!!!!!!!! Really Greatful Thanks

  31. Brad Dalton

    I think there are other issues with this plugin as well.

    The attachment pages aren’t all redirecting to the parent page which is something i noticed today.

    • Editorial Staff

      Create a ticket in the support forum. We haven’t tried that feature yet.

      管理者

  32. Michi

    No other comment since April. That has been 5 months since. I have the 404 still in Sept 2012! Was able to fix it with the .htaccess fix. Thanks for posting
    Just wondering why this is STILL an issue.

  33. Sandie Wright

    It worked for me! Open the class-sitemaps.php file located in plugins > wordpress-seo > inc folder. then find the code around line 79 and replace the old code with this new code:
    /**
    * Initialize sitemaps. Add sitemap rewrite rules and query var
    */
    function init() {
    global $wp_rewrite;
    $GLOBALS[‘wp’]->add_query_var( ‘sitemap’ );
    $GLOBALS[‘wp’]->add_query_var( ‘sitemap_n’ );
    add_rewrite_rule( ‘sitemap_index\.xml$’, ‘index.php?sitemap=1’, ‘top’ );
    add_rewrite_rule( ‘([^/]+?)-sitemap([0-9]+)?\.xml$’, ‘index.php?sitemap=$matches[1]&sitemap_n=$matches[2]’, ‘top’ );
    $wp_rewrite->flush_rules();
    }
    Then, go back to your WP admin page and then go to the SEO plugin > XML sitemaps, and then click the button again (XML Sitemap). The 404 should be replaced with your sitemaps! Easy peasy.

    • Boah

      @SANDIE WRIGHT: I followed your instructions but it did not solve my 404 problem.

  34. raviteja

    thanks you, the rewrite rule itself cured the problem of 404 not available sitemap

  35. Jody

    Thanks for jacking up my site! i tried your code and now i got a 500 internal service error i have been trying for hours to fix! thanks for making my little problem into a HUGE problem!

    • Editorial Staff

      If you are getting a 500 internal service error, you can simply undo the changes. Not sure why you would get that.

      管理者

  36. Brad Dalton

    I’m finding my sitemap gets removed everyday and then indexed again. Here’s what i get every day. http://postimage.org/image/3rb3d8qsr/932c5815/

    I don’t think it’s my theme as i’m using Genesis.

    Not sure but it may be the way my server is configured.

    • Editorial Staff

      Has to be a conflict with something else (another plugin or server settings). We are using Genesis on this site as well and do not have that issue.

      管理者

  37. Eva

    Hi!

    Thank you so much for posting this article! With the first fix, I managed to solve the 404 issue for most sitemaps, though there’s still 1 that is showing the error… Any suggestions of what to do?

    I thought about exporting the Yoast SEO settings and reinstalling the plugin to see if that does the trick. Just to be on the safe side: does exporting literally export all settings, even the page/article level SEO customizations OR only the general settings?

    Thanks!

    Eva

  38. Sara

    Thanks so much – this worked for me.

    I know you said the plugin is good, and the problem is in the theme or other plugins, but I tried disabling all plugins and switching to the twenty eleven theme, and the sitemap still gave a 404 error. The only thing that worked for me is editing the htaccess file.

    • Boah

      … and I tried the same thing. Removed all the plugins, all the themes, and tried it again: 404 error. To make it worse: I’d have an .htaccess file because of IIS. Which options are there for me?

      • Boah

        Typo: ‘I’d have an’ must be ‘I don’t have an htaccess file’

  39. Rusty Solomon

    I guess SEO Yoast recent update have sitemap problem as I cant see any sitemap on the URL the plugin provide. Let me know if any one has the same issuee and Fix.

    Also is there any good plugin avaialble as same as SEO Yoast.

    Thanks & Regarsd

  40. Jay Wylie

    Hi, I have tried the first fix, but broke my site in the process. Is there anyway to re-edit my htaccess file, to stop it causing a 500 internal server error?

    thanks

  41. Colin

    Hi Joots, I’m using the latest version of the SEO plugin. I’m going over previous posts and completeing the various fields, “Focus Keyword”, “SEO Title”, etyc, etc but after I update the post and then go back to “Edit” those fields are then blank again. I wondered how I could rectify this?

    Thanks,

    Colin
    Liverpool, UK

  42. Saki_Kawa

    The solution doesn’t resolved my issue.. I still have a blank page at post-sitemap.xml
    Does someone have a solution?? Or I need to unistall this plugin and find another one for my sitemap..

  43. Adam Parnala

    Hi, I don’t have any problems with yoast seo plug in as I’m currently using it. I just I want to ask if it is better than the all in one seo plug in? I’m just curious because I found out that a lot of blogs in my niche uses it. Which is better? the all in one seo or yoast seo? (I’m already used to yoast). Oh, can I also ask how to set multiple focus keyword in Yoast seo? because there is only one field and I can’t figure out how to set a few more keywords for it. Sorry for my questions I hope you can answer me. Thanks!

  44. yoast

    Anyone here who’s willing to test another (and better) fix with me?

    • Craig

      I’d be willing to test a better fix for this issue but I’m reluctant to commit to a timeframe as I’m not really good at keeping on top of my todo’s since my stroke. (This is one of the reasons I haven’t returned to work as a PHP coder yet.)

      And I’d be *very* interested in helping if I happen to be experiencing any of the issues cited above.

      Craig

    • Shawn Poole

      Hi,
      Yoast, if the offer is still good, I would LOVE too! I am not to savvy with all of this but would be willing to allow you to guide me :)

    • Boah

      Sure, send me an email!

  45. zifana

    thanks..i use wordpress seo,but not with sitemap,because have no idea to fix this error

  46. Stephen Cronin

    Hmm, I think the second part is going to cause the rewrite rules to be flushed on every page load, which <a href=”http://codex.wordpress.org/Rewrite_API/flush_rules”>the Codex</a> warns not to do due to performance issues:
     
    <blockquote>Because this function can be extremely costly in terms of performance, it should be used as sparingly as possible – such as during activation or deactivation of plugins or themes. Every attempt should be made to avoid using it in hooks that execute on each page load, such as init.</blockquote>
     
    I’m guessing that’s why Joost isn’t doing that by default :)
     
    Of course, I could be wrong because I don’t know his plugin well enough.

    • jonbish

      I was under the same impression when this article came through my RSS. I’m pretty sure going to your permalinks settings page would accomplish the same thing without having to flush the rewrite rules every time the page loads.

      • yoast

         @jonbish Unless you’re running a crappy plugin or theme that DOES flush on every pageload before this plugin gets a chance to get its rewrites in.

        • wpbeginner

           @yoast  @jonbish Yes we understand that this is probably a compatibility issue. Yoast sitemaps work fine on our sites. We had to do this on a client’s site.

        • yoast

           @wpbeginner  @jonbish I know YOU understand, question is: do your readers :) We’re working on a fix for these kinds of issues in core btw: http://core.trac.wordpress.org/ticket/18450

        • wpbeginner

           @yoast  @jonbish Added a note at the beginning of this article, so users understand as well :)

    • yoast

      You’re 100% right Stephen. Something else *is* doing it on each pageload, which forces this “fix”, which isn’t a fix but a workaround for a broken theme or other plugin…

      • Boah

        And now? It seems a lot of people can’t use your plugni as intended.

  47. JustinVelthoen

    Thanks! I was about to switch to All-In-One because I kept getting sitemap issues. 

  48. DrorBekerman

    Do you know what to do when the sitemap returns a blank page?

    • icejava

      Its probably not blank, just how your browser renders XML (maybe Chrome, mine does it too). View the source code of the page and you shall see the light ;)

      • Editorial Staff

        This happens for a few reasons. Either you’re running low on memory. Two the file that generates the visual layout in your /wp-content/ directory is not working properly. Perhaps because you blocked the php execution?

        管理者

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。