# DefaultUserProfile: custom attributes are removed by default?

**URL:** <https://forum.keycloak.org/t/defaultuserprofile-custom-attributes-are-removed-by-default/10054>\
**Category:** Miscellanaeous\
**Created:** [July 15, 2021, 9:02am UTC](https://forum.keycloak.org/t/defaultuserprofile-custom-attributes-are-removed-by-default/10054 "2021-07-15T09:02:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rvanderboom](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/rvanderboom/32/1463_2.png) [@rvanderboom](https://forum.keycloak.org/u/rvanderboom)\
**Post date:** [July 15, 2021, 9:02am UTC](https://forum.keycloak.org/t/defaultuserprofile-custom-attributes-are-removed-by-default/10054/1 "2021-07-15T09:02:12Z")

</div>

Hey,

after upgrading keycloak 12 to 14, we noticed our custom attriburtes were deleted every time there was an update…

We see that in DefaultUserProfile the default is to delete all attributes except for the main once (email, etc)…

Nou we override the update and set the removeAttributes to false again…

I can not find any information why this is done, shouldn’t it be in the migration manual or so ??

thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [July 15, 2021, 9:21am UTC](https://forum.keycloak.org/t/defaultuserprofile-custom-attributes-are-removed-by-default/10054/2 "2021-07-15T09:21:45Z")

</div>

This is probably due to the introduction of the `declarative-user-profile` in KC 14. Agreed that it is a bad default to get rid of existing custom attributes. Not sure why that decision was made. Take a look at the new User Profile documentation: [Server Administration Guide](https://www.keycloak.org/docs/latest/server_admin/#user-profile)

---

<div class="post-metadata">

**Author:** ![matthiasD](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/matthiasd/32/1175_2.png) [@matthiasD](https://forum.keycloak.org/u/matthiasD)\
**Post date:** [July 29, 2021, 1:39pm UTC](https://forum.keycloak.org/t/defaultuserprofile-custom-attributes-are-removed-by-default/10054/3 "2021-07-29T13:39:50Z")

</div>

We ran into the same issue. So I tried setting up the new declarative-user-profile and added all custom attributes we use. But when I now create a new customer all the keys of my custom attributes are present but the values are empty!? And in addition all predefined attributes (username, email, firstname, lastname) are missing completely. Any clues on that? Is there a simple way to set up the old (keycloak 10, 12, 13) behaviour?
