Streaming live at 10am (PST)

Unpublish collection item with expiry date


#1

Hi.
I am working on a project and there’re a few requirements that i’m not sure if Webflow could achieve.

  1. Single hosting with multiple domains. Each domain with each webpage.
  2. Auto unpublish a collection item/page after expiry date.
  3. Redirect a page automatically after a certain duration.

Anyone able to assist?

Thanks.


#2
  1. a collection item can’t be “unpublished” but it can be filtered out of collection lists once its defined expiration date is passed, hence becoming unaccessible.

  2. custom code can address this in many ways.


#3

Thanks for the reply.
May I know how to do point no.2?
I just can’t figure out how to achieve this. :thinking::thinking::thinking:


#4

Sure,

First you need to add an Expiration date field, in the form of a date field.

Then declare some expiration dates (let’s put yesterday’s date for one item).

Also, all items need to have expiration dates set, for this filter to work. So let’s set dates in the future for all the other items.

Now select the collection list and set a filter on Expiration date, that says “From today to 999 days in the future”.

So now the list only shows items with a date equal to today or later.


#5

Cool! That’s very helpful. But what if I want to expired a collection page instead?