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

#1049096
  • Resolved News Lens Odisha
    Rank Math free

    How to fix please help me, i am not Fix

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

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

    We apologize for the issue you are facing with the "Incorrect HTTP Header Content-Type" error. This error typically occurs when the server expects an XML sitemap but receives a different content type instead. Here are some steps you can follow 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 is 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 cannot, check if your web host or a security plugin is blocking access to the sitemap. You may need to reach out to your web host for assistance.

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

    • If the above solutions do not 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 check your sitemap again. You can test it with any XML Sitemap validator to confirm if the issue is resolved.

    If you continue to experience this error or need further assistance, 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

    Hello,

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

    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/

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

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

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Incorrect http header content-type: “” (expected: “application/xml”)’ is closed to new replies.