Setting Publish and Expire Dates for Content - Documentation topics on: expire date,publish date,scheduled publishing,unpublishing,.

Setting Publish and Expire Dates for Content

dotCMS allows the user to define Publish and Expire dates for content in order to automatically Publish and/or Unpublish a piece of content on given dates instead of do it manually.

In order to enable this feature a Content Typemust have at least one_Date and Time_field. If you wish to use both the Publish and Unpublish features, the Content Type must have at least two _Date and Time_fields (one each for Publish and Unpublish).

After the definition of the Publish and/or Unpublish fields on the Content Type we associate those fields on the Content TypeProperties selecting them on the Publish and Unpublish Date Field properties.

Now that we associated our Publish and Expire fields properly in the Content Typewe are ready to use them, selecting a Publish date will Publish automatically the current piece of content on that given date and selecting an Expire date will Unpublish the current piece of content on that selected date.

Note:It is not necessary to define an Expire date as you can mark the piece of content to never expire, also it is very important to remember that as we are leaving the responsibility to Publish and Unpublish the piece of content to dotCMS you can't do it manually, for example, trying to Publish a piece of content that is scheduled on a future date will throw an error message as it is responsibility of the system to do it.

For more information, see the Add New Content to an HTML Page documentation.