Is there a way to automatically add old posts behind a paid tier?

All posts older than, say, a year (from publication date) I’d like to put behind a paywall so that access is granted for paid subscribers only.

Is there a way to do this without manually doing it?

Well, there is a command line utility gctools where you can add-preview to specific posts.

If you want this on full self drive, so that when a post is one year old, it gets moved behind a paywall with a public preview Make can do this for you.

  • Every Sunday loop through all posts in Make
  • If post is one year+ assign status paid and insert a public preview

TryGhost/gctools: Command line utilities for working with Ghost content

Ages ago, a couple of people had similar use cases like moving a post out of featured or sponsored mode after a period of time.

I build a github action to do it:

It runs on a scheduler inside github actions, so if you already have something like a custom theme you’re deploying, this would live along side that… or you could have a separate repository for it… or you can rip the code and put it into any other tool that has scheduling in it (I think Netlify has a scheduled functions thing etc)

Instead of the examples given where you change the featured property, you’d want to change the visibility property to paid I believe.

3 Likes