# Clearing metadata

**URL:** <https://community.auth0.com/t/clearing-metadata/147864>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [September 24, 2024, 6:10am UTC](https://community.auth0.com/t/clearing-metadata/147864 "2024-09-24T06:10:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ganesh.kumaresan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ganesh.kumaresan/32/49201_2.png) [@ganesh.kumaresan](https://community.auth0.com/u/ganesh.kumaresan)\
**Post date:** [September 24, 2024, 6:10am UTC](https://community.auth0.com/t/clearing-metadata/147864/1 "2024-09-24T06:10:15Z")

</div>

Hi Team,

We are adding some meta data via actions. So we endup adding some additional meta-data which are not required. But the meta data is persists in the user profile, even though I have removed the code in action. Is there any configuration or approach to force to clear the stored user profile and let the actions re-create the profile again while login.

Due to this un-wanted additional fields in the user profile I am getting “The generated token is too large. Try with more specific scopes.”

Thanks!

---

<div class="post-metadata">

**Author:** ![petre.timotei](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@petre.timotei](https://community.auth0.com/u/petre.timotei)\
**Post date:** [September 26, 2024, 12:44pm UTC](https://community.auth0.com/t/clearing-metadata/147864/3 "2024-09-26T12:44:49Z")

</div>

Hey there @ganesh.kumaresan

You need to do an update where the fields in the metadata you want to remove have `null` as value.

So, for example doing a PATCH with `"user_metadata": {"attribute_name": null}`, will remove the field `attribute_name` from the user metadata.

Additionally, in Actions you can use the api object to both set userMetadata and appMetadata:  
`api.user.setUserMetadata("attribute_name", null);`  
or  
`api.user.setAppMetadata("attribute_name", null);`  
  
  
Check this out for more information:

> [@How to remove data previously saved in user\_metadata using the Management API](https://community.auth0.com/t/how-to-remove-data-previously-saved-in-user-metadata-using-the-management-api/36436):
>
> I’m trying to remove some properties that I’ve set during testing in the user\_metadata. Since this field works by merging the new content you sent I cannot find a way to remove only some key inside it using the API. I can remove it editing by hand the metadata in the UI, but I cannot script this removal using the API.

Please let me know if you have any further questions.

Thanks,  
Timotei

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 10, 2024, 12:47pm UTC](https://community.auth0.com/t/clearing-metadata/147864/5 "2024-10-10T12:47:04Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
