Make blog private via CLI or SQL

Hi, I’m using the latest Ghost version, and it’s working fine, but we have a need to make the blog private at set intervals.

I checked the Ghost CLI but couldn’t find a command-line switch to enable/disable private mode.

I also played around with the settings database table’s is_private field, but setting it to ‘true’ or ‘false’ with a SQL query doesn’t have any effect on the blog’s access (tested in browsers incognito mode to be sure).

Is there a way to turn the private mode on or off besides the admin interface?

@vicnick you can do this programmatically using the Admin API

The settings endpoint isn’t documented there because it’s currently “experimental” but if you look at the network request made by the admin interface then you should be able to see how it works.

1 Like

Awesome, I’ll give it a try!