wp_set_setting
Update a single WordPress site setting (title, description, timezone, posts per page, homepage) with dry-run preview and verified writes.
Instructions
Change ONE site setting (see wp_get_settings for the current values).
key must be one of: title, description, timezone (e.g. 'America/Denver'),
posts_per_page (int), show_on_front ('posts' or 'page'), page_on_front (page id),
page_for_posts (page id). Any other key is refused - the site URL and admin email
are not editable here by design. page_on_front is NOT checked against the site's
pages: a wrong id blanks the homepage, so read it back with wp_get_settings and look
at the site. DEFAULTS TO dry_run=true (returns a preview; writes nothing). Pass
dry_run=false to apply - the write is verified against what the site reports back,
and the result carries the site's ACTUAL stored value next to what you
requested (WordPress escapes text as it stores it, so a title with '&' or an
apostrophe comes back encoded - that is the site behaving normally). Requires the
REST transport and an administrator app password. Prod writes require
allow_prod=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| value | Yes | ||
| dry_run | No | ||
| install | Yes | ||
| allow_prod | No |