SaaS CMS has officially launched! Learn more now.

Removing a property that no longer exists in the code


A property that existed in the code and then was removed still appears on the product in Commerce.

In CMS it is possible according to the instruction:

What is the official recommended way to remove such a field in Commerce 14?

Apr 05, 2023 15:07

There's no admin way of doing it, you need to delete via code 

Usually adding something like this to an admin tool or an init module

Edited, Apr 06, 2023 8:44


Thanks for the response. In the title I see "Deleting missing metafields in code programmatically", but from the article I only learned how to detect properties that are still in the database, but not in the code. How to get rid of such unused properties?

In my case, after using Commerce for a long time, I am dealing with properties that are not used - sometimes they are single, sometimes there are more. I would like them not to be displayed as well as get rid of them from the database to speed up the performance of the products - currently, by handling existing obsolete properties, the products seem to run slower.

Apr 07, 2023 9:27

Which field are you attempting to remove in commerce?

Field you've added to an Entry or node type by code?

FIeld you've added as a metafield to a metaclass?

Apr 10, 2023 14:02
Apr 11, 2023 9:01


I mean fields of classes inheriting from EPiServer.Commerce.Catalog.ContentTypes.ProductContent. Classes marked with an attribute CatalogContentType.

            Name = "My property",
            Description = "My description.",
            GroupName = Tabs.Overview,
            Order = 10)]
        public virtual string MyProperty { get; set; }


This looks helpful. Thank you. I understand that as a parameter I should pass the name of a property from the code that existed and was removed?

Apr 11, 2023 13:08


Apr 11, 2023 13:39

I looked at both  & articles and they seem to work only if there's no data stored on that metafield. 
Any idea what would be the proper delete approach for a metafield which is no longer needed but has data stored on it?

May 12, 2023 7:06

We built an admin tool which lists all the missing properties and can force delete them and I'm pretty sure it works even with data existing 

May 12, 2023 9:02
Kristoffer Persson - Oct 02, 2023 13:51
The link is dead. Any chance this made it to a NuGet package?
Scott Reed - Oct 02, 2023 17:14 I've uploaded it again
Calvin Ells - Apr 02, 2024 19:24
Any chance this is available as a Nuget package yet?

Thanks Scott,
In inital testing, the tool you've provieded worked flawlessly :) 
I might need to change a thing or two for my solution, but overall looks great and probably should be a part of standard package.

May 29, 2023 12:11
Scott Reed - May 30, 2023 13:50
Excellent, I keep meaning to pop it out as an official nuget package when we get the time!
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.