• Resolved amcburney2232

    (@amcburney2232)


    Hi, I am getting a 404 error on my sitemap. I was using SEO Press which was also giving me a 404 – so I switched to SEO Framework and it seemed to work fine. Now when I check it, I am seeing a 404 error.

    I have tried flushing cache and also saving permalinks. My server is NGINX. I am also on Cloudflare if that matters.

    Is there a known way to fix this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    There’s probably another plugin messing with the rewrite API.

    We utilize WordPress’ Rewrite API to register the virtual sitemap (there’s no file). Essentially, this works by telling WordPress early that we want to output the sitemap at ‘/sitemap.xml’, and then enforcing that registration by “flushing” the rewrite system.

    However, when the rewrite system is flushed too early by another plugin (or theme), our registration is removed. Thus, the sitemap will not load: a 404 error occurs.

    There’s no “easy” fix for this because you’ll have to dive into all the plugin’s code and backtrace which one is doing it wrong. Red herrings are easy to catch in this process, too; so even when you think it’s fixed, the issue may reappear almost at random.

    This is a common issue because WordPress never set strict rules using the rewrite API. We’ve been waiting for years for a solution, alas to no avail… So, we decided to step out of the system. This change is put into effect for The SEO Framework v4.0. Stay tuned!

    Thread Starter amcburney2232

    (@amcburney2232)

    I will review plugins and themes and see what is causing it, if anything. Thanks!

    Thread Starter amcburney2232

    (@amcburney2232)

    I uninstalled all plugins and reverted to a WP native theme (2019 theme) but still getting the error. : /

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @amcburney2232

    My apologies, I sent you on a wild-goose chase… I never told you how to debug this ??

    EDIT: Before you continue, you mentioned NGINX. If you go to sitemap.xml, are you redirected to sitemap_index.xml? If so, then Yoast SEO rules are active on your server.

    If not, then let’s continue…

    When you deactivate a plugin, the rewrite engine may not always be flushed directly. It is up to the plugin author to do. TSF does this, but others may not. This inconsistent behavior is part of the “red herring” I spoke about.

    To see if deactivating a plugin works, go to /wp-admin/options-permalink.php and hit “Save Changes.” More often than not, this fixes the output (maybe only temporarily, red herring!).

    But, it’s nearly impossible to debug this issue without diving into all the code. Even then, the most you can do is notify the plugin author.

    Again, even if you think it’s fixed, the issue may come back sporadically; plugins tend to flush the rules whenever they deem necessary. For TSF, we flush the rules when you save the SEO settings, for example.

    I think you’re best off waiting for The SEO Framework v4.0; whereafter this issue won’t recur… at least, for the sitemap. The ETA for v4.0 is the last week of this month.

    • This reply was modified 5 years, 6 months ago by Sybre Waaijer. Reason: Yoast SEO?
    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @amcburney2232,

    We just released The SEO Framework v4.0, wherein we changed how the sitemap is outputted. The issue seems to stem from Yoast SEO’s broken NGINX rules. This is now accounted for.

    So, I believe it should be working now!

    P.S. In the future, please supply a URL to the page you’re encountering issues with. It really helps to stop speculation ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘404 error’ is closed to new replies.