How to change the Published state of all items in Publication to "unpublished" to delete the Publication using Core Service.

  • Welcome to Tridion StackExchange!, Please explain bit more detail about your version of CME, 1. Are you looking to unpublish specific publication items? 2. looking to decommission publication on both CM and CD or only on CM side?, There are a lot of answers already available for this if you do little research.
    – Velmurugan
    May 14 '19 at 7:03
  • Hi , I am looking for deleting the Publication through core service from CM but not able to do as there were few pages and components published. i want to change the publish state of those items to unpublished without actually unpublishing from Broker.Is there any script to achieve this from CoreService.SDL Version is Web-8.1
    – user2912
    May 14 '19 at 7:10

There is no way to set individual items as unpublished from the Core Service.

If you have access to the items and the Publishing Target is still set up then you may want to delete these manually or write a Core Service script to find all items published to that Target in that Publication and unpublish them.

If you're looking to delete all items published to a particular Publication Target (across all Publications), then you could use the Core Service to decommission the Target completely using the DecommissionPublicationTarget method. More details here: Decommissioning a Publication Target. (There is also a Clear-TcmPublicationTarget PowerShell script for this.)

If unpublishing from the Target is no longer an option (e.g. If the Target has been deleted or is somehow corrupted) then you're probably going to need a database script. If you're working in your Production environment then you'll want to talk to SDL Support about this. If it's just a local test environment, then you might want to look at the STATE column in the PUBLISH_STATES table in the Content Manager database**

** It's not recommended to update the Content Manager database directly without the approval of SDL Support, as this may invalidate your support agreement. Please also make sure to backup your CM database first

  • Hi Jonathan,Thank you for the details provided above. We cannot decommission the publication targets as there were other publications published to targets which are in use. I tried unpublishing the items from core service but the items were struck in the publishing queue. So, I just want to change the publish status of those items to unpublished from CM so that i can proceed with deletion of Publication.Is there a way to do this using core service or powershell.
    – user2912
    May 14 '19 at 9:26
  • No, I’m afraid there’s no way to set individual items as unpublished via the Core Service or PowerShell May 14 '19 at 10:58
  • Can you elaborate on the items getting stuck in the publishing queue please? Are they failing to unpublish or just taking a long time? If they're failing, can you share the error message please? May 14 '19 at 14:01

As mentioned by Jonathan, there is no way to force the published state of an item to a specific value. The published states are automatically updated once the relevant Publish Transaction reaches a final state, ie: success, failed or warning. There are two parts of the system and if you forcibly change only one side (the published state on the CM side), then you artificially introduce an inconsistency (the actual published content on the CD side).

You say in your comment that the only reason for wanting to force the state is because the transactions got stuck in the queue, so the focus of your attention should be "why are the items stuck?". Is the queue full of items? If yes, try sending them on high priority, naturally, consult other users of the system so you don't block them. Or is the publishing pipeline stuck? If yes, try and discover at which point: rendering, transporting, deploying, and remedy the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.