How to publish specific version of an item in Sitecore

Did your client ever asked you to make specific version of Sitecore item live in website?, considering we have several versions exists for specific item in Sitecore and client wants to publish specific version and not the latest one.

When we publish an item in Sitecore- it always publish the latest and greatest version, how about if we want to publish previous or some old version?

Sitecore-Version

We have a quick solution for this- we can make use of Sitecore Publishing Restrictions and make all the version unpublishable except the one which we want to publish in the website.

For example- If we have four versions available for specific item and out of four we want to publish version #2 in the website, in this case we can just go to Sitecore->Publish->Change and unpublish version no #3 and #4

Sitecore-Version-2

After this change when we publish this item- version #2 gets published, screen shot below for ref.

Sitecore-Version-1

Later if we want to publish version #3 or #4 we just need to make these versions publishable and we should be good to go.

Hope this helps.

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 🙂