Support » Plugin: XML Sitemap & Google News » language tag in sitemap xml is empty

  • Resolved sreddy

    (@sreddy)


    I am using WordPress multisite and just installed this plugin for sitemaps. The Google webmaster tools gives “Invalid tag value” error due to the empty language tag in the sitemap.xml, where as the sitemap-news.xml validates fine and has the value ‘en’.

    From what little I have investigated, I think this is because the $language variable is not defined in the feed-sitemap-post_type.php

    Can you please look into this.

    Thanks

    http://wordpress.org/extend/plugins/xml-sitemap-feed/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi, I’m not sure what you mean. The regular sitemaps do not have a language tag at all. And they are not supposed to have one. If your sitemap has a language tag (even an empty one) it means that sitemap is not generated by my plugin.

    Did you make sure there is no static sitemap.xml file remaining anywhere? Or have you got any other (multi-site) plugins that do sitemaps running?

    If you can share the URL of the sitemap in question, please do so.

    Thread Starter sreddy

    (@sreddy)

    For the posts that appear on the sitemap-news.xml, the <news> tag gets added even in the sitemap.xml. We do not have any other sitemap plugin or static sitemap.xml. Here is the sample xml code from the feed.

    sitemap.xml
            <url>
    		<loc>some url</loc>
    		<lastmod>2013-05-06T18:05:31+00:00</lastmod>
    		<changefreq>hourly</changefreq>
    	 	<priority>0.7</priority>
    		<news:news>
    			<news:publication>
    				<news:name>News Name</news:name>
    				<news:language></news:language>
    			</news:publication>
    			<news:publication_date>2013-05-06T18:05:31+00:00</news:publication_date>
    			<news:title>test sitemap</news:title>
    			<news:keywords>Uncategorized</news:keywords>
    		</news:news>
     	</url>
    	<url>
    		<loc>Some url</loc>
    		<lastmod>2013-02-26T11:44:26+00:00</lastmod>
    		<changefreq>monthly</changefreq>
    	 	<priority>0.2</priority>
    		<image:image>
    			<image:loc>image url</image:loc>
    		</image:image>
     	</url>
    
    sitemap-news.xml
    
           <url>
    		<loc>Some url</loc>
    		<news:news>
    			<news:publication>
    				<news:name>News Name</news:name>
    				<news:language>en</news:language>
    			</news:publication>
    			<news:publication_date>2013-05-06T18:05:31+00:00</news:publication_date>
    			<news:title>test sitemap</news:title>
    			<news:keywords>Uncategorized</news:keywords>
    		</news:news>
    		<lastmod>2013-05-06T18:05:31+00:00</lastmod>
    		<changefreq>hourly</changefreq>
    		<priority>1.0</priority>
    	</url>

    Thanks for looking into it.

    Ah, OK. Now I understand. It looks indeed like a bug. Thanks for the report!

    To get around it, go to the XML Sitemap settings on the Settings > Reading admin page? Click the Settings link next to the Posts sitemap and disable the Include: Google News tags option. You do not need this setting when you are using the separate news sitemap, which is recommended/preferred by Google anyway.

    The 4.2.2 bugfix release should address this issue. Please let me know if you see any remaining problems.

    Thread Starter sreddy

    (@sreddy)

    Hi, thanks for the fix. The language tag is now populated correctly but the <news> tag still gets included in the sitemap.xml even after disabling the Include: Google News option.

    … but the <news> tag still gets included in the sitemap.xml even after disabling the Include: Google News option.

    It might be related to (browser) caching. Can you share a link to your sitemap?

    Thread Starter sreddy

    (@sreddy)

    You are right, everything works well now. Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘language tag in sitemap xml is empty’ is closed to new replies.