Tuesday, May 10, 2016

Different way to unpublish the item in sitecore

How to unpublish the item in sitecore..

HI Friends, this is very common requirement to delete/unpublish the item from target database in sitceore.
Sometimes business user come to technical team and asks to quickly remove the page/Item from web/Target database. So the question comes in mind how? So here i am highlighting some approaches to unpublish the item from target database.

Approach 1. Change publishing setting to never publish

Steps:
  1. Go to the item that wishes to unpublished:
  2. Check the standard field checkbox in view tab in stecore ribbon.
  3. Go to publishing section
  4. Select never publish check boxW3
  5. Publish the item (with smart publish)
  6. Item will delete/Unpublished from target database
  7. See the screen shot below for reference:





                             





 

Approch 2. Change publishing Restriction setting

 In this approach we will change publish restriction setting of item

Steps:
  1. Go to the item
  2. Go to Publish tab > Change button >
  3. Unselect publishable checkbox > Ok>
  4. Publish the item (with smart publish)
  5. Item will delete/Unpublished from target database
  6. See the screen shot below for reference:












Approch 3. Through Unpublish Field under Publishing section

 In this approach, we will delete/unpublish the item from unpublish field provided in publishing section, kindly follow the below steps to unpublish the item from this approaches:

Steps:

  1. Go to the item that wishes to unpublished:
  2. Check the standard field checkbox in view tab in stecore ribbon.
  3. Go to publishing section
  4. Go to Publish Field, Click on Clear button in publish field, if any value exists.
  5. Go to UnPublish Field and click  on Now button
  6. Publish the item (with smart publish)
  7. Item will delete/Unpublished from target database
  8. See the screen shot below for reference:









Approch 4. Delete the Item from Target Database

 This is just straight forward approach, sometime the situation occur,  when we need to delete/unpublish the item without running the publishing wizard, in that case we can directly delete the item from target database.


Steps
  1. Change the database > using database selector or from query string (append this on end of the url “&database =web”)
  2. Select the items that need to delete
  3. Delete the item





Note: One problem that I can see with the approach 4 is that, the item will delete in the target database but still exist in the Index file (Lucene or solr) and item can searchable through search.
The solution is to delete the item from index as well; you can follow my one of the blog for the same solution http://sitecoresolution.blogspot.com/2016/04/delete-sitecore-item-from-solr-index.html


I hope you this article will help you.

You can connect me on twitter @sitecore_ashish

Happy UnPublishing :)