---
title: Abilities
url: https://lhero.org/portfolio/lh-site-privacy/abilities/
date: 2026-10-15T12:19:39+11:00
modified: 2026-10-15T12:32:44+11:00
type: lh-portfolio-doc
---

- **Part of:** [LH Site Privacy](https://lhero.org/portfolio/lh-site-privacy/)

- [`get-privacy`](#ability-get-privacy) Get Site Privacy
- [`set-privacy`](#ability-set-privacy) Set Site Privacy

## Get Site Privacy

`lh-site-privacy/get-privacy` Read-only Idempotent

Returns who can visit a site and what its privacy can be changed to. It gives the privacy level (machine key, stored `blog_public` value, label and description), whether it is private, whether a site password is set, whether the members level is supported, and the levels the site can be set to. Requires `manage_options` on the site. Pass `site_id` to act on another site you belong to.

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `site_id` | integer | No |  | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |
| `run_without_site_plugins` | boolean | No |  | Optional, with `site_id`. Run the call through this connector even when that site has plugins of its own that cannot be loaded for it. Without this, such a write is refused if it cannot be run on that site itself. |

## Set Site Privacy

`lh-site-privacy/set-privacy` Idempotent

Changes who can visit a site, takes effect at once, and is reversible by calling it again. level is one of public, hidden-from-search, logged-in (anyone logged in to the network), site-users (users with a role on the site), administrators, password (anyone with the site password, plus site users) or members (true members, only where a membership plugin answers who is a member). password sets a new site password, which signs out everyone who entered the old one; it is required when choosing the password level if none is set yet. Pass level, password or both. Everything is checked before anything is saved. The members level can only be set from a connection to the site itself. Returns the level before and after and the site state. Requires `manage_options` on the site. Pass `site_id` to act on another site you belong to.

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `level` | string | No |  | The new privacy level. One of: `public`, `hidden-from-search`, `logged-in`, `site-users`, `administrators`, `password`, `members`. |
| `password` | string | No |  | A new site password for the password level. Stored hashed. |
| `task_id` | integer | No |  | Optional. The lh-tasks task this call is working on. Pass with `claim_token`: the call is refused unless you hold that claim, and a successful call renews it. |
| `claim_token` | string | No |  | Optional. The `claim_token` from claim-next-task for `task_id`. Required when `task_id` is given. |
| `site_id` | integer | No |  | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |
| `run_without_site_plugins` | boolean | No |  | Optional, with `site_id`. Run the call through this connector even when that site has plugins of its own that cannot be loaded for it. Without this, such a write is refused if it cannot be run on that site itself. |