Tags move, merge and delete action in aem assets. | Community
Skip to main content
Level 2
June 10, 2026
Question

Tags move, merge and delete action in aem assets.

  • June 10, 2026
  • 2 replies
  • 43 views

Hi,
 

We have a requirement in our project to delete, move, and merge tags. However, I’m facing some challenges in understanding how the taxonomy functionality behaves in these scenarios.

1. Delete:
When a tag is deleted, it is not removed from the associated asset properties. It appears that the tag must be explicitly removed from each asset, or handled through backend implementation.

2. Move/Merge:
When a tag is moved to a different folder or merged to a new tags, the changes are not reflected in the asset properties unless the tag references in the assets are manually updated.

Could you please clarify why the system behaves this way? Is there any recommended approach to delete, move, or merge tags such that the changes are automatically reflected in asset properties, without requiring additional backend implementation?

Thanks

2 replies

Level 4
June 10, 2026

Hi ​@khn ,

This is handled via TagManager in AEM. Your observation is indeed correct that when a tag is modified (deleted, moved etc), the downstream assets or pages are not modified, they keep the previous string value of the tag. However, if you resolve those strings with TagManager, it makes sure to return the correct tags.

  1. If the tag is deleted, the TagManager will not resolve that string value to a tag, hence it won't return this asset/page when you search using that tag.
  2. If the tag is moved, the TagManager automatically resolves the references and returns correct assets/pages when you search using the new tag.

We have bumped into this problem a few times already and the learning is- not to rely on the tag string, instead use TagManager to resolve these strings to get these tags.

 

About your second question of having backend implementation to correct these tag values, I would suggest not to do that. It adds a lot of overhead if you have a lot of content (assets/pages) and your tags change frequently. Rely on TagManager, it takes care of this issue.

 

There is one specific scenario where TagManager doesn't work properly - When you want to export the asset metadata to external system and you want to use the tag values in that system to search or to take decisions. In that case, it is must to have a backend implementation to rectify tag strings.


I hope it helps, Thanks!

khnAuthor
Level 2
June 11, 2026

Hi ​@Abie , I tried doing these actions using TagManager but behavior is same. Even if I delete/move/merge the tag using TagManager it’s not reflecting in the assets. In the asset node it still stores the string value of tagID. Only tags are getting updated but not impact on assets. 
If these tags are not changed in the assets, it’ll impact the search query. Ex: I want to move a tag from A → B. In asset the id is referencing to the old folder. So when I search using new folder path it’ll not give results.

Is there any additional step I need to do? Or I need to query the assets referring the tag and change it in my code?

Thanks

Level 4
June 29, 2026

Hey ​@khn ,

Apologies for delayed response.

When I say use TagManager, I mean to use it while resolving the tags on the assets. The string values stored on the assets/pages won't change when you move/merge tags, the string remains the same. However, when you want to query or find pages, then use TagManager. I will give an example-

 

/content/testsite/homepage
Tags - color:red/dark-red

 

Now the tag is moved from color:red/dard-red to color:rbg/red/dark

 

On the page, you will still have the old value color:red/dard-red,

 

However, when you have the page resource and want to get all the tags on the page, you would use TagManager.getTags (pageResource), the TagManager will return the new value not the old value. It will return color:rbg/red/dark.
You will see the same behaviour when you try to find all the pages and provide the old tag value. TagManager internally finds out that the old value has been moved, so it will find all the pages with the new tag value.

 

I hope it helps.