Help error with my sitemap

#1039370
  • Resolved Klaus
    Rank Math free

    Incorrect http header content-type: “” (expected: “application/xml”)

    I saw this error

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello, I’m sorry to hear that you’re facing an issue with your sitemap. The error ‘Incorrect HTTP header content-type’ typically occurs when the server expects an XML sitemap but receives a different content type instead. Here are some steps you can take to resolve this issue:

    1. Flush Permalinks

    • Go to WordPress Dashboard → Settings → Permalinks.
    • Click the Save Changes button without making any changes. This will flush your permalinks.

    Flush Permalinks Settings

    2. Flush Sitemap Settings

    • Navigate to Rank Math SEO → Sitemap Settings.
    • Change the value in the Links Per Sitemap (e.g., if it’s 200, change it to 201) and click Save Changes.

    Change Links Per Sitemap

    3. Exclude Sitemap from Caching

    • Ensure that your sitemap is not being cached by any caching plugins. You can follow this tutorial to exclude your sitemap from caching.

    4. Check Restrictions from Web Host

    • If you can access the sitemap but external validators return an error, check if your web host or a security plugin is blocking access to the sitemap. You may need to adjust settings or contact your web host for assistance.

    5. Add Filter to Theme’s rank-math.php File

    • If the above solutions don’t work, you can add a filter to your theme’s rank-math.php file:
      add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
    • Make sure to do this in a child theme to avoid losing changes during updates.

    Add filter

    After making these changes, clear your website cache and test your sitemap again with an XML Sitemap validator. If you continue to experience issues, please reply to this ticket, and a human agent from our support team will assist you further.

    Sources:
    How to Fix "Incorrect HTTP Header Content-Type" Error in Sitemaps » Rank Math

    Klaus
    Rank Math free

    My site is hitmp3.com.ng/sitemap_index.xml

    Klaus
    Rank Math free

    It didn’t work

    Hello,

    Thank you for contacting us. We apologize for any inconvenience this issue may have caused.

    Your sitemap is accessible, however, it is returning this error using this tool:
    https://www.xml-sitemaps.com/validate-xml-sitemap.html

    Incorrect http header content-type: "" (expected: "application/xml")
    Sitemap content is empty

    In this case, please follow our guide here to fix this:
    https://rankmath.com/kb/incorrect-http-header-content-type-sitemap-error/

    Looking forward to helping you.

    Klaus
    Rank Math free

    I’ve tried this already

    Hello,

    Your sitemap is already validating fine

    sitemap

    Please clear your website’s cache and resubmit your sitemap to your Google Search Console.

    Looking forward to helping you.

    Klaus
    Rank Math free

    Yeah I fixed it, error with dns .

    Hello,

    We are glad that you managed to resolve this.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘Help error with my sitemap’ is closed to new replies.