Support » Plugin: XML Sitemap & Google News » Sitemaps showing as feeds

  • Hi, our sitemap.xml and news sitemap seems to be working but the taxonomys post tag, sitemap-home, categorys, post type and page all inside the sitemap.xml suddenly start showing as RSS feeds when clicked on.

Viewing 15 replies - 1 through 15 (of 27 total)
  • Plugin Author RavanH

    (@ravanh)

    Hi, can you share a link to your sitemap?

    Plugin Author RavanH

    (@ravanh)

    Hmmm, it looks like the content type header is different than it should be.

    For the main sitemap it correctly shows

    
    Content-Type:text/xml; charset="UTF-8"
    

    in the response headers.

    But the others have:

    
    Content-Type:application/rss+xml; charset="UTF-8"
    

    Normally, it’s the web server that decides what content-type header to pass along (this can be set in the ini parameters or htaccess) but I’ll investigate further and see if it can be solved from the plugin side…

    Plugin Author RavanH

    (@ravanh)

    I’ve verified the plugin and it does try to set the correct response header on all sitemaps. It seems something on your server changes the response header afterwards to the wrong content type.

    Also, headers seem to be completely different when I request /sitemap-posttype-page.xml with or without a random query strong like /sitemap-posttype-page.xml?nocache123 …

    Are you using any kind of caching mechanism? Either a WordPress plugin or a server side caching solution?

    I fear it’s only there that this can be fixed.

    That said, it might not be very problematic. Have you submitted your sitemap index in Google Search Console? Have you seen errors reported? If not, you can decide to just leave it like this…

    @ravanh

    Well, the changes made on our server are, allow_url_fopen and PHP upgrade. Which do you think caused this effect?

    Although there’s no error reported by google in search console, i’m just not comfortable with it like that, until you assure us it no problem.

    NB: we never change our cache plugin…

    Plugin Author RavanH

    (@ravanh)

    Which cache plugin is that? I’d like to be able to reproduce the issue…

    Wp super cache

    Plugin Author RavanH

    (@ravanh)

    OK, there is an option “Cache HTTP headers with page content.” in the WP Super Cache settings on the Advanced tab. Is it checked or unchecked? And what happens if you change that setting?

    Plugin Author RavanH

    (@ravanh)

    Or better: on that same Advanced tab, there is a field near the end under the text “Add here strings (not a filename) that forces a page not to be cached…”

    It has this as default content:

    
    wp-.*\.php
    index\.php
    

    Now add this rule on a new line:

    
    sitemap*\.xml
    

    And hit Save Settings…

    The sitemaps should not be cached anymore. If the problem persists, then it’s not WP Super Cache.

    @ravanh

    Hi, i did as told and its still the same, i will leave all your options set (including the sitemap and checking of “cache http headers”) activated for you to see how it displayed, until you reply.

    Thanks BTW

    Since, the problem is likely not from cache plugin, am i suppose to close the allow_url_fopen or make changes to .htaccess and what changes do you suggest?

    Plugin Author RavanH

    (@ravanh)

    I don’t see how allow_url_fopen could have anything to do with this… Are there any header related rules in your sites .htaccess file?

    If not, try adding this:

    
    <FilesMatch "\.xml$">
        Header set Content-Type "text/xml; charset=utf-8"
    </FilesMatch>
    

    Should work if Apache mod_headers is installed…

    Done that and no changes still, you could check.

    Plugin Author RavanH

    (@ravanh)

    That’s very strange. Either something is overwriting this header or it’s complety ignored.

    Could you try adding this extra line to see if that one does stick?

    <FilesMatch "\.xml$">
     Header set Content-Type "text/xml; charset=utf-8"
     Header set X-PoweredBy "Unicorns"
    </FilesMatch>

    nothing still.

    i use PHP 5 when the sitemap was normal before i upgraded to 7.

    What do you think?

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘Sitemaps showing as feeds’ is closed to new replies.