0

How can we identify all the Sitecore which are cloned item and how can we unclone them programmatically? Can we do this using Powershellscript?

2

You can get the cloned items for an item using the following code:

item.GetClones(true);

You can un-clone item using the following:

if (item.IsClone)
{
    var clone = new CloneItem(item);
    clone.Unclone();
}

You can get cloned items for an item using Sitecore PS as:

Get-ItemClone -Path master:\content\home

Following is the documentation of how you can get cloned-items for an item using powershell: https://doc.sitecorepowershell.com/appendix/common/get-itemclone

| improve this answer | |
0

Basically if an sitecore Item have "__Source" field value populated, then it means it's an clone of another item.

So you can query (from code OR using powershell script) to find any items with that field is populated to find out all the clones.

Refer:

https://doc.sitecore.com/users/93/sitecore-experience-platform/en/clones.html

Does Sitecore cloning create extra records in Link Database?

| improve this answer | |

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.