Convert data type 'pages' to 'content only'

Stephen Herz asked on September 27, 2016 18:56

Using Kentico v9

I've created some pages that I would like to convert to content only page types. I know there is a warning about converting content only page types back to regular pages. But is it possible to go from "Pages" to "Content only pages?" If so, how can that be done?

Recent Answers


Brenden Kehren answered on September 27, 2016 20:12

I don't believe there is a way to do either, I've checked in my 9.0.32 instance and 9.0.37 instance and no options that I'm aware of for the below:

  • Page -> Content only
  • Content only -> Page

So I'm not sure where you're receiving this warning but I don't believe this is available within the UI out of the box.

2 votesVote for this answer Mark as a Correct answer

Anton Grekhovodov answered on September 28, 2016 07:11

Hi Stephen,

I think if you need it, you can do it manually in database. You can investigate how different page types are saved in database and update corresponding fields.

I've done this conversion only once, so you may do it only at your own risk. Do backup before)

Pages -> Content only pages

 declare @ClassID int = 0 --your class id
 update CMS_Class set ClassIsContentOnly = 1 where CLassID = @ClassID
 update CMS_Tree set NodeTemplateID = NULL where NodeClassID = @ClassID
 update CMS_Document set DocumentPageTemplateID = NULL, DocumentContent = '', DocumentWebParts = ''
 where DocumentNodeID in (
       select NodeID from CMS_Tree where NodeClassID = @ClassID
 )
1 votesVote for this answer Mark as a Correct answer

Odysseas Triantafyllos answered on February 6, 2017 16:22 (last edited on February 6, 2017 16:23)

Hi Anton,

Your idea was really helpful. I think that the following line is also required:

update CMS_Tree set NodeIsContentOnly = 1 where NodeClassID = @ClassID
1 votesVote for this answer Mark as a Correct answer

Vidhyardhi Gorrepati answered on January 17, 2018 23:35

I tried the queries from Anton and Odysseas and they worked perfectly for existing pages but when I create new pages, they are created as "Pages" and not "Content Only Pages".

Is there a way to convert the "Page Type" itself to "Content Only"

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.