I have been trying to unpublish a content programmatically in Umbraco 7 but it seems not to work as expected. Although the content was removed from the cache but the database record was never updated:
node.UnPublish();
umbraco.library.UnPublishSingleNode(node.Id);
After further investigation, I discovered that the method UnPublishSingleNode is obsolete:
[Obsolete("This method is no longer used,
a document's cache will be removed automatically
when the document is deleted or unpublished")]
public static void UnPublishSingleNode(int DocumentId);
The message did not suggest a new method :(
I need directions on how to unpublish a content programmatically.
Umbraco version: 7.3.3