Unique Google Sitemap XML Situation

Andre Pfanz asked on December 9, 2016 00:12

I have a unique situation. I have "virtual" blog posts that don't actually exist in the Kentico but are retrieved from Hubspot using an API. These posts are dynamic and maintained at Hubspot. I need a way to include these blog posts in the XML sitemap. However, the Google XML sitemap control Kentico will only retrieve pages that are in Kentico. Does anyone know how I can get both the Hubspot posts and the pages within Kentico and put them in the Google XML sitemap? Thanks.

Correct Answer

Peter Mogilnitski answered on December 9, 2016 16:15

There is no need to put everything into one sitemap file. You can create 2 sitemaps (or as many as you want) - from Google prospective it is the same. You can add them to in the beginning your robots.txt:

Sitemap: http://www.mysite.com/sitemapindex.xml
Sitemap: http://www.mysite.com/sitemapindexhubspot.xml

Or submit using google web master tools. For Hubspot content you can alter repeater web part or Kentico Sitemap Web part(which is essentially the same repeater) and output using simple transformation:

  <loc><%# Eval("LocalHubSpotKenticoURL")%></loc>
  <lastmod><%# FormatDateTime(Eval<DateTime>("HubSpotDate"), "yyyy-MM-dd")%></lastmod>

No need to complicated - just make 2 sitemap files.

1 votesVote for this answer Unmark Correct answer

Recent Answers

Anton Grekhovodov answered on December 9, 2016 05:54

Hi Andre,

Read this article Rocking the Google Site Map Feature of Kentico CMS and documentation about Google Sitemaps. And you can see that there is ~/CMSPages/GoogleSiteMap.aspx page where you can add your custom webpart which will render xml for your blog posts.

0 votesVote for this answer Mark as a Correct answer

Andre Pfanz answered on December 9, 2016 22:12

Thanks guys.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.