Write a site option
set_optionWrite a value to a WordPress option to alter plugin or theme behavior. Read the current value first to prevent site breakage.
Instructions
Write a value to the WordPress options table. Options drive plugin and theme behaviour, and a wrong value can break the site — read the current value first with get_options, and prefer a plugin's own settings screen or ability where one exists.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Option name. | |
| value | No | New value. Arrays and objects are serialised the way WordPress expects. | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. | |
| autoload | No | Whether to load this option on every page request. Leave unset to keep the current behaviour; large values should not autoload. |