site map not valid

#788634
  • Resolved محمد رفعت
    Rank Math free

    i have a problem with sitemaps Incorrect http header content-type: “text/html” (expected: “application/xml”)

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    I’m sorry to hear that you are facing issues with your sitemap showing an “Incorrect HTTP header content-type” error. This error occurs when the server expects an XML sitemap during validation but receives a response of a different content type, such as HTML.

    To fix this error, you can follow these steps:

    1. Flush Permalinks:
      • Navigate to WordPress Dashboard → Settings → Permalinks.
      • Click the Save Changes button without making any changes to flush the permalinks.

    Flush Permalinks Settings

    1. Flush Sitemap Settings:
      • Go to Rank Math SEO → Sitemap Settings in your WordPress admin area.
      • Change the value in the Links Per Sitemap field.
      • Click the Save Changes button at the bottom of the page.

    Save changes to sitemap settings

    1. Exclude Sitemap from Caching:

      • Exclude your sitemap from being cached by following this tutorial.
    2. Check Restrictions from Web Host:

      • Ensure that your web host or security plugins are not restricting access to the sitemap for external validators or search engine crawlers.

    If the above steps do not resolve the issue, you can add a filter to your theme’s functions.php file as a final solution. You can find detailed instructions on how to do this in this guide.

    I hope this helps in resolving the “Incorrect HTTP header content-type” error in your sitemaps. If you need further assistance or have any other questions, feel free to ask. Thank you for reaching out!

    Sources:
    How to Fix “Incorrect HTTP Header Content-Type” Error in Sitemaps » Rank Math
    Indexed, Not Submitted in Sitemap – Google Search Console » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    Can you please try to follow the steps below and see if that works for you?

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    3. If the above steps don’t seem to work, kindly apply the following filter to your site.

    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
    

    Here’s how you can add filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    For more details on this issue, you can check this URL: https://rankmath.com/kb/incorrect-http-header-content-type-sitemap-error/

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    i tried all that and nothing worked

    Hello,

    There seems to be no issue with your sitemap. Please confirm if you see the same issue in your GSC account. If the sitemap is working fine there, then your server or site’s firewall must be blocking the validator from accessing the sitemap.

    Please check with your host.

    Let us know how that goes. Looking forward to helping you.

    should i contact my hosting provider about that vailid

    Hello,

    Yes, you can check with your hosting provider. They can help diagnose any server or firewall issues that might be blocking access to the sitemap validator.

    Looking forward to helping you.

    it worked now but i have another problem its not detcting pages it says 0 pages found i will wait

    Hello,

    Please note that the Discovered URLs 0 that you see in Google Search Console just means that the URLs in the sitemap were already found by Googlebot by other means, instead of via the sitemap. For example, Googlebot may have found the URLs from internal links or possibly from links on another site. It mostly happens when you have good internal linking or use the Instant Indexing plugin.

    Here’s a link you can check for more information:
    https://rankmath.com/kb/zero-discovered-urls-through-sitemap/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this ticket.