Renaming custom targeting attributes doesn't update targeting on content

Just a quick note: when you rename a custom targeting attribute, it doesn’t update the targeting for content that was using that attribute.

I had an attribute called orientation, which I renamed to drawerOrientation. I expected that my content that been targeting orientation would now update to target drawerOrientation with the same target values as before. Instead, they continued pointing to orientation, which no longer existed, putting my content in an invalid state.

I would expect that in the special case where the only change made to a custom targeting attribute is its name that it would update all content using that attribute, or at least give a warning that content will now be invalid.

Also, if you’ve set a required target on your model and that target gets renamed, there’s no way to remove the now non-existent target because it’s no longer in the required targets list.

So the Visual Editor complains loudly that the content is in an invalid state but there’s no way to fix it without renaming your target back to the original, then back to the new name after having removed the requirement.

@ersin thanks for your feedback! I’ll pass this along to our product team internally and ticket it as a bug

1 Like

Hi @ersin I spoke to the product team and we will be implementing a warning for this case as we do not want to retroactively change existing targeting attributes. In the meantime, while you have already found one solution to change the name back so you can delete it, another way would be to delete the old attribute in the JSON. Thanks!

1 Like

Thanks, @ancheetah! And for anyone else reading this, by “in the JSON,” I think you mean that I could delete the required attribute by using the admin API.

Hey @ersin no problem! An easy way to remove the attribute from the JSON is by clicking on the JSON button at the bottom of the Data tab. The attribute should be in the query field at the page level. Alternatively you can use the Write API.

1 Like