Configure Sitecore to update sitemap xml on CM and CD servers

In a scalable environment the expectation is to have multiple servers serving the content(s) to different regions(or sometime same region as well), the typical architecture is to have one content management server and atleast one content delivery server.

Sitecore provides “Sitemap XML module“, when we publish content(s) it will generate an updated Sitemap.xml file – basically, a listing of page(s) that a web-crawlers can use to crawl and index a site.

sitemapxml

When we have content delivery servers set up as part of the configuration, we have to make sure that Sitemap.xml file also gets updated to CD servers which doesn’t happen by default, only content management file gets updated.

In order to make sure we Sitemap.xml file getting updated to the servers, we have to add following  to events section:

<event name=”publish:end:remote”>
<handler type=”Sitecore.Modules.SitemapXML.SitemapHandler, Sitemap.XML” method=”RefreshSitemap” />
</event>

This will updated the Sitemap.xml file in content delivery servers as well.

Note: Please refer this URL which explains about the same issue and resolution-

https://www.captechconsulting.com/blogs/sitecore-sitemap-shared-source-module-configuing-for-scaled-environments

Happy learning 🙂

Unpublishing child items in Sitecore

There are scenarios where we want to unpublish all the child items in Sitecore, and need to publish only few from specific folder/item, this is also required because as a content author we don’t want to delete the items from content tree permanently, but just want to remove it’s reference from web DB, such that when required item can be made available for publishing.

Some examples includes:

  1. Video Repository like Brightcove
  2. Product Repository in Sitecore, whose source is some third party CRM systems.
  3. Employee Repository

Client is not 100% done with all the content authoring, and haven’t reviewed all the content as well, in this case it makes most sense to unpublish all the items, and publish only which is verified by the business and content team, so that only tested content and pages can be made public.

Instead of going to each content item and unpublish one by one, there is an easy to unpublish all the child items at once.
Please follow the below steps to unpublish all child items:

  1. Go to the item in Sitecore for which all child items need to be unpublished.unpublishparentitem
  2. Before we make any updates, please try to browse any child item and make sure that you can browse the page, once this is tested we can move to next step.
  3. Now, go to “Publish”->”Change” option.
  4. From there select “ITEM” tab and uncheck “Publishable” checkbox.
  5. This makes all the child items unpublished.unpublishable
  6. Now publish your parent item,and all child items under it.
  7. Try to load the same child page, and your page status should be 404 now.
  8. Next, go to the parent folder/item again and publish only that item.
  9. Now, go to individual child item(s) and publish only those which are required.
  10. Try to load the page, and this time it should load it as expected.

This way we can keep all content items in Sitecore tree, but doesn’t promote it to web database.

As child items inherit the publish status of the parent item, setting the “Publishable” checkbox to false make sure that items are removed from web.

I hope this will help someone, who is trying to remove all the child item(s), but at the same time, also don’t want to delete items permanently.

Happy learning 🙂