Expand my Community achievements bar.

Get ready! An upgraded Experience League Community experience is coming in January.

Best way to delete content fragment at language master level and in all live copies

Avatar

Level 2

Hi,

We are using AEM cloud and got a request to delete a content fragment from language master as well as all the live copies (around 150).  Could anyone suggest a best and clean approach as we don't want to have unforeseen issues later. 

 

For now, I am contemplating the below. 

 

unpublishing all live copies -> delete content fragment at language master  -> delete all live copies

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Level 10

hi @LK-CMS,

you should treat it as an asset cleanup exercise plus an MSM cleanup exercise and do it in a controlled way.

1. Inventory all usages first

  • Use the References panel (from the fragment in Assets/Content Fragments console) to list all pages and fragments that reference this fragment across all language copies.

  • Optionally run or build a small report to export all usages (example here)

2. Decide what should happen in live copies. Typical options:

  • Remove the CF component from the pages in live copies.

  • Replace the CF reference with another fragment.

3. Clean up references in language master and live copies

  • For each referenced page, remove or replace the CF component, starting with the language master and then syncing changes out with MSM where inheritance is still active.

  • Where authors have already cancelled inheritance on the CF component in specific locales, adjust those pages manually or via a scripted update (Groovy/HTTP API) so that no pages still reference the fragment.

4. Unpublish the fragments, master and live copies

5. Delete the fragments in DAM

 

For automation, you could also consider a Groovy console/script in a non‑prod environment to:

  • Enumerate all CF live copies under your DAM folder.

  • Check for page usages.

  • Remove or replace references and then delete the CFs.