Try our conversational search powered by Generative AI!

Remove Dynamic Properties from system in code?


Can anybody please tell me how to delete dynamic properties from the system in code?

We have a number of sites that need the DBs tidying up, and I would like to automate the process. 

Many thanks,


Apr 15, 2008 11:28
Apr 15, 2008 11:28

Hi Adam!

Check out the class EPiServer.DataAbstraction.PageDefinition, it contains the method Delete().

You can call PageDefinition.ListDynamic() to get a list of all dynamic pagedefinitions, and then iterate upto the one you want to remove.

Hope this helps,

Apr 15, 2008 14:54

Many thanks for this Johan, that is exactly what I was looking for.

Code snippet:

PageDefinitionCollection allDynamicProperties = PageDefinition.ListDynamic();
foreach (PageDefinition pd in allDynamicProperties ){
if (pd.Name == propertyName)


Edited, Apr 15, 2008 17:46
* 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.