Commit d36200e1467 for woocommerce

commit d36200e1467b53a9c075aca4010b38f85287d57a
Author: Christopher Hertel <mail@christopher-hertel.de>
Date:   Fri Nov 20 16:14:44 2026 +0100

    Add a settings update ability with explicit write opt-in (#71066)

    * Extract shared settings field lookup from the settings query

    Move group loading, field shape checks, read opt-in, option name and value
    resolution into public helpers so a settings write can apply the same rules.
    The settings query output is unchanged.

    * Opt Core settings into ability writes alongside reads

    Give every Core field that allows ability reads a matching abilities.write
    flag. Additional tax classes stay read-only because their value comes from
    the tax class table, not a stored option.

    * Add the settings update ability with explicit field opt-in

    Let authorized callers change settings whose definitions opt in to both
    abilities.read and abilities.write. Passwords, unknown IDs and fields with
    supplied values are refused alike. Values pass the REST settings validators
    and the settings query value shapes, every item is validated before any
    save, and each result returns its previous value.

    * Add changelog for the settings update ability

    * Keep retention periods out of ability writes and mark updates destructive

    A retention period lets the daily personal data cleanup trash orders,
    anonymize orders or delete customer accounts, so an agent setting one
    could start data loss a day later with no further check. The six
    retention fields stay read-only.

    Every settings update overwrites a stored value, which the Abilities
    API counts as destructive, matching the other Core update abilities.

    * Split list values out of settings updates and match admin page and endpoint rules

    Lists now go in `values` and everything else in `value`, so each input
    field takes one type and MCP clients that accept one type per field can
    call the ability.

    Page fields accept only a published page ID or an empty value, as the
    REST settings API does, and refuse the page combinations the advanced
    settings tab prevents. Changing an endpoint slug queues a rewrite rules
    flush, as the admin save does, so the new URL routes instead of 404ing.

    * Merge the settings ability read and write docs into one section

    * Tell agents that settings updates apply to the whole store at once

    * Point agents to values for list settings, including lists from previous

    Lists come out of settings-query and previous in value but go back in
    values, so the input fields now say which takes what, and an item sent
    in the wrong field gets an error naming the field each setting expects.

    * Name the refused settings in settings update error messages

    MCP clients receive only the error message, not its data, so the IDs and
    the field each setting expects now appear in the message as well.

    * Match admin save side effects and value handling in settings updates

    - Keep backslashes in text and textarea values; the REST validators
      strip slashes from input that was never slashed.
    - Accept the -1 an unset checkout page reports as previous, so undo works.
    - Refuse lists with "0" or empty entries, which the admin save would drop.
    - Recount product terms when out of stock visibility changes.
    - Bump the shipping cache version after shipping or tax changes, so cart
      sessions recalculate rates.

    * Fix SettingsUpdateTest::test_keeps_backslashes: read settings without stripping slashes

    The update stored C:\Reports, but reported C:Reports back, because
    SettingsQuery::get_value() read string option keys through
    WC_Admin_Settings::get_option(), which runs stripslashes(). The same
    read fills previous, so an undo would have written the stripped value.
    Array keys (email settings) already read the raw option; string keys
    now do too.

    * Close review gaps in settings updates

    - Keep erasure request handling, bulk personal data removal and usage
      tracking read-only: they enable irreversible removal or change data
      sharing consent, like the retention periods.
    - Refuse checkbox values other than booleans, "yes", "no" and an empty
      value, so "0" no longer leaves a checkbox on.
    - Queue a rewrite flush after every save, as the admin does, so a new
      shop page takes effect.
    - Resync the downloads folder protection when the download method changes.
    - Say what is wrong with duplicate IDs and items without exactly one of
      value or values.

    * Keep declared autoload, unticked checkboxes and download protection in settings updates

    - Pass each field's declared autoload to the save, since registered
      fields drop it and the save would otherwise autoload those options.
    - Save an empty checkbox as "no", as the admin does, instead of the
      REST validator's default.
    - Resync the downloads folder protection whenever the batch sends the
      download method, so resending it repairs a failed write.
    - Restore the real .htaccess after the folder protection test.

    * Keep address autocomplete settings read-only for abilities

    Enabling autocomplete sends what shoppers type to a third-party provider, and the
    preferred provider decides who receives it, so both stay with the merchant like
    usage tracking.

    * Document that settings update permission covers reading replaced values

    Also name address autocomplete among the settings kept read-only.

    * Keep the refund and returns policy off the cart, checkout, shop and My account pages in settings updates

    The admin page picker excludes those pages for the refund policy, so the ability refuses them too, checked against the batch and the stored pages like the other page pairs.

    * Read and write settings under their field_name, as the admin save does

    The settings registrar dropped field_name, so the abilities used the option named
    by the field ID while the admin form saves under field_name.

    * Keep download protection settings read-only for abilities

    Redirect downloads, the redirect fallback, downloads without login and unhashed
    file names expose paid files by URL, which previous cannot undo once a URL has
    leaked. The ability no longer resyncs the downloads folder protection, since it
    can no longer change the download method.

    * Document which option field_name settings are read and written under

diff --git a/docs/extensions/settings-and-config/extend-wc-settings-page.md b/docs/extensions/settings-and-config/extend-wc-settings-page.md
index a7ebb0c740c..2162d30ac10 100644
--- a/docs/extensions/settings-and-config/extend-wc-settings-page.md
+++ b/docs/extensions/settings-and-config/extend-wc-settings-page.md
@@ -367,9 +367,9 @@ This is optional. If the feature flag is disabled, or the page does not return a
 - [WC_Settings_Page code reference](https://woocommerce.github.io/code-reference/classes/WC-Settings-Page.html)
 - [WC_Admin_Settings code reference](https://woocommerce.github.io/code-reference/classes/WC-Admin-Settings.html)

-## Opt a setting into ability reads
+## Opt a setting into abilities

-Starting with WooCommerce 11.4, `woocommerce/settings-query` reads settings only when their definition contains `abilities.read` set to the boolean `true`. Add the metadata beside the field's `id` and `type`:
+Starting with WooCommerce 11.4, the settings abilities only see fields whose definition opts in. Set `abilities.read` to the boolean `true` to let `woocommerce/settings-query` read a field. Also set `abilities.write` to `true` to let `woocommerce/settings-update` change it. Write without read has no effect, so a caller can always check the current value first. Add the metadata beside the field's `id` and `type`:

 ```php
 array(
@@ -381,16 +381,21 @@ array(
         'compact' => __( 'Compact', 'my-plugin' ),
         'full'    => __( 'Full', 'my-plugin' ),
     ),
-    'abilities' => array( 'read' => true ),
+    'abilities' => array(
+        'read'  => true,
+        'write' => true,
+    ),
 ),
 ```

-The same metadata works on email form fields exposed through a settings group. It does not register a new group or expose payment gateway or shipping-instance settings automatically. Callers still need permission to read WooCommerce settings.
+The same metadata works on email form fields exposed through a settings group. It does not register a new group or expose payment gateway or shipping-instance settings automatically. Callers need permission to read WooCommerce settings, or to edit them for writes. Password fields are never read or written, even when opted in. Never opt in API keys, tokens or other secrets stored in text fields, and never opt settings that let a scheduled job delete data, such as retention periods, into writes. Keep settings that enable irreversible personal data removal or change what the store shares with third parties, such as erasure request handling, usage tracking and address autocomplete, read-only too. The same applies to settings that weaken access to paid downloads, such as the redirect download method or downloads without login, since a file URL that has leaked stays leaked. Review defaults and choices as well as stored values, since reads return all three.
+
+**Reads.** Fields without opt-in are omitted, even when requested by ID. The response lists known but withheld setting IDs in `omitted`; unknown IDs and presentation fields are not listed. This list follows `include` and is computed before pagination. Totals count only returned settings. Supported values are scalars, lists of scalars and the retention-period object with `number` and `unit` members; other object shapes are omitted. Choices are returned only when supplied in the field definition. Country fields return country or country/state codes without choice lists, keeping group responses small. The read uses a non-null `fixed_value` first, then a non-null `value` supplied by the definition, then the stored option and its default. This follows the admin field value precedence and supports settings such as additional tax classes that are not stored as options.

-Fields without explicit opt-in are omitted, even when requested by ID. The response lists known but withheld setting IDs in `omitted`; unknown IDs and presentation fields are not listed. This list follows `include` and is computed before pagination. Totals count only returned settings. Password fields are always omitted, including when `read` is `true`. Never opt in API keys, tokens or other secrets stored in text fields. Review defaults and choices as well as stored values, since the ability can return all three. Supported values are scalars, lists of scalars and the retention-period object with `number` and `unit` members; other object shapes are omitted.
+**The store summary.** The same metadata controls fields in the fixed `woocommerce/store-settings-get` summary that come from WooCommerce setting definitions. Missing opt-in or a password type omits the corresponding summary fields, including derived fields such as the currency symbol. The street address combines only readable address lines. Country scopes and their country lists are checked separately. Summary fields without a WooCommerce setting definition (WordPress timezone/date settings, version, install timestamp and the reviewed onboarding fields) retain their fixed inclusion policy. There is no per-field personal-data sharing control yet. Opt-in allows the field to be returned to authorized callers without a separate PII check.

-Choices are returned only when supplied in the field definition. Country fields return country or country/state codes without choice lists, keeping group responses small.
+**Writes.** Each item sends either `value` or, for `multiselect` and `multi_select_countries` fields, `values` with a list. Fields with a non-null `fixed_value` or a `value` supplied by the definition are refused, since no option stores them. Values go through the same per-type validation as the REST settings API, then must match a shape that `woocommerce/settings-query` can return. Select and multiselect values must be one of the field's choices, country fields must be known country or country/state codes, and page fields must be a published page ID or empty. As in the admin form, cart, checkout and My account cannot share a page, the terms page cannot be the checkout page, the refund and returns policy cannot use the cart, checkout, shop or My account page, and changing a field whose ID ends in `_endpoint` queues a rewrite rules flush. Fields with a string option key are saved through `WC_Admin_Settings::save_fields()`, so the `woocommerce_admin_settings_sanitize_option` filters run as they do in the admin form.

-The group read uses a non-null `fixed_value` first, then a non-null `value` supplied by the definition, then the stored option and its default. This follows the admin field value precedence and supports settings such as additional tax classes that are not stored as options. Supplied values still require read opt-in and pass the same password and value-shape checks. Existing REST settings reads retain their current behavior.
+Updates are all or nothing: if any requested ID is unknown, not opted in or has an invalid value, the ability returns one error and saves nothing. Unknown and withheld IDs return the same `woocommerce_ability_settings_not_writable` error, so callers cannot probe for hidden fields. Each saved setting returns its `previous` value, so a change can be undone. For a field with `field_name`, the abilities read and write the option the admin form saves to, the one named by `field_name`. The admin form displays the option named by `id` unless the definition supplies `value`, so set `value` on such fields to keep the screen in step. Like the REST settings update endpoint, the ability checks only the edit permission, so permission to edit a setting also lets the caller read the value it replaces. The ability is annotated as destructive, since each change overwrites a stored value.

-This metadata also controls fields in the fixed `woocommerce/store-settings-get` summary that come from WooCommerce setting definitions. Missing opt-in or a password type omits the corresponding summary fields, including derived fields such as the currency symbol. The street address combines only readable address lines. Country scopes and their country lists are checked separately. Summary fields without a WooCommerce setting definition (WordPress timezone/date settings, version, install timestamp and the reviewed onboarding fields) retain their fixed inclusion policy. Only `read` is supported; there is no per-field personal-data sharing control yet. Opt-in allows the field to be returned to authorized callers without a separate PII check.
+Existing REST settings reads and writes retain their current behavior.
diff --git a/plugins/woocommerce/changelog/add-settings-update-ability b/plugins/woocommerce/changelog/add-settings-update-ability
new file mode 100644
index 00000000000..ed8f2541d6f
--- /dev/null
+++ b/plugins/woocommerce/changelog/add-settings-update-ability
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Let AI agents change approved store settings through WooCommerce abilities, never passwords or other secrets.
diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-accounts.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-accounts.php
index 5ea93915511..eedba25da79 100644
--- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-accounts.php
+++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-accounts.php
@@ -64,7 +64,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 				'desc'          => __( 'Enable guest checkout (recommended)', 'woocommerce' ),
 				'desc_tip'      => __( 'Allows customers to checkout without an account.', 'woocommerce' ),
 				'id'            => 'woocommerce_enable_guest_checkout',
-				'abilities'     => array( 'read' => true ),
+				'abilities'     => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'default'       => 'yes',
 				'type'          => 'checkbox',
 				'checkboxgroup' => 'start',
@@ -74,7 +77,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 				'title'         => __( 'Login', 'woocommerce' ),
 				'desc'          => __( 'Enable log-in during checkout', 'woocommerce' ),
 				'id'            => 'woocommerce_enable_checkout_login_reminder',
-				'abilities'     => array( 'read' => true ),
+				'abilities'     => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'default'       => 'no',
 				'type'          => 'checkbox',
 				'checkboxgroup' => 'end',
@@ -90,7 +96,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 					'</a>'
 				),
 				'id'                => 'woocommerce_enable_delayed_account_creation',
-				'abilities'         => array( 'read' => true ),
+				'abilities'         => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'default'           => 'no',
 				'type'              => 'checkbox',
 				'checkboxgroup'     => 'start',
@@ -105,7 +114,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 				'desc'          => __( 'During checkout', 'woocommerce' ),
 				'desc_tip'      => __( 'Customers can create an account before placing their order.', 'woocommerce' ),
 				'id'            => 'woocommerce_enable_signup_and_login_from_checkout',
-				'abilities'     => array( 'read' => true ),
+				'abilities'     => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'default'       => 'no',
 				'type'          => 'checkbox',
 				'checkboxgroup' => '',
@@ -115,7 +127,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 				'title'         => __( 'Account creation', 'woocommerce' ),
 				'desc'          => __( 'On "My account" page', 'woocommerce' ),
 				'id'            => 'woocommerce_enable_myaccount_registration',
-				'abilities'     => array( 'read' => true ),
+				'abilities'     => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'default'       => 'no',
 				'type'          => 'checkbox',
 				'checkboxgroup' => 'end',
@@ -126,7 +141,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 				'desc'              => __( 'Send password setup link (recommended)', 'woocommerce' ),
 				'desc_tip'          => __( 'New users receive an email to set up their password.', 'woocommerce' ),
 				'id'                => 'woocommerce_registration_generate_password',
-				'abilities'         => array( 'read' => true ),
+				'abilities'         => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'default'           => 'yes',
 				'type'              => 'checkbox',
 				'checkboxgroup'     => 'start',
@@ -140,7 +158,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 				'desc'              => __( 'Generate account login (recommended)', 'woocommerce' ),
 				'desc_tip'          => __( 'Generate a login for the account using first and/or last name. If neither is usable (e.g. invalid or missing) the email address will be used. If this option is unchecked, customers will need to set a username during account creation', 'woocommerce' ),
 				'id'                => 'woocommerce_registration_generate_username',
-				'abilities'         => array( 'read' => true ),
+				'abilities'         => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'default'           => 'yes',
 				'type'              => 'checkbox',
 				'checkboxgroup'     => 'end',
@@ -199,7 +220,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 				'title'     => __( 'Registration privacy policy', 'woocommerce' ),
 				'desc_tip'  => __( 'Optionally add some text about your store privacy policy to show on account registration forms.', 'woocommerce' ),
 				'id'        => 'woocommerce_registration_privacy_policy_text',
-				'abilities' => array( 'read' => true ),
+				'abilities' => array(
+					'read'  => true,
+					'write' => true,
+				),
 				/* translators: %s privacy policy page name and link */
 				'default'   => sprintf( __( 'Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our %s.', 'woocommerce' ), '[privacy_policy]' ),
 				'type'      => 'textarea',
@@ -210,7 +234,10 @@ class WC_Settings_Accounts extends WC_Settings_Page {
 				'title'     => __( 'Checkout privacy policy', 'woocommerce' ),
 				'desc_tip'  => __( 'Optionally add some text about your store privacy policy to show during checkout.', 'woocommerce' ),
 				'id'        => 'woocommerce_checkout_privacy_policy_text',
-				'abilities' => array( 'read' => true ),
+				'abilities' => array(
+					'read'  => true,
+					'write' => true,
+				),
 				/* translators: %s privacy policy page name and link */
 				'default'   => sprintf( __( 'Your personal data will be used to process your order, support your experience throughout this website, and for other purposes described in our %s.', 'woocommerce' ), '[privacy_policy]' ),
 				'type'      => 'textarea',
diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-advanced.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-advanced.php
index 2bdb2588d73..1466eed6935 100644
--- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-advanced.php
+++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-advanced.php
@@ -91,7 +91,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					/* Translators: %s Page contents. */
 					'desc'      => __( 'Page where shoppers review their shopping cart', 'woocommerce' ),
 					'id'        => 'woocommerce_cart_page_id',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'single_select_page_with_search',
 					'default'   => '',
 					'class'     => 'wc-page-search',
@@ -112,7 +115,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					/* Translators: %s Page contents. */
 					'desc'      => __( 'Page where shoppers go to finalize their purchase', 'woocommerce' ),
 					'id'        => 'woocommerce_checkout_page_id',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'single_select_page_with_search',
 					'default'   => wc_get_page_id( 'checkout' ),
 					'class'     => 'wc-page-search',
@@ -133,7 +139,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					/* Translators: %s Page contents. */
 					'desc'      => sprintf( __( 'Page contents: [%s]', 'woocommerce' ), apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) ), // phpcs:ignore WooCommerce.Commenting.CommentHooks.HookCommentWrongStyle -- The preceding comment describes the translated string.
 					'id'        => 'woocommerce_myaccount_page_id',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'single_select_page_with_search',
 					'default'   => '',
 					'class'     => 'wc-page-search',
@@ -153,7 +162,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Terms and conditions', 'woocommerce' ),
 					'desc'      => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woocommerce' ),
 					'id'        => 'woocommerce_terms_page_id',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => '',
 					'class'     => 'wc-page-search',
 					'css'       => 'min-width:300px;',
@@ -167,7 +179,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Refund and returns policy', 'woocommerce' ),
 					'desc'      => __( 'Select the page describing your store\'s refund and returns policy. WooCommerce shares it with search engines once it is publicly available.', 'woocommerce' ),
 					'id'        => 'woocommerce_refund_returns_page_id',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => '',
 					'class'     => 'wc-page-search',
 					'css'       => 'min-width:300px;',
@@ -204,7 +219,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'           => __( 'Secure checkout', 'woocommerce' ),
 					'desc'            => __( 'Force secure checkout', 'woocommerce' ),
 					'id'              => 'woocommerce_force_ssl_checkout',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'no',
 					'type'            => 'checkbox',
 					'checkboxgroup'   => 'start',
@@ -216,7 +234,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 				'unforce_ssl_checkout' => array(
 					'desc'            => __( 'Force HTTP when leaving the checkout', 'woocommerce' ),
 					'id'              => 'woocommerce_unforce_ssl_checkout',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'no',
 					'type'            => 'checkbox',
 					'checkboxgroup'   => 'end',
@@ -239,7 +260,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Pay', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "Checkout &rarr; Pay" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_checkout_pay_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'order-pay',
 					'desc_tip'  => true,
@@ -249,7 +273,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Order received', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "Checkout &rarr; Order received" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_checkout_order_received_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'order-received',
 					'desc_tip'  => true,
@@ -259,7 +286,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Add payment method', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "Checkout &rarr; Add payment method" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_add_payment_method_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'add-payment-method',
 					'desc_tip'  => true,
@@ -269,7 +299,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Delete payment method', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the delete payment method page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_delete_payment_method_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'delete-payment-method',
 					'desc_tip'  => true,
@@ -279,7 +312,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Set default payment method', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the setting a default payment method page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_set_default_payment_method_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'set-default-payment-method',
 					'desc_tip'  => true,
@@ -301,7 +337,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Orders', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "My account &rarr; Orders" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_orders_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'orders',
 					'desc_tip'  => true,
@@ -311,7 +350,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'View order', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "My account &rarr; View order" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_view_order_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'view-order',
 					'desc_tip'  => true,
@@ -321,7 +363,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Downloads', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "My account &rarr; Downloads" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_downloads_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'downloads',
 					'desc_tip'  => true,
@@ -331,7 +376,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Edit account', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "My account &rarr; Edit account" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_edit_account_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'edit-account',
 					'desc_tip'  => true,
@@ -341,7 +389,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Addresses', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "My account &rarr; Addresses" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_edit_address_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'edit-address',
 					'desc_tip'  => true,
@@ -351,7 +402,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Payment methods', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "My account &rarr; Payment methods" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_payment_methods_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'payment-methods',
 					'desc_tip'  => true,
@@ -361,7 +415,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Lost password', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the "My account &rarr; Lost password" page.', 'woocommerce' ),
 					'id'        => 'woocommerce_myaccount_lost_password_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'lost-password',
 					'desc_tip'  => true,
@@ -371,7 +428,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'title'     => __( 'Logout', 'woocommerce' ),
 					'desc'      => __( 'Endpoint for the triggering logout. You can add this to your menus via a custom link: yoursite.com/?customer-logout=true', 'woocommerce' ),
 					'id'        => 'woocommerce_logout_endpoint',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'default'   => 'customer-logout',
 					'desc_tip'  => true,
@@ -435,7 +495,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 					'desc'          => __( 'Display suggestions within WooCommerce', 'woocommerce' ),
 					'desc_tip'      => esc_html__( 'Leave this box unchecked if you do not want to pull suggested extensions from WooCommerce.com.', 'woocommerce' ),
 					'id'            => 'woocommerce_show_marketplace_suggestions',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'          => 'checkbox',
 					'checkboxgroup' => 'start',
 					'default'       => 'yes',
@@ -507,7 +570,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 			'title'       => __( 'Enable backend caching', 'woocommerce' ),
 			'desc'        => __( 'Cache REST API responses on the server', 'woocommerce' ),
 			'id'          => 'woocommerce_rest_api_enable_backend_caching',
-			'abilities'   => array( 'read' => true ),
+			'abilities'   => array(
+				'read'  => true,
+				'write' => true,
+			),
 			'type'        => 'checkbox',
 			'default'     => 'no',
 			'disabled'    => ! $has_object_cache,
@@ -521,7 +587,10 @@ class WC_Settings_Advanced extends WC_Settings_Page {
 			'title'     => __( 'Enable cache control headers', 'woocommerce' ),
 			'desc'      => __( 'Send cache control headers and support 304 Not Modified responses', 'woocommerce' ),
 			'id'        => 'woocommerce_rest_api_enable_cache_headers',
-			'abilities' => array( 'read' => true ),
+			'abilities' => array(
+				'read'  => true,
+				'write' => true,
+			),
 			'type'      => 'checkbox',
 			'default'   => 'yes',
 			'desc_tip'  => __( 'Enables including ETag and Cache-Control headers, and returning 304 Not Modified responses, for REST API endpoints configured as cacheable.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-emails.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-emails.php
index 645e7102789..6af1520a1dc 100644
--- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-emails.php
+++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-emails.php
@@ -129,7 +129,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 					'title'             => __( '"From" name', 'woocommerce' ),
 					'desc'              => '',
 					'id'                => 'woocommerce_email_from_name',
-					'abilities'         => array( 'read' => true ),
+					'abilities'         => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'              => 'text',
 					'css'               => 'min-width:400px;',
 					'default'           => esc_attr( get_bloginfo( 'name', 'display' ) ),
@@ -161,7 +164,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 					'title'     => __( 'Add "Reply-to" email', 'woocommerce' ),
 					'desc'      => __( 'Add a different email address to receive replies.', 'woocommerce' ),
 					'id'        => 'woocommerce_email_reply_to_enabled',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'checkbox',
 					'default'   => 'no',
 					'autoload'  => false,
@@ -171,7 +177,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 					'title'     => __( '"Reply-to" name', 'woocommerce' ),
 					'desc'      => '',
 					'id'        => 'woocommerce_email_reply_to_name',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'text',
 					'css'       => 'min-width:400px;',
 					'default'   => '',
@@ -224,7 +233,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 						'title'       => __( 'Logo', 'woocommerce' ),
 						'desc'        => __( 'Add your logo to each of your WooCommerce emails. If no logo is uploaded, your site title will be used instead.', 'woocommerce' ),
 						'id'          => 'woocommerce_email_header_image',
-						'abilities'   => array( 'read' => true ),
+						'abilities'   => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'type'        => 'email_image_url',
 						'css'         => 'min-width:400px;',
 						'placeholder' => __( 'N/A', 'woocommerce' ),
@@ -236,7 +248,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 					array(
 						'title'     => __( 'Logo width (px)', 'woocommerce' ),
 						'id'        => 'woocommerce_email_header_image_width',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'desc_tip'  => '',
 						'default'   => '120',
 						'type'      => 'number',
@@ -246,7 +261,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 					array(
 						'title'     => __( 'Header alignment', 'woocommerce' ),
 						'id'        => 'woocommerce_email_header_alignment',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'desc_tip'  => '',
 						'default'   => 'left',
 						'type'      => 'select',
@@ -262,7 +280,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 					array(
 						'title'     => __( 'Font family', 'woocommerce' ),
 						'id'        => 'woocommerce_email_font_family',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'default'   => 'Helvetica',
 						'type'      => 'email_font_family',
 						'row_class' => $email_improvements_enabled ? '' : 'disabled',
@@ -273,7 +294,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 						/* translators: %s: Available placeholders for use */
 						'desc'        => __( 'This text will appear in the footer of all of your WooCommerce emails.', 'woocommerce' ) . ' ' . sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '{site_title} {site_url} {store_address} {store_email}' ),
 						'id'          => 'woocommerce_email_footer_text',
-						'abilities'   => array( 'read' => true ),
+						'abilities'   => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'css'         => 'width:400px; height: 75px;',
 						'placeholder' => __( 'N/A', 'woocommerce' ),
 						'type'        => 'textarea',
@@ -298,7 +322,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 						/* translators: %s: default color */
 						'desc'      => sprintf( __( 'Customize the color of your buttons and links. Default %s.', 'woocommerce' ), '<code>' . $default_colors['base'] . '</code>' ),
 						'id'        => 'woocommerce_email_base_color',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'type'      => 'color',
 						'css'       => 'width:6em;',
 						'default'   => $default_colors['base'],
@@ -311,7 +338,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 						/* translators: %s: default color */
 						'desc'      => sprintf( __( 'Select a color for the background of your emails. Default %s.', 'woocommerce' ), '<code>' . $default_colors['bg'] . '</code>' ),
 						'id'        => 'woocommerce_email_background_color',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'type'      => 'color',
 						'css'       => 'width:6em;',
 						'default'   => $default_colors['bg'],
@@ -324,7 +354,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 						/* translators: %s: default color */
 						'desc'      => sprintf( __( 'Choose a background color for the content area of your emails. Default %s.', 'woocommerce' ), '<code>' . $default_colors['body_bg'] . '</code>' ),
 						'id'        => 'woocommerce_email_body_background_color',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'type'      => 'color',
 						'css'       => 'width:6em;',
 						'default'   => $default_colors['body_bg'],
@@ -337,7 +370,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 						/* translators: %s: default color */
 						'desc'      => sprintf( __( 'Set the color of your headings and text. Default %s.', 'woocommerce' ), '<code>' . $default_colors['body_text'] . '</code>' ),
 						'id'        => 'woocommerce_email_text_color',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'type'      => 'color',
 						'css'       => 'width:6em;',
 						'default'   => $default_colors['body_text'],
@@ -350,7 +386,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 						/* translators: %s: footer default color */
 						'desc'      => sprintf( __( 'Choose a color for your secondary text, such as your footer content. Default %s.', 'woocommerce' ), '<code>' . $default_colors['footer_text'] . '</code>' ),
 						'id'        => 'woocommerce_email_footer_text_color',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'type'      => 'color',
 						'css'       => 'width:6em;',
 						'default'   => $default_colors['footer_text'],
@@ -362,7 +401,10 @@ class WC_Settings_Emails extends WC_Settings_Page {
 						'title'     => __( 'Auto-sync with theme', 'woocommerce' ),
 						'desc'      => __( 'Automatically update email styles when theme styles change', 'woocommerce' ),
 						'id'        => 'woocommerce_email_auto_sync_with_theme',
-						'abilities' => array( 'read' => true ),
+						'abilities' => array(
+							'read'  => true,
+							'write' => true,
+						),
 						'type'      => 'hidden',
 						'default'   => 'no',
 						'autoload'  => false,
diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-general.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-general.php
index 7f3e7e68616..7b330236957 100644
--- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-general.php
+++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-general.php
@@ -137,7 +137,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Address line 1', 'woocommerce' ),
 					'desc'      => __( 'The street address for your business location.', 'woocommerce' ),
 					'id'        => 'woocommerce_store_address',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => '',
 					'type'      => 'text',
 					'desc_tip'  => true,
@@ -147,7 +150,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Address line 2', 'woocommerce' ),
 					'desc'      => __( 'An additional, optional address line for your business location.', 'woocommerce' ),
 					'id'        => 'woocommerce_store_address_2',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => '',
 					'type'      => 'text',
 					'desc_tip'  => true,
@@ -157,7 +163,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'City', 'woocommerce' ),
 					'desc'      => __( 'The city in which your business is located.', 'woocommerce' ),
 					'id'        => 'woocommerce_store_city',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => '',
 					'type'      => 'text',
 					'desc_tip'  => true,
@@ -167,7 +176,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Country / State', 'woocommerce' ),
 					'desc'      => __( 'The country and state or province, if any, in which your business is located.', 'woocommerce' ),
 					'id'        => 'woocommerce_default_country',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => 'US:CA',
 					'type'      => 'single_select_country',
 					'desc_tip'  => true,
@@ -177,7 +189,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Postcode / ZIP', 'woocommerce' ),
 					'desc'      => __( 'The postal code, if any, in which your business is located.', 'woocommerce' ),
 					'id'        => 'woocommerce_store_postcode',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'       => 'min-width:50px;',
 					'default'   => '',
 					'type'      => 'text',
@@ -201,7 +216,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Selling location(s)', 'woocommerce' ),
 					'desc'      => __( 'This option lets you limit which countries you are willing to sell to.', 'woocommerce' ),
 					'id'        => 'woocommerce_allowed_countries',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => 'all',
 					'type'      => 'select',
 					'class'     => 'wc-enhanced-select',
@@ -218,7 +236,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Sell to all countries, except for&hellip;', 'woocommerce' ),
 					'desc'      => '',
 					'id'        => 'woocommerce_all_except_countries',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'       => 'min-width: 350px;',
 					'default'   => '',
 					'type'      => 'multi_select_countries',
@@ -228,7 +249,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Sell to specific countries', 'woocommerce' ),
 					'desc'      => '',
 					'id'        => 'woocommerce_specific_allowed_countries',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'       => 'min-width: 350px;',
 					'default'   => '',
 					'type'      => 'multi_select_countries',
@@ -238,7 +262,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Shipping location(s)', 'woocommerce' ),
 					'desc'      => __( 'Choose which countries you want to ship to, or choose to ship to all locations you sell to.', 'woocommerce' ),
 					'id'        => 'woocommerce_ship_to_countries',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => '',
 					'type'      => 'select',
 					'class'     => 'wc-enhanced-select',
@@ -255,7 +282,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Ship to specific countries', 'woocommerce' ),
 					'desc'      => '',
 					'id'        => 'woocommerce_specific_ship_to_countries',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'       => '',
 					'default'   => '',
 					'type'      => 'multi_select_countries',
@@ -264,7 +294,10 @@ class WC_Settings_General extends WC_Settings_Page {
 				array(
 					'title'     => __( 'Default customer location', 'woocommerce' ),
 					'id'        => 'woocommerce_default_customer_address',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'desc'      => wc_tax_enabled()
 						? sprintf(
 							/* translators: %s: link to the Tax settings. */
@@ -305,7 +338,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Enable taxes', 'woocommerce' ),
 					'desc'      => __( 'Enable tax rates and calculations', 'woocommerce' ),
 					'id'        => 'woocommerce_calc_taxes',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => 'no',
 					'type'      => 'checkbox',
 					'desc_tip'  => __( 'Rates will be configurable and taxes will be calculated during checkout.', 'woocommerce' ),
@@ -315,7 +351,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'           => __( 'Enable coupons', 'woocommerce' ),
 					'desc'            => __( 'Enable the use of coupon codes', 'woocommerce' ),
 					'id'              => 'woocommerce_enable_coupons',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'yes',
 					'type'            => 'checkbox',
 					'checkboxgroup'   => 'start',
@@ -326,7 +365,10 @@ class WC_Settings_General extends WC_Settings_Page {
 				array(
 					'desc'            => __( 'Calculate coupon discounts sequentially', 'woocommerce' ),
 					'id'              => 'woocommerce_calc_discounts_sequentially',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'no',
 					'type'            => 'checkbox',
 					'desc_tip'        => __( 'When applying multiple coupons, apply the first coupon to the full price and the second coupon to the discounted price and so on.', 'woocommerce' ),
@@ -352,7 +394,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Currency', 'woocommerce' ),
 					'desc'      => __( 'This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.', 'woocommerce' ),
 					'id'        => 'woocommerce_currency',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => 'USD',
 					'type'      => 'select',
 					'class'     => 'wc-enhanced-select',
@@ -364,7 +409,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Currency position', 'woocommerce' ),
 					'desc'      => __( 'This controls the position of the currency symbol.', 'woocommerce' ),
 					'id'        => 'woocommerce_currency_pos',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'class'     => 'wc-enhanced-select',
 					'default'   => 'left',
 					'type'      => 'select',
@@ -381,7 +429,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Thousand separator', 'woocommerce' ),
 					'desc'      => __( 'This sets the thousand separator of displayed prices.', 'woocommerce' ),
 					'id'        => 'woocommerce_price_thousand_sep',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'       => 'width:50px;',
 					'default'   => ',',
 					'type'      => 'text',
@@ -392,7 +443,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'     => __( 'Decimal separator', 'woocommerce' ),
 					'desc'      => __( 'This sets the decimal separator of displayed prices.', 'woocommerce' ),
 					'id'        => 'woocommerce_price_decimal_sep',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'       => 'width:50px;',
 					'default'   => '.',
 					'type'      => 'text',
@@ -403,7 +457,10 @@ class WC_Settings_General extends WC_Settings_Page {
 					'title'             => __( 'Number of decimals', 'woocommerce' ),
 					'desc'              => __( 'This sets the number of decimal points shown in displayed prices.', 'woocommerce' ),
 					'id'                => 'woocommerce_price_num_decimals',
-					'abilities'         => array( 'read' => true ),
+					'abilities'         => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'               => 'width:50px;',
 					'default'           => '2',
 					'desc_tip'          => true,
diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-products.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-products.php
index 37142a2fa5e..45c3daf75e1 100644
--- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-products.php
+++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-products.php
@@ -86,7 +86,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					/* translators: %s: URL to settings. */
 					'desc'              => sprintf( __( 'The base page can also be used in your <a href="%s">product permalinks</a>.', 'woocommerce' ), admin_url( 'options-permalink.php' ) ),
 					'id'                => 'woocommerce_shop_page_id',
-					'abilities'         => array( 'read' => true ),
+					'abilities'         => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'              => 'single_select_page_with_search',
 					'default'           => '',
 					'class'             => 'wc-page-search',
@@ -101,7 +104,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'         => __( 'Add to cart behaviour', 'woocommerce' ),
 					'desc'          => __( 'Redirect to the cart page after successful addition', 'woocommerce' ),
 					'id'            => 'woocommerce_cart_redirect_after_add',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'       => 'no',
 					'type'          => 'checkbox',
 					'checkboxgroup' => 'start',
@@ -109,7 +115,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 				array(
 					'desc'          => __( 'Enable AJAX add to cart buttons on archives', 'woocommerce' ),
 					'id'            => 'woocommerce_enable_ajax_add_to_cart',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'       => 'yes',
 					'type'          => 'checkbox',
 					'checkboxgroup' => 'end',
@@ -117,7 +126,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 				array(
 					'title'       => __( 'Placeholder image', 'woocommerce' ),
 					'id'          => 'woocommerce_placeholder_image',
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'        => 'text',
 					'default'     => '',
 					'class'       => '',
@@ -140,7 +152,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'     => __( 'Weight unit', 'woocommerce' ),
 					'desc'      => __( 'This controls what unit you will define weights in.', 'woocommerce' ),
 					'id'        => 'woocommerce_weight_unit',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'class'     => 'wc-enhanced-select',
 					'css'       => 'min-width:300px;',
 					'default'   => $default_weight_unit,
@@ -158,7 +173,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'     => __( 'Dimensions unit', 'woocommerce' ),
 					'desc'      => __( 'This controls what unit you will define lengths in.', 'woocommerce' ),
 					'id'        => 'woocommerce_dimension_unit',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'class'     => 'wc-enhanced-select',
 					'css'       => 'min-width:300px;',
 					'default'   => $default_dimension_unit,
@@ -189,7 +207,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'           => __( 'Enable reviews', 'woocommerce' ),
 					'desc'            => __( 'Enable product reviews', 'woocommerce' ),
 					'id'              => 'woocommerce_enable_reviews',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'yes',
 					'type'            => 'checkbox',
 					'checkboxgroup'   => 'start',
@@ -199,7 +220,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 				array(
 					'desc'            => __( 'Show "verified owner" label on customer reviews', 'woocommerce' ),
 					'id'              => 'woocommerce_review_rating_verification_label',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'yes',
 					'type'            => 'checkbox',
 					'checkboxgroup'   => '',
@@ -210,7 +234,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 				array(
 					'desc'            => __( 'Reviews can only be left by "verified owners"', 'woocommerce' ),
 					'id'              => 'woocommerce_review_rating_verification_required',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'no',
 					'type'            => 'checkbox',
 					'checkboxgroup'   => 'end',
@@ -222,7 +249,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'           => __( 'Product ratings', 'woocommerce' ),
 					'desc'            => __( 'Enable star rating on reviews', 'woocommerce' ),
 					'id'              => 'woocommerce_enable_review_rating',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'yes',
 					'type'            => 'checkbox',
 					'checkboxgroup'   => 'start',
@@ -232,7 +262,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 				array(
 					'desc'            => __( 'Star ratings should be required, not optional', 'woocommerce' ),
 					'id'              => 'woocommerce_review_rating_required',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'yes',
 					'type'            => 'checkbox',
 					'checkboxgroup'   => 'end',
@@ -269,7 +302,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'     => __( 'Manage stock', 'woocommerce' ),
 					'desc'      => __( 'Enable stock management', 'woocommerce' ),
 					'id'        => 'woocommerce_manage_stock',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => 'yes',
 					'type'      => 'checkbox',
 				),
@@ -278,7 +314,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'             => __( 'Hold stock (minutes)', 'woocommerce' ),
 					'desc'              => __( 'Hold stock (for unpaid orders) for x minutes. When this limit is reached, the pending order will be cancelled. Leave blank to disable.', 'woocommerce' ),
 					'id'                => 'woocommerce_hold_stock_minutes',
-					'abilities'         => array( 'read' => true ),
+					'abilities'         => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'              => 'number',
 					'custom_attributes' => array(
 						'min'  => 0,
@@ -294,7 +333,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'         => __( 'Notifications', 'woocommerce' ),
 					'desc'          => __( 'Enable low stock notifications', 'woocommerce' ),
 					'id'            => 'woocommerce_notify_low_stock',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'       => 'yes',
 					'type'          => 'checkbox',
 					'checkboxgroup' => 'start',
@@ -305,7 +347,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 				array(
 					'desc'          => __( 'Enable out of stock notifications', 'woocommerce' ),
 					'id'            => 'woocommerce_notify_no_stock',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'       => 'yes',
 					'type'          => 'checkbox',
 					'checkboxgroup' => '',
@@ -316,7 +361,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 				array(
 					'desc'          => __( 'Enable backorder notifications', 'woocommerce' ),
 					'id'            => 'woocommerce_notify_backorder',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'       => 'yes',
 					'type'          => 'checkbox',
 					'checkboxgroup' => 'end',
@@ -340,7 +388,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'             => __( 'Low stock threshold', 'woocommerce' ),
 					'desc'              => __( 'When product stock reaches this amount you will be notified via email.', 'woocommerce' ),
 					'id'                => 'woocommerce_notify_low_stock_amount',
-					'abilities'         => array( 'read' => true ),
+					'abilities'         => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'               => 'width:50px;',
 					'type'              => 'number',
 					'custom_attributes' => array(
@@ -357,7 +408,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'             => __( 'Out of stock threshold', 'woocommerce' ),
 					'desc'              => __( 'When product stock reaches this amount the stock status will change to "out of stock" and you will be notified via email. This setting does not affect existing "in stock" products.', 'woocommerce' ),
 					'id'                => 'woocommerce_notify_no_stock_amount',
-					'abilities'         => array( 'read' => true ),
+					'abilities'         => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'               => 'width:50px;',
 					'type'              => 'number',
 					'custom_attributes' => array(
@@ -373,7 +427,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'     => __( 'Out of stock visibility', 'woocommerce' ),
 					'desc'      => __( 'Hide out of stock items from the catalog', 'woocommerce' ),
 					'id'        => 'woocommerce_hide_out_of_stock_items',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => 'no',
 					'type'      => 'checkbox',
 				),
@@ -382,7 +439,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'     => __( 'Stock display format', 'woocommerce' ),
 					'desc'      => __( 'This controls how stock quantities are displayed on the frontend.', 'woocommerce' ),
 					'id'        => 'woocommerce_stock_format',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'css'       => 'min-width:150px;',
 					'class'     => 'wc-enhanced-select',
 					'default'   => '',
@@ -476,7 +536,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 				array(
 					'desc'          => __( 'Grant access to downloadable products after payment', 'woocommerce' ),
 					'id'            => 'woocommerce_downloads_grant_access_after_payment',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'          => 'checkbox',
 					'default'       => 'yes',
 					'desc_tip'      => __( 'Enable this option to grant access to downloads when orders are "processing", rather than "completed".', 'woocommerce' ),
@@ -488,7 +551,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'     => __( 'Open in browser', 'woocommerce' ),
 					'desc'      => __( 'Open downloadable files in the browser, instead of saving them to the device.', 'woocommerce' ),
 					'id'        => 'woocommerce_downloads_deliver_inline',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'checkbox',
 					'default'   => false,
 					'desc_tip'  => __( 'Customers can still save the file to their device, but by default file will be opened instead of being downloaded (does not work with redirects).', 'woocommerce' ),
@@ -513,7 +579,10 @@ class WC_Settings_Products extends WC_Settings_Page {
 					'title'     => __( 'Count partial downloads', 'woocommerce' ),
 					'desc'      => __( 'Count downloads even if only part of a file is fetched.', 'woocommerce' ),
 					'id'        => 'woocommerce_downloads_count_partial',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'type'      => 'checkbox',
 					'default'   => 'yes',
 					'desc_tip'  => sprintf(
diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-shipping.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-shipping.php
index bce8235954e..25c9d1d5433 100644
--- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-shipping.php
+++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-shipping.php
@@ -118,7 +118,10 @@ class WC_Settings_Shipping extends WC_Settings_Page {
 					'title'         => __( 'Calculations', 'woocommerce' ),
 					'desc'          => __( 'Enable the shipping calculator on the cart page', 'woocommerce' ),
 					'id'            => 'woocommerce_enable_shipping_calc',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'       => 'yes',
 					'type'          => 'checkbox',
 					'checkboxgroup' => 'start',
@@ -128,7 +131,10 @@ class WC_Settings_Shipping extends WC_Settings_Page {
 				array(
 					'desc'          => __( 'Hide shipping costs until an address is entered', 'woocommerce' ),
 					'id'            => 'woocommerce_shipping_cost_requires_address',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'       => 'no',
 					'type'          => 'checkbox',
 					'checkboxgroup' => '',
@@ -137,7 +143,10 @@ class WC_Settings_Shipping extends WC_Settings_Page {
 				array(
 					'desc'          => __( 'Hide shipping rates when free shipping is available', 'woocommerce' ),
 					'id'            => 'woocommerce_shipping_hide_rates_when_free',
-					'abilities'     => array( 'read' => true ),
+					'abilities'     => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'       => 'no',
 					'type'          => 'checkbox',
 					'autoload'      => false,
@@ -148,7 +157,10 @@ class WC_Settings_Shipping extends WC_Settings_Page {
 					'title'           => __( 'Shipping destination', 'woocommerce' ),
 					'desc'            => __( 'This controls which shipping address is used by default.', 'woocommerce' ),
 					'id'              => 'woocommerce_ship_to_destination',
-					'abilities'       => array( 'read' => true ),
+					'abilities'       => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'         => 'billing',
 					'type'            => 'radio',
 					'options'         => array(
@@ -166,7 +178,10 @@ class WC_Settings_Shipping extends WC_Settings_Page {
 					'desc'      => __( 'Enable debug mode', 'woocommerce' ),
 					'desc_tip'  => __( 'Enable shipping debug mode to show matching shipping zones and to bypass shipping rate cache.', 'woocommerce' ),
 					'id'        => 'woocommerce_shipping_debug_mode',
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'default'   => 'no',
 					'type'      => 'checkbox',
 				),
diff --git a/plugins/woocommerce/includes/admin/settings/views/settings-tax.php b/plugins/woocommerce/includes/admin/settings/views/settings-tax.php
index dfae1d52147..34693d08873 100644
--- a/plugins/woocommerce/includes/admin/settings/views/settings-tax.php
+++ b/plugins/woocommerce/includes/admin/settings/views/settings-tax.php
@@ -29,7 +29,10 @@ $settings = array(
 	array(
 		'title'     => __( 'Prices entered with tax', 'woocommerce' ),
 		'id'        => 'woocommerce_prices_include_tax',
-		'abilities' => array( 'read' => true ),
+		'abilities' => array(
+			'read'  => true,
+			'write' => true,
+		),
 		'default'   => 'no',
 		'type'      => 'radio',
 		'desc_tip'  => __( 'This option is important as it will affect how you input prices. If you select "Yes", enter prices including your base location\'s tax rate, the baseline for tax calculations. Changing this option will not update existing products.', 'woocommerce' ),
@@ -42,7 +45,10 @@ $settings = array(
 	array(
 		'title'     => __( 'Calculate tax based on', 'woocommerce' ),
 		'id'        => 'woocommerce_tax_based_on',
-		'abilities' => array( 'read' => true ),
+		'abilities' => array(
+			'read'  => true,
+			'write' => true,
+		),
 		'desc'      => $base_location_estimate_text,
 		'desc_tip'  => __( 'This option determines which address is used to calculate tax.', 'woocommerce' ),
 		'default'   => TaxBasedOn::SHIPPING,
@@ -65,7 +71,10 @@ $settings = array(
 		'title'     => __( 'Shipping tax class', 'woocommerce' ),
 		'desc'      => __( 'Optionally control which tax class shipping gets, or leave it so shipping tax is based on the cart items themselves.', 'woocommerce' ),
 		'id'        => 'woocommerce_shipping_tax_class',
-		'abilities' => array( 'read' => true ),
+		'abilities' => array(
+			'read'  => true,
+			'write' => true,
+		),
 		'css'       => 'min-width:150px;',
 		'default'   => 'inherit',
 		'type'      => 'select',
@@ -78,7 +87,10 @@ $settings = array(
 		'title'     => __( 'Rounding', 'woocommerce' ),
 		'desc'      => __( 'Round tax at subtotal level, instead of rounding per line', 'woocommerce' ),
 		'id'        => 'woocommerce_tax_round_at_subtotal',
-		'abilities' => array( 'read' => true ),
+		'abilities' => array(
+			'read'  => true,
+			'write' => true,
+		),
 		'default'   => 'no',
 		'type'      => 'checkbox',
 	),
@@ -98,7 +110,10 @@ $settings = array(
 	array(
 		'title'     => __( 'Display prices in the shop', 'woocommerce' ),
 		'id'        => 'woocommerce_tax_display_shop',
-		'abilities' => array( 'read' => true ),
+		'abilities' => array(
+			'read'  => true,
+			'write' => true,
+		),
 		'default'   => TaxDisplayMode::EXCLUSIVE,
 		'type'      => 'select',
 		'class'     => 'wc-enhanced-select',
@@ -111,7 +126,10 @@ $settings = array(
 	array(
 		'title'     => __( 'Display prices during cart and checkout', 'woocommerce' ),
 		'id'        => 'woocommerce_tax_display_cart',
-		'abilities' => array( 'read' => true ),
+		'abilities' => array(
+			'read'  => true,
+			'write' => true,
+		),
 		'default'   => TaxDisplayMode::EXCLUSIVE,
 		'type'      => 'select',
 		'class'     => 'wc-enhanced-select',
@@ -127,7 +145,10 @@ $settings = array(
 	array(
 		'title'       => __( 'Price display suffix', 'woocommerce' ),
 		'id'          => 'woocommerce_price_display_suffix',
-		'abilities'   => array( 'read' => true ),
+		'abilities'   => array(
+			'read'  => true,
+			'write' => true,
+		),
 		'default'     => '',
 		'placeholder' => __( 'N/A', 'woocommerce' ),
 		'type'        => 'text',
@@ -137,7 +158,10 @@ $settings = array(
 	array(
 		'title'     => __( 'Display tax totals', 'woocommerce' ),
 		'id'        => 'woocommerce_tax_total_display',
-		'abilities' => array( 'read' => true ),
+		'abilities' => array(
+			'read'  => true,
+			'write' => true,
+		),
 		'default'   => 'itemized',
 		'type'      => 'select',
 		'class'     => 'wc-enhanced-select',
diff --git a/plugins/woocommerce/includes/class-wc-register-wp-admin-settings.php b/plugins/woocommerce/includes/class-wc-register-wp-admin-settings.php
index 68e1f032ff5..e246db1c408 100644
--- a/plugins/woocommerce/includes/class-wc-register-wp-admin-settings.php
+++ b/plugins/woocommerce/includes/class-wc-register-wp-admin-settings.php
@@ -204,7 +204,7 @@ class WC_Register_WP_Admin_Settings {
 			$new_setting['abilities'] = $setting['abilities'];
 		}

-		foreach ( array( 'value', 'fixed_value' ) as $key ) {
+		foreach ( array( 'value', 'fixed_value', 'field_name' ) as $key ) {
 			if ( isset( $setting[ $key ] ) ) {
 				$new_setting[ $key ] = $setting[ $key ];
 			}
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-admin-payment-gateway-enabled.php b/plugins/woocommerce/includes/emails/class-wc-email-admin-payment-gateway-enabled.php
index 7549d6579cd..192576577b4 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-admin-payment-gateway-enabled.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-admin-payment-gateway-enabled.php
@@ -330,7 +330,10 @@ if ( ! class_exists( 'WC_Email_Admin_Payment_Gateway_Enabled', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'enabled'            => array(
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'     => __( 'Enable/Disable', 'woocommerce' ),
 					'type'      => 'checkbox',
 					'label'     => __( 'Enable this email notification', 'woocommerce' ),
@@ -346,7 +349,10 @@ if ( ! class_exists( 'WC_Email_Admin_Payment_Gateway_Enabled', false ) ) :
 					'desc_tip'    => true,
 				),
 				'subject'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -355,7 +361,10 @@ if ( ! class_exists( 'WC_Email_Admin_Payment_Gateway_Enabled', false ) ) :
 					'default'     => '',
 				),
 				'heading'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -364,7 +373,10 @@ if ( ! class_exists( 'WC_Email_Admin_Payment_Gateway_Enabled', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -374,7 +386,10 @@ if ( ! class_exists( 'WC_Email_Admin_Payment_Gateway_Enabled', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php b/plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php
index f7dbce6e464..df0c9b5dd92 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php
@@ -206,7 +206,10 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'enabled'                => array(
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'     => __( 'Enable/Disable', 'woocommerce' ),
 					'type'      => 'checkbox',
 					'label'     => __( 'Enable this email notification', 'woocommerce' ),
@@ -229,7 +232,10 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) :
 					'desc_tip'    => true,
 				),
 				'subject'                => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -238,7 +244,10 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) :
 					'default'     => '',
 				),
 				'heading'                => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -247,7 +256,10 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) :
 					'default'     => '',
 				),
 				'additional_content'     => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -257,7 +269,10 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'             => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php
index 4d43ea3be30..de338f1edee 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php
@@ -180,14 +180,20 @@ if ( ! class_exists( 'WC_Email_Customer_Cancelled_Order', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'enabled'            => array(
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'     => __( 'Enable/Disable', 'woocommerce' ),
 					'type'      => 'checkbox',
 					'label'     => __( 'Enable this email notification', 'woocommerce' ),
 					'default'   => $this->block_email_editor_enabled ? 'yes' : 'no',
 				),
 				'subject'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -196,7 +202,10 @@ if ( ! class_exists( 'WC_Email_Customer_Cancelled_Order', false ) ) :
 					'default'     => '',
 				),
 				'heading'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -205,7 +214,10 @@ if ( ! class_exists( 'WC_Email_Customer_Cancelled_Order', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -215,7 +227,10 @@ if ( ! class_exists( 'WC_Email_Customer_Cancelled_Order', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php
index b576ae0e7ef..513315d034a 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php
@@ -205,7 +205,10 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'subject'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -214,7 +217,10 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
 					'default'     => '',
 				),
 				'heading'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -223,7 +229,10 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
 					'default'     => '',
 				),
 				'subject_paid'       => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject (paid)', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -232,7 +241,10 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
 					'default'     => '',
 				),
 				'heading_paid'       => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading (paid)', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -241,7 +253,10 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -251,7 +266,10 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.php
index 45aebacbdbb..534e4396091 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.php
@@ -227,7 +227,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Completed_Order', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'subject'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -236,7 +239,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Completed_Order', false ) ) :
 					'default'     => '',
 				),
 				'heading'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -245,7 +251,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Completed_Order', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -255,7 +264,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Completed_Order', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.php
index 6e9c21a36f7..5bc8ebc68b1 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.php
@@ -319,7 +319,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Refunded_Order', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'subject_full'       => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Full refund subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -328,7 +331,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Refunded_Order', false ) ) :
 					'default'     => '',
 				),
 				'subject_partial'    => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Partial refund subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -337,7 +343,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Refunded_Order', false ) ) :
 					'default'     => '',
 				),
 				'heading_full'       => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Full refund email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -346,7 +355,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Refunded_Order', false ) ) :
 					'default'     => '',
 				),
 				'heading_partial'    => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Partial refund email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -355,7 +367,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Refunded_Order', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -365,7 +380,10 @@ if ( ! class_exists( 'WC_Email_Customer_POS_Refunded_Order', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.php
index 906bc63fbf3..ae1b0763815 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.php
@@ -296,14 +296,20 @@ if ( ! class_exists( 'WC_Email_Customer_Refunded_Order', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'enabled'            => array(
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'     => __( 'Enable/Disable', 'woocommerce' ),
 					'type'      => 'checkbox',
 					'label'     => __( 'Enable this email notification', 'woocommerce' ),
 					'default'   => 'yes',
 				),
 				'subject_full'       => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Full refund subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -312,7 +318,10 @@ if ( ! class_exists( 'WC_Email_Customer_Refunded_Order', false ) ) :
 					'default'     => '',
 				),
 				'subject_partial'    => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Partial refund subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -321,7 +330,10 @@ if ( ! class_exists( 'WC_Email_Customer_Refunded_Order', false ) ) :
 					'default'     => '',
 				),
 				'heading_full'       => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Full refund email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -330,7 +342,10 @@ if ( ! class_exists( 'WC_Email_Customer_Refunded_Order', false ) ) :
 					'default'     => '',
 				),
 				'heading_partial'    => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Partial refund email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -339,7 +354,10 @@ if ( ! class_exists( 'WC_Email_Customer_Refunded_Order', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -349,7 +367,10 @@ if ( ! class_exists( 'WC_Email_Customer_Refunded_Order', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-review-request.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-review-request.php
index c42c50b59d4..0ba9db5dcc0 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-customer-review-request.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-review-request.php
@@ -275,7 +275,10 @@ if ( ! class_exists( 'WC_Email_Customer_Review_Request', false ) ) :
 			);
 			$this->form_fields = array(
 				'enabled'            => array(
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'     => __( 'Enable/Disable', 'woocommerce' ),
 					'type'      => 'checkbox',
 					'label'     => __( 'Enable this email notification', 'woocommerce' ),
@@ -294,7 +297,10 @@ if ( ! class_exists( 'WC_Email_Customer_Review_Request', false ) ) :
 					),
 				),
 				'subject'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -303,7 +309,10 @@ if ( ! class_exists( 'WC_Email_Customer_Review_Request', false ) ) :
 					'default'     => '',
 				),
 				'heading'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -312,7 +321,10 @@ if ( ! class_exists( 'WC_Email_Customer_Review_Request', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -322,7 +334,10 @@ if ( ! class_exists( 'WC_Email_Customer_Review_Request', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-failed-order.php b/plugins/woocommerce/includes/emails/class-wc-email-failed-order.php
index 0740a2d5fc0..0801e1793f8 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-failed-order.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-failed-order.php
@@ -181,7 +181,10 @@ if ( ! class_exists( 'WC_Email_Failed_Order', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'enabled'            => array(
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'     => __( 'Enable/Disable', 'woocommerce' ),
 					'type'      => 'checkbox',
 					'label'     => __( 'Enable this email notification', 'woocommerce' ),
@@ -197,7 +200,10 @@ if ( ! class_exists( 'WC_Email_Failed_Order', false ) ) :
 					'desc_tip'    => true,
 				),
 				'subject'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -206,7 +212,10 @@ if ( ! class_exists( 'WC_Email_Failed_Order', false ) ) :
 					'default'     => '',
 				),
 				'heading'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -215,7 +224,10 @@ if ( ! class_exists( 'WC_Email_Failed_Order', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -225,7 +237,10 @@ if ( ! class_exists( 'WC_Email_Failed_Order', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-new-order.php b/plugins/woocommerce/includes/emails/class-wc-email-new-order.php
index 3c1433cede5..cf5bae5bfa2 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-new-order.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-new-order.php
@@ -210,7 +210,10 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . implode( '</code>, <code>', array_keys( $this->placeholders ) ) . '</code>' );
 			$this->form_fields = array(
 				'enabled'            => array(
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'     => __( 'Enable/Disable', 'woocommerce' ),
 					'type'      => 'checkbox',
 					'label'     => __( 'Enable this email notification', 'woocommerce' ),
@@ -226,7 +229,10 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) :
 					'desc_tip'    => true,
 				),
 				'subject'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -235,7 +241,10 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) :
 					'default'     => '',
 				),
 				'heading'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -244,7 +253,10 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -254,7 +266,10 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email-order-withdrawal-requested.php b/plugins/woocommerce/includes/emails/class-wc-email-order-withdrawal-requested.php
index 9053ff79ff2..4e6de719184 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email-order-withdrawal-requested.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email-order-withdrawal-requested.php
@@ -243,7 +243,10 @@ if ( ! class_exists( 'WC_Email_Order_Withdrawal_Requested', false ) ) :
 			$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 			$this->form_fields = array(
 				'enabled'            => array(
-					'abilities' => array( 'read' => true ),
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'     => __( 'Enable/Disable', 'woocommerce' ),
 					'type'      => 'checkbox',
 					'label'     => __( 'Enable this email notification', 'woocommerce' ),
@@ -259,7 +262,10 @@ if ( ! class_exists( 'WC_Email_Order_Withdrawal_Requested', false ) ) :
 					'desc_tip'    => true,
 				),
 				'subject'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Subject', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -268,7 +274,10 @@ if ( ! class_exists( 'WC_Email_Order_Withdrawal_Requested', false ) ) :
 					'default'     => '',
 				),
 				'heading'            => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email heading', 'woocommerce' ),
 					'type'        => 'text',
 					'desc_tip'    => true,
@@ -277,7 +286,10 @@ if ( ! class_exists( 'WC_Email_Order_Withdrawal_Requested', false ) ) :
 					'default'     => '',
 				),
 				'additional_content' => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Additional content', 'woocommerce' ),
 					'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 					'css'         => 'width:400px; height: 75px;',
@@ -287,7 +299,10 @@ if ( ! class_exists( 'WC_Email_Order_Withdrawal_Requested', false ) ) :
 					'desc_tip'    => true,
 				),
 				'email_type'         => array(
-					'abilities'   => array( 'read' => true ),
+					'abilities'   => array(
+						'read'  => true,
+						'write' => true,
+					),
 					'title'       => __( 'Email type', 'woocommerce' ),
 					'type'        => 'select',
 					'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/includes/emails/class-wc-email.php b/plugins/woocommerce/includes/emails/class-wc-email.php
index 1a8f02dd520..11dfd990995 100644
--- a/plugins/woocommerce/includes/emails/class-wc-email.php
+++ b/plugins/woocommerce/includes/emails/class-wc-email.php
@@ -1337,14 +1337,20 @@ class WC_Email extends WC_Settings_API {
 		$placeholder_text  = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
 		$this->form_fields = array(
 			'enabled'            => array(
-				'abilities' => array( 'read' => true ),
+				'abilities' => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'title'     => __( 'Enable/Disable', 'woocommerce' ),
 				'type'      => 'checkbox',
 				'label'     => __( 'Enable this email notification', 'woocommerce' ),
 				'default'   => 'yes',
 			),
 			'subject'            => array(
-				'abilities'   => array( 'read' => true ),
+				'abilities'   => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'title'       => __( 'Subject', 'woocommerce' ),
 				'type'        => 'text',
 				'desc_tip'    => true,
@@ -1353,7 +1359,10 @@ class WC_Email extends WC_Settings_API {
 				'default'     => '',
 			),
 			'heading'            => array(
-				'abilities'   => array( 'read' => true ),
+				'abilities'   => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'title'       => __( 'Email heading', 'woocommerce' ),
 				'type'        => 'text',
 				'desc_tip'    => true,
@@ -1362,7 +1371,10 @@ class WC_Email extends WC_Settings_API {
 				'default'     => '',
 			),
 			'additional_content' => array(
-				'abilities'   => array( 'read' => true ),
+				'abilities'   => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'title'       => __( 'Additional content', 'woocommerce' ),
 				'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text,
 				'css'         => 'width:400px; height: 75px;',
@@ -1372,7 +1384,10 @@ class WC_Email extends WC_Settings_API {
 				'desc_tip'    => true,
 			),
 			'email_type'         => array(
-				'abilities'   => array( 'read' => true ),
+				'abilities'   => array(
+					'read'  => true,
+					'write' => true,
+				),
 				'title'       => __( 'Email type', 'woocommerce' ),
 				'type'        => 'select',
 				'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
diff --git a/plugins/woocommerce/src/Internal/Abilities/AbilitiesLoader.php b/plugins/woocommerce/src/Internal/Abilities/AbilitiesLoader.php
index a007998196d..18d7bfcf2cc 100644
--- a/plugins/woocommerce/src/Internal/Abilities/AbilitiesLoader.php
+++ b/plugins/woocommerce/src/Internal/Abilities/AbilitiesLoader.php
@@ -48,6 +48,7 @@ use Automattic\WooCommerce\Internal\AgentReadiness\ReportAbility;
 use Automattic\WooCommerce\Internal\AgentReadiness\RunCheckAbility;
 use Automattic\WooCommerce\Internal\Abilities\Domain\StoreSettingsGet;
 use Automattic\WooCommerce\Internal\Abilities\Domain\SettingsQuery;
+use Automattic\WooCommerce\Internal\Abilities\Domain\SettingsUpdate;
 use Automattic\WooCommerce\Internal\Abilities\Domain\SettingsGroupsQuery;

 defined( 'ABSPATH' ) || exit;
@@ -108,6 +109,7 @@ class AbilitiesLoader {
 		CustomersQuery::class,
 		StoreSettingsGet::class,
 		SettingsQuery::class,
+		SettingsUpdate::class,
 		SettingsGroupsQuery::class,
 	);

diff --git a/plugins/woocommerce/src/Internal/Abilities/Domain/SettingsQuery.php b/plugins/woocommerce/src/Internal/Abilities/Domain/SettingsQuery.php
index 03b41e7e384..d2c0aadd781 100644
--- a/plugins/woocommerce/src/Internal/Abilities/Domain/SettingsQuery.php
+++ b/plugins/woocommerce/src/Internal/Abilities/Domain/SettingsQuery.php
@@ -63,66 +63,44 @@ class SettingsQuery extends AbstractDomainAbility implements AbilityDefinition {
 	 * @return array|\WP_Error
 	 */
 	public static function execute( array $input ) {
-		$group = $input['group'];
-		if ( ! in_array( $group, array_column( SettingsGroupsQuery::get_groups(), 'id' ), true ) ) {
-			return new \WP_Error( 'woocommerce_ability_settings_group_not_found', __( 'Settings group not found.', 'woocommerce' ), array( 'status' => 404 ) );
+		$fields = self::get_group_fields( $input['group'] );
+		if ( is_wp_error( $fields ) ) {
+			return $fields;
 		}
-		/**
-		 * Filters registered fields for a settings group.
-		 *
-		 * @since 3.0.0
-		 * @param array $settings Registered settings.
-		 */
-		$settings     = apply_filters( 'woocommerce_settings-' . $group, array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
 		$readable     = array();
 		$matched      = array();
 		$option_names = array();
-		foreach ( is_array( $settings ) ? $settings : array() as $setting ) {
-			if ( ! is_array( $setting ) || ! is_string( $setting['id'] ?? null ) || ! is_string( $setting['type'] ?? null ) ) {
-				continue;
-			}
-			$id  = $setting['id'];
-			$key = $setting['option_key'] ?? null;
-			if ( in_array( $setting['type'], array( 'title', 'sectionend' ), true ) || ( ! empty( $input['include'] ) && ! in_array( $id, $input['include'], true ) ) ) {
+		foreach ( $fields as $setting ) {
+			$id = $setting['id'];
+			if ( ! empty( $input['include'] ) && ! in_array( $id, $input['include'], true ) ) {
 				continue;
 			}
 			$matched[] = $id;
-			if ( ! is_array( $setting['abilities'] ?? null ) || true !== ( $setting['abilities']['read'] ?? false ) || 'password' === $setting['type'] ) {
+			if ( ! self::is_readable( $setting ) ) {
 				continue;
 			}
-			if ( isset( $setting['fixed_value'] ) || isset( $setting['value'] ) ) {
+			if ( self::has_supplied_value( $setting ) ) {
 				$readable[] = $setting;
 				continue;
 			}
-			if ( is_string( $key ) ) {
-				$option_names[] = explode( '[', $key, 2 )[0];
-			} elseif ( is_array( $key ) && 2 === count( $key ) && is_string( $key[0] ?? null ) && is_string( $key[1] ?? null ) ) {
-				$option_names[] = $key[0];
-			} else {
+			$option_name = self::get_option_name( $setting );
+			if ( null === $option_name ) {
 				continue;
 			}
-			$readable[] = $setting;
+			$option_names[] = $option_name;
+			$readable[]     = $setting;
 		}
 		wp_prime_option_caches( array_unique( $option_names ) );

 		$items = array();
 		foreach ( $readable as $setting ) {
-			$id      = $setting['id'];
-			$key     = $setting['option_key'] ?? null;
 			$default = $setting['default'] ?? '';
-			if ( isset( $setting['fixed_value'] ) || isset( $setting['value'] ) ) {
-				$value = $setting['fixed_value'] ?? $setting['value'];
-			} elseif ( is_string( $key ) ) {
-				$value = \WC_Admin_Settings::get_option( $key, $default );
-			} else {
-				$option = get_option( $key[0], array() );
-				$value  = is_array( $option ) ? ( $option[ $key[1] ] ?? $default ) : $default;
-			}
+			$value   = self::get_value( $setting );
 			if ( true !== rest_validate_value_from_schema( $value, self::get_value_schema() ) ) {
 				continue;
 			}
 			$item = array(
-				'id'          => $id,
+				'id'          => $setting['id'],
 				'label'       => is_string( $setting['label'] ?? null ) ? $setting['label'] : '',
 				'description' => is_string( $setting['description'] ?? null ) ? $setting['description'] : '',
 				'type'        => $setting['type'],
@@ -149,6 +127,108 @@ class SettingsQuery extends AbstractDomainAbility implements AbilityDefinition {
 		);
 	}

+	/**
+	 * Fields of a registered group that have string `id` and `type` values, without titles and section ends.
+	 * A field's `option_key` is its `field_name` when one is set, as in the admin save.
+	 *
+	 * @since 11.4.0
+	 * @param string $group Settings group ID.
+	 * @return array<int, array<string, mixed>>|\WP_Error
+	 */
+	public static function get_group_fields( string $group ) {
+		if ( ! in_array( $group, array_column( SettingsGroupsQuery::get_groups(), 'id' ), true ) ) {
+			return new \WP_Error( 'woocommerce_ability_settings_group_not_found', __( 'Settings group not found.', 'woocommerce' ), array( 'status' => 404 ) );
+		}
+		/**
+		 * Filters registered fields for a settings group.
+		 *
+		 * @since 3.0.0
+		 * @param array $settings Registered settings.
+		 */
+		$settings = apply_filters( 'woocommerce_settings-' . $group, array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
+		$fields   = array();
+		foreach ( is_array( $settings ) ? $settings : array() as $setting ) {
+			if ( ! is_array( $setting ) || ! is_string( $setting['id'] ?? null ) || ! is_string( $setting['type'] ?? null ) ) {
+				continue;
+			}
+			if ( in_array( $setting['type'], array( 'title', 'sectionend' ), true ) ) {
+				continue;
+			}
+			if ( is_string( $setting['option_key'] ?? null ) && is_string( $setting['field_name'] ?? null ) && '' !== $setting['field_name'] ) {
+				$setting['option_key'] = $setting['field_name'];
+			}
+			$fields[] = $setting;
+		}
+		return $fields;
+	}
+
+	/**
+	 * Readable only with `abilities.read` set to boolean true, and never for passwords.
+	 *
+	 * @since 11.4.0
+	 * @param array $setting Field from get_group_fields().
+	 * @return bool
+	 */
+	public static function is_readable( array $setting ): bool {
+		return is_array( $setting['abilities'] ?? null ) && true === ( $setting['abilities']['read'] ?? false ) && 'password' !== $setting['type'];
+	}
+
+	/**
+	 * A non-null `fixed_value` or `value` takes precedence over the stored option, as in the admin form.
+	 *
+	 * @since 11.4.0
+	 * @param array $setting Field from get_group_fields().
+	 * @return bool
+	 */
+	public static function has_supplied_value( array $setting ): bool {
+		return isset( $setting['fixed_value'] ) || isset( $setting['value'] );
+	}
+
+	/**
+	 * Null when `option_key` is neither a string nor an `[option, member]` pair.
+	 *
+	 * @since 11.4.0
+	 * @param array $setting Field from get_group_fields().
+	 * @return string|null
+	 */
+	public static function get_option_name( array $setting ): ?string {
+		$key = $setting['option_key'] ?? null;
+		if ( is_string( $key ) ) {
+			return explode( '[', $key, 2 )[0];
+		}
+		if ( is_array( $key ) && 2 === count( $key ) && is_string( $key[0] ?? null ) && is_string( $key[1] ?? null ) ) {
+			return $key[0];
+		}
+		return null;
+	}
+
+	/**
+	 * Supplied values first, then the stored option and the field default.
+	 *
+	 * @since 11.4.0
+	 * @param array $setting Field with a supplied value or a valid option name.
+	 * @return mixed
+	 */
+	public static function get_value( array $setting ) {
+		$key     = $setting['option_key'] ?? null;
+		$default = $setting['default'] ?? '';
+		if ( self::has_supplied_value( $setting ) ) {
+			return $setting['fixed_value'] ?? $setting['value'];
+		}
+		// Read the stored option directly: WC_Admin_Settings::get_option() strips backslashes the stored value keeps.
+		if ( is_string( $key ) && false !== strpos( $key, '[' ) ) {
+			parse_str( $key, $parsed );
+			$name = (string) key( $parsed );
+			$key  = array( $name, (string) key( (array) $parsed[ $name ] ) );
+		}
+		if ( is_string( $key ) ) {
+			$value = get_option( $key, null );
+			return null === $value ? $default : $value;
+		}
+		$option = get_option( $key[0], array() );
+		return is_array( $option ) ? ( $option[ $key[1] ] ?? $default ) : $default;
+	}
+
 	/**
 	 * Get collection filters.
 	 *
@@ -190,9 +270,10 @@ class SettingsQuery extends AbstractDomainAbility implements AbilityDefinition {
 	/**
 	 * Permit scalar values, scalar lists and the closed retention-period shape.
 	 *
+	 * @since 11.4.0
 	 * @return array
 	 */
-	private static function get_value_schema(): array {
+	public static function get_value_schema(): array {
 		$scalar = array(
 			'anyOf' => array(
 				array( 'type' => 'string' ),
diff --git a/plugins/woocommerce/src/Internal/Abilities/Domain/SettingsUpdate.php b/plugins/woocommerce/src/Internal/Abilities/Domain/SettingsUpdate.php
new file mode 100644
index 00000000000..88e2f304dad
--- /dev/null
+++ b/plugins/woocommerce/src/Internal/Abilities/Domain/SettingsUpdate.php
@@ -0,0 +1,572 @@
+<?php
+/**
+ * Changes only settings whose definitions opt in to both ability reads and writes.
+ */
+
+declare( strict_types=1 );
+
+namespace Automattic\WooCommerce\Internal\Abilities\Domain;
+
+use Automattic\WooCommerce\Abilities\AbilityDefinition;
+
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Changes only settings whose definitions opt in to both ability reads and writes.
+ */
+class SettingsUpdate extends AbstractDomainAbility implements AbilityDefinition {
+	/**
+	 * Field types whose values are sent in `values` rather than `value`.
+	 */
+	private const LIST_TYPES = array( 'multiselect', 'multi_select_countries' );
+
+	/**
+	 * Page settings that must not share a page, matching the advanced settings tab's save checks and page picker exclusions.
+	 */
+	private const DISTINCT_PAGES = array(
+		array( 'woocommerce_terms_page_id', 'woocommerce_checkout_page_id' ),
+		array( 'woocommerce_cart_page_id', 'woocommerce_checkout_page_id' ),
+		array( 'woocommerce_cart_page_id', 'woocommerce_myaccount_page_id' ),
+		array( 'woocommerce_checkout_page_id', 'woocommerce_myaccount_page_id' ),
+		array( 'woocommerce_refund_returns_page_id', 'woocommerce_cart_page_id' ),
+		array( 'woocommerce_refund_returns_page_id', 'woocommerce_checkout_page_id' ),
+		array( 'woocommerce_refund_returns_page_id', 'woocommerce_shop_page_id' ),
+		array( 'woocommerce_refund_returns_page_id', 'woocommerce_myaccount_page_id' ),
+	);
+
+	/**
+	 * Get the ability name.
+	 *
+	 * @since 11.4.0
+	 * @return string
+	 */
+	public static function get_name(): string {
+		return 'woocommerce/settings-update';
+	}
+
+	/**
+	 * Register the settings update.
+	 *
+	 * @since 11.4.0
+	 * @return array
+	 */
+	public static function get_registration_args(): array {
+		return array(
+			'label'               => __( 'Update settings', 'woocommerce' ),
+			'description'         => __( 'Change approved settings in one group, such as the currency, store address or checkout pages. Changes apply to the whole store and every customer at once, so confirm them with the merchant before you send them. Read current values with woocommerce/settings-query first. Unapproved fields and passwords cannot be changed. If any setting is refused, nothing is saved. Each result returns the previous value, so a change can be undone.', 'woocommerce' ),
+			'category'            => 'woocommerce',
+			'input_schema'        => self::get_input_schema(),
+			'output_schema'       => self::get_output_schema(),
+			'execute_callback'    => array( __CLASS__, 'execute' ),
+			'permission_callback' => array( __CLASS__, 'can_edit_settings' ),
+			'meta'                => array(
+				'show_in_rest' => true,
+				'mcp'          => array(
+					'public' => true,
+					'type'   => 'tool',
+				),
+				'annotations'  => array(
+					'readonly'    => false,
+					'idempotent'  => true,
+					'destructive' => true,
+				),
+			),
+		);
+	}
+
+	/**
+	 * Same capability as the REST settings update endpoints.
+	 *
+	 * @since 11.4.0
+	 * @return bool
+	 */
+	public static function can_edit_settings(): bool {
+		return (bool) wc_rest_check_manager_permissions( 'settings', 'edit' );
+	}
+
+	/**
+	 * Validate every requested change before saving any of them.
+	 *
+	 * @since 11.4.0
+	 * @param array $input Group and changes.
+	 * @return array|\WP_Error
+	 */
+	public static function execute( array $input ) {
+		$fields = SettingsQuery::get_group_fields( $input['group'] );
+		if ( is_wp_error( $fields ) ) {
+			return $fields;
+		}
+		$fields_by_id = array();
+		foreach ( $fields as $setting ) {
+			$fields_by_id[ $setting['id'] ] ??= $setting;
+		}
+
+		$ids = array_column( $input['settings'], 'id' );
+		if ( count( $ids ) !== count( array_unique( $ids ) ) ) {
+			return self::invalid_value_error(
+				array_values( array_unique( array_diff_assoc( $ids, array_unique( $ids ) ) ) ),
+				/* translators: %s: comma-separated setting IDs. */
+				__( 'These settings are named more than once: %s. Send each setting once. Nothing was saved.', 'woocommerce' )
+			);
+		}
+		$malformed = array();
+		foreach ( $input['settings'] as $item ) {
+			if ( array_key_exists( 'value', $item ) === array_key_exists( 'values', $item ) ) {
+				$malformed[] = $item['id'];
+			}
+		}
+		if ( $malformed ) {
+			return self::invalid_value_error(
+				$malformed,
+				/* translators: %s: comma-separated setting IDs. */
+				__( 'These settings need exactly one of value or values: %s. Nothing was saved.', 'woocommerce' )
+			);
+		}
+
+		$denied = array();
+		foreach ( $ids as $id ) {
+			if ( ! isset( $fields_by_id[ $id ] ) || ! self::is_writable( $fields_by_id[ $id ] ) ) {
+				$denied[] = $id;
+			}
+		}
+		if ( $denied ) {
+			return new \WP_Error(
+				'woocommerce_ability_settings_not_writable',
+				/* translators: %s: comma-separated setting IDs. */
+				sprintf( __( 'These settings cannot be changed: %s. Nothing was saved.', 'woocommerce' ), implode( ', ', $denied ) ),
+				array(
+					'status' => 403,
+					'ids'    => $denied,
+				)
+			);
+		}
+
+		$expected = array();
+		foreach ( $input['settings'] as $item ) {
+			$field = in_array( $fields_by_id[ $item['id'] ]['type'], self::LIST_TYPES, true ) ? 'values' : 'value';
+			if ( ! array_key_exists( $field, $item ) ) {
+				$expected[ $item['id'] ] = $field;
+			}
+		}
+		if ( $expected ) {
+			$messages = array();
+			$in_list  = array_keys( $expected, 'values', true );
+			$single   = array_keys( $expected, 'value', true );
+			if ( $in_list ) {
+				/* translators: %s: comma-separated setting IDs. */
+				$messages[] = sprintf( __( 'Send these settings as a list in values: %s.', 'woocommerce' ), implode( ', ', $in_list ) );
+			}
+			if ( $single ) {
+				/* translators: %s: comma-separated setting IDs. */
+				$messages[] = sprintf( __( 'Send these settings in value, not values: %s.', 'woocommerce' ), implode( ', ', $single ) );
+			}
+			$messages[] = __( 'Nothing was saved.', 'woocommerce' );
+			return new \WP_Error(
+				'woocommerce_ability_settings_invalid_value',
+				implode( ' ', $messages ),
+				array(
+					'status'   => 400,
+					'ids'      => array_keys( $expected ),
+					'expected' => $expected,
+				)
+			);
+		}
+
+		$controller   = new \WC_REST_Setting_Options_Controller();
+		$changes      = array();
+		$invalid      = array();
+		$option_names = array();
+		foreach ( $input['settings'] as $item ) {
+			$setting = $fields_by_id[ $item['id'] ];
+			$value   = self::validate_value( $controller, $setting, $item['values'] ?? $item['value'] );
+			if ( is_wp_error( $value ) ) {
+				$invalid[] = $item['id'];
+				continue;
+			}
+			$changes[]   = array( $setting, $value );
+			$option_name = SettingsQuery::get_option_name( $setting );
+			if ( null !== $option_name ) {
+				$option_names[] = $option_name;
+			}
+		}
+		if ( $invalid ) {
+			return self::invalid_value_error( $invalid );
+		}
+		$conflicts = self::get_page_conflicts( $changes );
+		if ( $conflicts ) {
+			return new \WP_Error(
+				'woocommerce_ability_settings_page_conflict',
+				/* translators: %s: comma-separated setting IDs. */
+				sprintf( __( 'These settings would share a page: %s. Cart, checkout and My account each need their own page, terms cannot use the checkout page, and the refund and returns policy cannot use the cart, checkout, shop or My account page. Nothing was saved.', 'woocommerce' ), implode( ', ', $conflicts ) ),
+				array(
+					'status' => 400,
+					'ids'    => $conflicts,
+				)
+			);
+		}
+
+		$value_schema = SettingsQuery::get_value_schema();
+		wp_prime_option_caches( array_unique( $option_names ) );
+		$results = array();
+		foreach ( $changes as $change ) {
+			$result   = array( 'id' => $change[0]['id'] );
+			$previous = SettingsQuery::get_value( $change[0] );
+			if ( true === rest_validate_value_from_schema( $previous, $value_schema ) ) {
+				$result['previous'] = $previous;
+			}
+			$results[] = $result;
+		}
+
+		$hide_out_of_stock = get_option( 'woocommerce_hide_out_of_stock_items' );
+		$autoload          = self::get_declared_autoload( $input['group'] );
+		foreach ( $changes as $index => $change ) {
+			list( $setting, $value ) = $change;
+			if ( isset( $autoload[ $setting['id'] ] ) ) {
+				$setting['autoload'] = $autoload[ $setting['id'] ];
+			}
+			self::save( $setting, $value );
+			$saved                      = SettingsQuery::get_value( $setting );
+			$results[ $index ]['value'] = true === rest_validate_value_from_schema( $saved, $value_schema ) ? $saved : $value;
+		}
+		// Endpoint slugs and the shop page feed rewrite rules, so like the admin save, queue a flush after every save.
+		update_option( 'woocommerce_queue_flush_rewrite_rules', 'yes' );
+		// Term counts leave out hidden out-of-stock products, so the products settings save recounts them.
+		if ( get_option( 'woocommerce_hide_out_of_stock_items' ) !== $hide_out_of_stock ) {
+			wc_recount_all_terms( false );
+		}
+		// Cart sessions keep calculated shipping rates until this version changes, which the shipping and tax admin saves bump.
+		if ( in_array( $input['group'], array( 'shipping', 'tax' ), true ) ) {
+			\WC_Cache_Helper::get_transient_version( 'shipping', true );
+		}
+
+		return array( 'settings' => $results );
+	}
+
+	/**
+	 * Writable only when readable, opted in with `abilities.write` set to boolean true, and backed by a stored option.
+	 *
+	 * @param array $setting Field from SettingsQuery::get_group_fields().
+	 * @return bool
+	 */
+	private static function is_writable( array $setting ): bool {
+		return SettingsQuery::is_readable( $setting )
+			&& true === ( $setting['abilities']['write'] ?? false )
+			&& ! SettingsQuery::has_supplied_value( $setting )
+			&& null !== SettingsQuery::get_option_name( $setting );
+	}
+
+	/**
+	 * Applies the REST settings validator for the field type, then the shapes the settings read can return.
+	 *
+	 * @param \WC_REST_Setting_Options_Controller $controller Validator source.
+	 * @param array                               $setting    Writable field.
+	 * @param mixed                               $value      Requested value.
+	 * @return mixed|\WP_Error
+	 */
+	private static function validate_value( \WC_REST_Setting_Options_Controller $controller, array $setting, $value ) {
+		$type    = $setting['type'];
+		$invalid = new \WP_Error( 'woocommerce_ability_settings_invalid_value', __( 'An invalid setting value was passed.', 'woocommerce' ) );
+
+		// Stored options are strings: the admin save compares select values strictly and checkbox values as yes/no.
+		if ( is_bool( $value ) ) {
+			if ( 'checkbox' !== $type ) {
+				return $invalid;
+			}
+			$value = $value ? 'yes' : 'no';
+		} elseif ( is_int( $value ) || is_float( $value ) ) {
+			$value = (string) $value;
+		}
+		// The REST checkbox validator saves the default for "" and "0", while the admin save stores an unticked box as "no".
+		// An unset checkbox reads as "", so "" is kept for undo and saved as "no".
+		if ( 'checkbox' === $type ) {
+			if ( ! in_array( $value, array( 'yes', 'no', '' ), true ) ) {
+				return $invalid;
+			}
+			$value = '' === $value ? 'no' : $value;
+		}
+		if ( is_array( $value ) !== ( in_array( $type, self::LIST_TYPES, true ) || 'relative_date_selector' === $type ) ) {
+			return $invalid;
+		}
+		if ( is_array( $value ) && 'relative_date_selector' !== $type ) {
+			if ( array_filter( $value, 'is_bool' ) ) {
+				return $invalid;
+			}
+			$value = array_map( 'strval', $value );
+			// The admin save drops "0" and empty entries from lists, so such a list would not be stored as sent.
+			if ( count( array_filter( $value ) ) !== count( $value ) ) {
+				return $invalid;
+			}
+		}
+
+		$method = 'validate_setting_' . $type . '_field';
+		if ( in_array( $type, array( 'select', 'radio', 'multiselect' ), true ) ) {
+			$setting['options'] = is_array( $setting['options'] ?? null ) ? $setting['options'] : array();
+		}
+		switch ( $type ) {
+			case 'single_select_country':
+				$setting['options'] = self::get_country_state_choices();
+				$method             = 'validate_setting_select_field';
+				break;
+			case 'multi_select_countries':
+				$setting['options'] = WC()->countries->get_countries();
+				$method             = 'validate_setting_multiselect_field';
+				break;
+			case 'relative_date_selector':
+				return self::validate_relative_date( $value, $invalid );
+			case 'single_select_page':
+			case 'single_select_page_with_search':
+				return self::validate_page( $value, $invalid );
+			case 'number':
+				if ( '' !== $value && ! is_numeric( $value ) ) {
+					return $invalid;
+				}
+				break;
+		}
+		if ( ! is_callable( array( $controller, $method ) ) ) {
+			$method = 'validate_setting_text_field';
+		}
+		// These validators strip slashes, but ability input was never slashed.
+		if ( in_array( $method, array( 'validate_setting_text_field', 'validate_setting_textarea_field' ), true ) ) {
+			$value = wp_slash( $value );
+		}
+
+		$validated = $controller->$method( $value, $setting );
+		if ( is_wp_error( $validated ) ) {
+			return $invalid;
+		}
+		if ( is_array( $value ) && count( (array) $validated ) !== count( $value ) ) {
+			return $invalid;
+		}
+		if ( true !== rest_validate_value_from_schema( $validated, SettingsQuery::get_value_schema() ) ) {
+			return $invalid;
+		}
+		return $validated;
+	}
+
+	/**
+	 * Requires a known unit, since the admin parser silently falls back to days.
+	 *
+	 * @param array     $value   Requested retention period.
+	 * @param \WP_Error $invalid Error to return.
+	 * @return array|\WP_Error
+	 */
+	private static function validate_relative_date( array $value, \WP_Error $invalid ) {
+		$number = $value['number'] ?? null;
+		if ( ! in_array( $value['unit'] ?? null, array( 'days', 'weeks', 'months', 'years' ), true ) || ( '' !== $number && ! ( is_numeric( $number ) && $number >= 0 ) ) ) {
+			return $invalid;
+		}
+		return wc_parse_relative_date_option( $value );
+	}
+
+	/**
+	 * A published page ID, or an empty string to unset the page, matching the pages the REST settings API offers.
+	 *
+	 * @param string    $value   Requested page ID.
+	 * @param \WP_Error $invalid Error to return.
+	 * @return string|\WP_Error
+	 */
+	private static function validate_page( string $value, \WP_Error $invalid ) {
+		// An unset checkout page reads as wc_get_page_id()'s -1, so `previous` can carry it back.
+		if ( '' === $value || '-1' === $value ) {
+			return '';
+		}
+		$page = ctype_digit( $value ) ? get_post( (int) $value ) : null;
+		if ( ! $page instanceof \WP_Post || 'page' !== $page->post_type || 'publish' !== $page->post_status ) {
+			return $invalid;
+		}
+		return $value;
+	}
+
+	/**
+	 * Requested page settings that would share a page with another page setting after the batch is saved.
+	 *
+	 * @param array $changes Validated `[ setting, value ]` pairs.
+	 * @return string[]
+	 */
+	private static function get_page_conflicts( array $changes ): array {
+		$requested = array();
+		foreach ( $changes as $change ) {
+			$requested[ $change[0]['id'] ] = $change[1];
+		}
+		$conflicts = array();
+		foreach ( self::DISTINCT_PAGES as $pair ) {
+			if ( ! isset( $requested[ $pair[0] ] ) && ! isset( $requested[ $pair[1] ] ) ) {
+				continue;
+			}
+			$pages = array_map(
+				static fn( string $id ): int => absint( $requested[ $id ] ?? get_option( $id ) ),
+				$pair
+			);
+			if ( $pages[0] > 0 && $pages[0] === $pages[1] ) {
+				$conflicts = array_merge( $conflicts, array_keys( array_intersect_key( $requested, array_flip( $pair ) ) ) );
+			}
+		}
+		return array_values( array_unique( $conflicts ) );
+	}
+
+	/**
+	 * Country and country:state codes, matching the choices the REST settings API offers for base-location fields.
+	 *
+	 * @return array<string, string>
+	 */
+	private static function get_country_state_choices(): array {
+		$choices = array();
+		foreach ( WC()->countries->get_countries() as $code => $name ) {
+			$states = WC()->countries->get_states( $code );
+			if ( ! $states ) {
+				$choices[ $code ] = $name;
+				continue;
+			}
+			foreach ( $states as $state_code => $state_name ) {
+				$choices[ $code . ':' . $state_code ] = $name . ' - ' . $state_name;
+			}
+		}
+		return $choices;
+	}
+
+	/**
+	 * String keys go through the admin save so its sanitize filters and option hooks still run.
+	 *
+	 * @param array $setting Writable field.
+	 * @param mixed $value   Validated value.
+	 * @return void
+	 */
+	private static function save( array $setting, $value ): void {
+		$key = $setting['option_key'];
+		if ( is_array( $key ) ) {
+			$option            = get_option( $key[0], array() );
+			$option            = is_array( $option ) ? $option : array();
+			$option[ $key[1] ] = $value;
+			update_option( $key[0], $option );
+			return;
+		}
+
+		// The admin save unslashes posted data and names the option after the field ID.
+		$data = array( $key => wp_slash( $value ) );
+		if ( false !== strpos( $key, '[' ) ) {
+			parse_str( $key, $parsed );
+			$name = (string) key( $parsed );
+			$data = array( $name => array( (string) key( (array) $parsed[ $name ] ) => wp_slash( $value ) ) );
+		}
+		$setting['id'] = $key;
+		unset( $setting['field_name'] );
+		\WC_Admin_Settings::save_fields( array( $setting ), $data );
+	}
+
+	/**
+	 * Autoload flags declared by the group's settings page, keyed by field ID, since registered fields drop them.
+	 *
+	 * @param string $group Settings group ID.
+	 * @return array<string, bool>
+	 */
+	private static function get_declared_autoload( string $group ): array {
+		$autoload = array();
+		foreach ( \WC_Admin_Settings::get_settings_pages() as $page ) {
+			if ( ! $page instanceof \WC_Settings_Page || $page->get_id() !== $group ) {
+				continue;
+			}
+			// Sections and get_settings() as the page registrar reads them, so the same fields are found.
+			$sections = $page->get_sections();
+			foreach ( array_keys( $sections ? $sections : array( '' => '' ) ) as $section ) {
+				foreach ( (array) $page->get_settings( $section ) as $field ) {
+					if ( is_array( $field ) && is_string( $field['id'] ?? null ) && isset( $field['autoload'] ) ) {
+						$autoload[ $field['id'] ] ??= (bool) $field['autoload'];
+					}
+				}
+			}
+		}
+		return $autoload;
+	}
+
+	/**
+	 * Names every refused ID in the message too, since MCP clients receive only the message.
+	 *
+	 * @param string[]    $ids    Setting IDs with invalid values.
+	 * @param string|null $format Translated message with one %s for the IDs; defaults to the invalid values message.
+	 * @return \WP_Error
+	 */
+	private static function invalid_value_error( array $ids, ?string $format = null ): \WP_Error {
+		/* translators: %s: comma-separated setting IDs. */
+		$format ??= __( 'These settings have invalid values: %s. Nothing was saved.', 'woocommerce' );
+		return new \WP_Error(
+			'woocommerce_ability_settings_invalid_value',
+			sprintf( $format, implode( ', ', $ids ) ),
+			array(
+				'status' => 400,
+				'ids'    => $ids,
+			)
+		);
+	}
+
+	/**
+	 * Changes are limited to one group and twenty settings per call. Each item sends `value` or `values`, never both.
+	 *
+	 * @return array
+	 */
+	private static function get_input_schema(): array {
+		$branches = SettingsQuery::get_value_schema()['anyOf'];
+		$is_list  = static fn( array $branch ): bool => 'array' === ( $branch['type'] ?? null );
+		return array(
+			'type'                 => 'object',
+			'properties'           => array(
+				'group'    => array(
+					'type'      => 'string',
+					'minLength' => 1,
+				),
+				'settings' => array(
+					'type'     => 'array',
+					'minItems' => 1,
+					'maxItems' => 20,
+					'items'    => array(
+						'type'                 => 'object',
+						'properties'           => array(
+							'id'     => array(
+								'type'      => 'string',
+								'minLength' => 1,
+							),
+							'value'  => array(
+								'description' => __( 'A single value, or a retention period with number and unit.', 'woocommerce' ),
+								'anyOf'       => array_values( array_filter( $branches, static fn( array $branch ): bool => ! $is_list( $branch ) ) ),
+							),
+							'values' => array(
+								'description' => __( 'A list, for multiselect and country list settings. Lists from woocommerce/settings-query or previous go here.', 'woocommerce' ),
+							) + current( array_filter( $branches, $is_list ) ),
+						),
+						'required'             => array( 'id' ),
+						'additionalProperties' => false,
+					),
+				),
+			),
+			'required'             => array( 'group', 'settings' ),
+			'additionalProperties' => false,
+		);
+	}
+
+	/**
+	 * `previous` is omitted when the stored value has a shape the settings read would not return.
+	 *
+	 * @return array
+	 */
+	private static function get_output_schema(): array {
+		return array(
+			'type'                 => 'object',
+			'properties'           => array(
+				'settings' => array(
+					'type'  => 'array',
+					'items' => array(
+						'type'                 => 'object',
+						'properties'           => array(
+							'id'       => array( 'type' => 'string' ),
+							'previous' => SettingsQuery::get_value_schema(),
+							'value'    => SettingsQuery::get_value_schema(),
+						),
+						'required'             => array( 'id', 'value' ),
+						'additionalProperties' => false,
+					),
+				),
+			),
+			'required'             => array( 'settings' ),
+			'additionalProperties' => false,
+		);
+	}
+}
diff --git a/plugins/woocommerce/tests/php/src/Internal/Abilities/AbilitiesLoaderTest.php b/plugins/woocommerce/tests/php/src/Internal/Abilities/AbilitiesLoaderTest.php
index 8aeb099942f..c188799dd85 100644
--- a/plugins/woocommerce/tests/php/src/Internal/Abilities/AbilitiesLoaderTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/Abilities/AbilitiesLoaderTest.php
@@ -40,6 +40,7 @@ class AbilitiesLoaderTest extends \WC_Unit_Test_Case {
 		'woocommerce/store-settings-get',
 		'woocommerce/settings-groups-query',
 		'woocommerce/settings-query',
+		'woocommerce/settings-update',
 		'woocommerce/product-terms-query',
 		'woocommerce/product-term-create',
 		'woocommerce/product-term-update',
@@ -413,6 +414,11 @@ class AbilitiesLoaderTest extends \WC_Unit_Test_Case {
 				'idempotent'  => true,
 				'destructive' => true,
 			),
+			'woocommerce/settings-update'             => array(
+				'readonly'    => false,
+				'idempotent'  => true,
+				'destructive' => true,
+			),
 		);

 		foreach ( $expectations as $ability_id => $annotations ) {
@@ -1060,6 +1066,18 @@ class AbilitiesLoaderTest extends \WC_Unit_Test_Case {
 			'store-settings-get'          => array( 'woocommerce/store-settings-get', array() ),
 			'settings-groups-query'       => array( 'woocommerce/settings-groups-query', array() ),
 			'settings-query'              => array( 'woocommerce/settings-query', array( 'group' => 'general' ) ),
+			'settings-update'             => array(
+				'woocommerce/settings-update',
+				array(
+					'group'    => 'general',
+					'settings' => array(
+						array(
+							'id'    => 'woocommerce_currency',
+							'value' => 'EUR',
+						),
+					),
+				),
+			),
 			'product-terms-query'         => array(
 				'woocommerce/product-terms-query',
 				array(
@@ -1297,6 +1315,18 @@ class AbilitiesLoaderTest extends \WC_Unit_Test_Case {
 				),
 			),
 			'tax-rates-query'                => array( 'woocommerce/tax-rates-query', array() ),
+			'settings-update'                => array(
+				'woocommerce/settings-update',
+				array(
+					'group'    => 'general',
+					'settings' => array(
+						array(
+							'id'    => 'woocommerce_currency',
+							'value' => 'EUR',
+						),
+					),
+				),
+			),
 			'product-attributes-query'       => array( 'woocommerce/product-attributes-query', array() ),
 			'product-attribute-create'       => array( 'woocommerce/product-attribute-create', array( 'name' => 'Size' ) ),
 			'product-terms-query'            => array( 'woocommerce/product-terms-query', array( 'taxonomy' => 'product_cat' ) ),
diff --git a/plugins/woocommerce/tests/php/src/Internal/Abilities/Domain/SettingsUpdateTest.php b/plugins/woocommerce/tests/php/src/Internal/Abilities/Domain/SettingsUpdateTest.php
new file mode 100644
index 00000000000..07518fff580
--- /dev/null
+++ b/plugins/woocommerce/tests/php/src/Internal/Abilities/Domain/SettingsUpdateTest.php
@@ -0,0 +1,954 @@
+<?php
+declare( strict_types = 1 );
+
+namespace Automattic\WooCommerce\Tests\Internal\Abilities\Domain;
+
+use Automattic\WooCommerce\Enums\ProductStockStatus;
+use Automattic\WooCommerce\Enums\TaxBasedOn;
+use Automattic\WooCommerce\Internal\Abilities\AbilitiesLoader;
+
+/**
+ * Tests opt-in setting writes.
+ */
+class SettingsUpdateTest extends \WC_Unit_Test_Case {
+
+	/**
+	 * The System Under Test.
+	 *
+	 * @var \WP_Ability
+	 */
+	private $sut;
+
+	/**
+	 * Register abilities and authenticate a manager.
+	 */
+	public function setUp(): void {
+		parent::setUp();
+		add_action( 'wp_abilities_api_init', array( AbilitiesLoader::class, 'register_abilities' ) );
+		do_action( 'wp_abilities_api_init' );
+		wp_set_current_user( self::factory()->user->create( array( 'role' => 'shop_manager' ) ) );
+		$this->sut = wp_get_ability( 'woocommerce/settings-update' );
+	}
+
+	/**
+	 * Adds a field to the general settings page.
+	 *
+	 * @param array $field Field definition merged over a writable text field.
+	 */
+	private function add_general_field( array $field ): void {
+		add_filter(
+			'woocommerce_general_settings',
+			static function ( $settings ) use ( $field ) {
+				$settings[] = $field + array(
+					'id'        => 'extension_field',
+					'type'      => 'text',
+					'default'   => '',
+					'abilities' => array(
+						'read'  => true,
+						'write' => true,
+					),
+				);
+				return $settings;
+			}
+		);
+	}
+
+	/**
+	 * Builds an update input, sending lists in `values` and everything else in `value`.
+	 *
+	 * @param string $group  Settings group.
+	 * @param array  $values Setting IDs mapped to new values.
+	 * @return array
+	 */
+	private function input( string $group, array $values ): array {
+		$settings = array();
+		foreach ( $values as $id => $value ) {
+			$field      = is_array( $value ) && array_values( $value ) === $value ? 'values' : 'value';
+			$settings[] = array(
+				'id'   => $id,
+				$field => $value,
+			);
+		}
+		return array(
+			'group'    => $group,
+			'settings' => $settings,
+		);
+	}
+
+	/**
+	 * @testdox Should update an opted-in Core field and return the previous value.
+	 */
+	public function test_updates_core_field(): void {
+		update_option( 'woocommerce_currency', 'USD' );
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'woocommerce_currency' => 'EUR' ) ) );
+
+		$this->assertSame(
+			array(
+				'settings' => array(
+					array(
+						'id'       => 'woocommerce_currency',
+						'previous' => 'USD',
+						'value'    => 'EUR',
+					),
+				),
+			),
+			$result
+		);
+		$this->assertSame( 'EUR', get_option( 'woocommerce_currency' ) );
+	}
+
+	/**
+	 * @testdox Should refuse fields without a strict read and write opt-in, and passwords.
+	 * @testWith ["text", {"read": true}]
+	 *           ["text", {"write": true}]
+	 *           ["text", {"read": true, "write": "yes"}]
+	 *           ["text", {"read": true, "write": 1}]
+	 *           ["text", {"read": 1, "write": true}]
+	 *           ["text", null]
+	 *           ["password", {"read": true, "write": true}]
+	 * @param string     $type      Field type.
+	 * @param array|null $abilities Field metadata.
+	 */
+	public function test_refuses_fields_without_opt_in( string $type, ?array $abilities ): void {
+		update_option( 'extension_field', 'secret-sentinel' );
+		$this->add_general_field(
+			array(
+				'type'      => $type,
+				'abilities' => $abilities,
+			)
+		);
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => 'changed' ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_not_writable', $result->get_error_code() );
+		$this->assertSame( 403, $result->get_error_data()['status'] );
+		$this->assertSame( array( 'extension_field' ), $result->get_error_data()['ids'] );
+		$this->assertSame( 'secret-sentinel', get_option( 'extension_field' ) );
+	}
+
+	/**
+	 * @testdox Should refuse unknown IDs the same way as withheld ones.
+	 */
+	public function test_refuses_unknown_ids(): void {
+		$result = $this->sut->execute( $this->input( 'general', array( 'missing_field' => 'value' ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_not_writable', $result->get_error_code() );
+		$this->assertSame( array( 'missing_field' ), $result->get_error_data()['ids'] );
+	}
+
+	/**
+	 * @testdox Should refuse fields whose value comes from the definition instead of a stored option.
+	 * @testWith [{"fixed_value": "no"}]
+	 *           [{"value": "supplied"}]
+	 * @param array $metadata Value metadata.
+	 */
+	public function test_refuses_supplied_values( array $metadata ): void {
+		update_option( 'extension_field', 'stored' );
+		$this->add_general_field( $metadata );
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => 'changed' ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_not_writable', $result->get_error_code() );
+		$this->assertSame( 'stored', get_option( 'extension_field' ) );
+	}
+
+	/**
+	 * @testdox Should refuse additional tax classes, which are not stored as an option.
+	 */
+	public function test_refuses_tax_classes(): void {
+		$result = $this->sut->execute( $this->input( 'tax', array( 'woocommerce_tax_classes' => 'Reduced' ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_not_writable', $result->get_error_code() );
+	}
+
+	/**
+	 * @testdox Should refuse personal data retention periods, which let a scheduled job trash orders, anonymize orders or delete accounts.
+	 * @testWith ["woocommerce_delete_inactive_accounts"]
+	 *           ["woocommerce_trash_pending_orders"]
+	 *           ["woocommerce_trash_failed_orders"]
+	 *           ["woocommerce_trash_cancelled_orders"]
+	 *           ["woocommerce_anonymize_refunded_orders"]
+	 *           ["woocommerce_anonymize_completed_orders"]
+	 *
+	 * @param string $id Retention setting ID.
+	 */
+	public function test_refuses_retention_periods( string $id ): void {
+		delete_option( $id );
+
+		$result = $this->sut->execute(
+			$this->input(
+				'account',
+				array(
+					$id => array(
+						'number' => '1',
+						'unit'   => 'days',
+					),
+				)
+			)
+		);
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_not_writable', $result->get_error_code() );
+		$this->assertFalse( get_option( $id ) );
+	}
+
+	/**
+	 * @testdox Should refuse toggles that enable irreversible personal data removal or share usage or shopper data.
+	 * @testWith ["account", "woocommerce_erasure_request_removes_order_data"]
+	 *           ["account", "woocommerce_erasure_request_removes_download_data"]
+	 *           ["account", "woocommerce_allow_bulk_remove_personal_data"]
+	 *           ["advanced", "woocommerce_allow_tracking"]
+	 *           ["general", "woocommerce_address_autocomplete_enabled"]
+	 *
+	 * @param string $group Settings group.
+	 * @param string $id    Setting ID.
+	 */
+	public function test_refuses_privacy_consent_toggles( string $group, string $id ): void {
+		update_option( $id, 'no' );
+
+		$result = $this->sut->execute( $this->input( $group, array( $id => 'yes' ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_not_writable', $result->get_error_code() );
+		$this->assertSame( 'no', get_option( $id ) );
+	}
+
+	/**
+	 * @testdox Should refuse settings that open paid downloads to anyone with the file URL.
+	 * @testWith ["woocommerce_file_download_method", "force", "redirect"]
+	 *           ["woocommerce_downloads_redirect_fallback_allowed", "no", "yes"]
+	 *           ["woocommerce_downloads_require_login", "yes", "no"]
+	 *           ["woocommerce_downloads_add_hash_to_filename", "yes", "no"]
+	 *
+	 * @param string $id     Setting ID.
+	 * @param string $stored Stored value.
+	 * @param string $sent   Requested value.
+	 */
+	public function test_refuses_download_protection_settings( string $id, string $stored, string $sent ): void {
+		update_option( $id, $stored );
+
+		$result = $this->sut->execute( $this->input( 'products', array( $id => $sent ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_not_writable', $result->get_error_code() );
+		$this->assertSame( $stored, get_option( $id ) );
+	}
+
+	/**
+	 * @testdox Should update an extension field registered directly on a custom group.
+	 */
+	public function test_updates_extension_group_field(): void {
+		add_filter(
+			'woocommerce_settings_groups',
+			static function ( $groups ) {
+				$groups[] = array(
+					'id'    => 'extension',
+					'label' => 'Extension',
+				);
+				return $groups;
+			}
+		);
+		add_filter(
+			'woocommerce_settings-extension',
+			static function ( $settings ) {
+				$settings[] = array(
+					'id'         => 'mode',
+					'type'       => 'select',
+					'option_key' => 'extension_mode',
+					'default'    => 'sandbox',
+					'options'    => array(
+						'sandbox' => 'Sandbox',
+						'live'    => 'Live',
+					),
+					'abilities'  => array(
+						'read'  => true,
+						'write' => true,
+					),
+				);
+				return $settings;
+			}
+		);
+
+		$result = $this->sut->execute( $this->input( 'extension', array( 'mode' => 'live' ) ) );
+
+		$this->assertSame( 'sandbox', $result['settings'][0]['previous'] );
+		$this->assertSame( 'live', $result['settings'][0]['value'] );
+		$this->assertSame( 'live', get_option( 'extension_mode' ) );
+		$this->assertFalse( get_option( 'mode' ), 'The value should be saved under the option key, not the field ID.' );
+	}
+
+	/**
+	 * @testdox Should update an extension field added to a Core settings page and run admin sanitize filters.
+	 */
+	public function test_updates_extension_page_field(): void {
+		$this->add_general_field( array() );
+		add_filter( 'woocommerce_admin_settings_sanitize_option_extension_field', 'strtoupper' );
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => 'compact' ) ) );
+
+		$this->assertSame( '', $result['settings'][0]['previous'] );
+		$this->assertSame( 'COMPACT', $result['settings'][0]['value'] );
+		$this->assertSame( 'COMPACT', get_option( 'extension_field' ) );
+	}
+
+	/**
+	 * @testdox Should read and save an extension field under its field name, as the admin save does.
+	 * @testWith ["extension_stored", "extension_stored", null]
+	 *           ["extension_options[mode]", "extension_options", "mode"]
+	 * @param string      $field_name Name the admin form posts the field under.
+	 * @param string      $option     Option the admin save writes.
+	 * @param string|null $member     Member of that option the field is stored in.
+	 */
+	public function test_updates_field_under_field_name( string $field_name, string $option, ?string $member ): void {
+		$stored = static fn( string $value ) => $member ? array(
+			$member => $value,
+			'other' => 'kept',
+		) : $value;
+		update_option( $option, $stored( 'old' ) );
+		$this->add_general_field( array( 'field_name' => $field_name ) );
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => 'new' ) ) );
+
+		$this->assertSame( 'old', $result['settings'][0]['previous'] );
+		$this->assertSame( 'new', $result['settings'][0]['value'] );
+		$this->assertSame( $stored( 'new' ), get_option( $option ) );
+		$this->assertFalse( get_option( 'extension_field' ) );
+		$read = wp_get_ability( 'woocommerce/settings-query' )->execute(
+			array(
+				'group'   => 'general',
+				'include' => array( 'extension_field' ),
+			)
+		);
+		$this->assertSame( 'new', $read['settings'][0]['value'] );
+	}
+
+	/**
+	 * @testdox Should refuse values the REST settings validators or field types reject.
+	 * @testWith ["select", "not-an-option"]
+	 *           ["select", ["sandbox"]]
+	 *           ["checkbox", "maybe"]
+	 *           ["checkbox", 0]
+	 *           ["checkbox", "0"]
+	 *           ["checkbox", 1]
+	 *           ["text", true]
+	 *           ["number", "abc"]
+	 *           ["multiselect", ["sandbox", "unknown"]]
+	 *           ["relative_date_selector", {"number": "3", "unit": "decades"}]
+	 * @param string $type  Field type.
+	 * @param mixed  $value Requested value.
+	 */
+	public function test_refuses_invalid_values( string $type, $value ): void {
+		update_option( 'extension_field', 'stored' );
+		$this->add_general_field(
+			array(
+				'type'    => $type,
+				'options' => array(
+					'sandbox' => 'Sandbox',
+					'live'    => 'Live',
+				),
+			)
+		);
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => $value ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_invalid_value', $result->get_error_code() );
+		$this->assertSame( 400, $result->get_error_data()['status'] );
+		$this->assertSame( array( 'extension_field' ), $result->get_error_data()['ids'] );
+		$this->assertSame( 'stored', get_option( 'extension_field' ) );
+	}
+
+	/**
+	 * @testdox Should save values in the stored form of their field type.
+	 * @testWith ["checkbox", true, "yes"]
+	 *           ["checkbox", false, "no"]
+	 *           ["checkbox", "yes", "yes"]
+	 *           ["checkbox", "no", "no"]
+	 *           ["checkbox", "", "no"]
+	 *           ["number", 15, "15"]
+	 *           ["multiselect", ["live", "sandbox"], ["live", "sandbox"]]
+	 *           ["relative_date_selector", {"number": "3", "unit": "weeks"}, {"number": 3, "unit": "weeks"}]
+	 * @param string $type     Field type.
+	 * @param mixed  $value    Requested value.
+	 * @param mixed  $expected Stored value.
+	 */
+	public function test_normalizes_values( string $type, $value, $expected ): void {
+		$this->add_general_field(
+			array(
+				'type'    => $type,
+				'options' => array(
+					'sandbox' => 'Sandbox',
+					'live'    => 'Live',
+				),
+			)
+		);
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => $value ) ) );
+
+		$this->assertIsArray( $result );
+		$this->assertSame( $expected, $result['settings'][0]['value'] );
+		$this->assertSame( $expected, get_option( 'extension_field' ) );
+	}
+
+	/**
+	 * @testdox Should turn off a checkbox that defaults to on when sent an empty value.
+	 */
+	public function test_saves_empty_checkbox_as_no(): void {
+		update_option( 'woocommerce_enable_guest_checkout', 'yes' );
+
+		$result = $this->sut->execute( $this->input( 'account', array( 'woocommerce_enable_guest_checkout' => '' ) ) );
+
+		$this->assertIsArray( $result );
+		$this->assertSame( 'no', $result['settings'][0]['value'] );
+		$this->assertSame( 'no', get_option( 'woocommerce_enable_guest_checkout' ) );
+	}
+
+	/**
+	 * @testdox Should refuse list entries the admin save would drop, even when they are valid choices.
+	 * @testWith [["0"]]
+	 *           [["0", "live"]]
+	 * @param array $values Requested list.
+	 */
+	public function test_refuses_list_entries_admin_save_drops( array $values ): void {
+		update_option( 'extension_field', array( 'live' ) );
+		$this->add_general_field(
+			array(
+				'type'    => 'multiselect',
+				'options' => array(
+					'0'    => 'None',
+					'live' => 'Live',
+				),
+			)
+		);
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => $values ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_invalid_value', $result->get_error_code() );
+		$this->assertSame( array( 'live' ), get_option( 'extension_field' ) );
+	}
+
+	/**
+	 * @testdox Should save an empty list.
+	 */
+	public function test_saves_empty_list(): void {
+		update_option( 'extension_field', array( 'live' ) );
+		$this->add_general_field(
+			array(
+				'type'    => 'multiselect',
+				'options' => array(
+					'0'    => 'None',
+					'live' => 'Live',
+				),
+			)
+		);
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => array() ) ) );
+
+		$this->assertIsArray( $result );
+		$this->assertSame( array(), $result['settings'][0]['value'] );
+		$this->assertSame( array(), get_option( 'extension_field' ) );
+	}
+
+	/**
+	 * @testdox Should validate country fields against store countries and states.
+	 * @testWith ["single_select_country", "US:CA", true]
+	 *           ["single_select_country", "US", false]
+	 *           ["single_select_country", "XX", false]
+	 *           ["multi_select_countries", ["DE", "FR"], true]
+	 *           ["multi_select_countries", ["DE", "XX"], false]
+	 * @param string $type  Field type.
+	 * @param mixed  $value Requested value.
+	 * @param bool   $valid Whether the value is accepted.
+	 */
+	public function test_country_values( string $type, $value, bool $valid ): void {
+		$this->add_general_field( array( 'type' => $type ) );
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'extension_field' => $value ) ) );
+
+		if ( $valid ) {
+			$this->assertSame( $value, get_option( 'extension_field' ) );
+		} else {
+			$this->assertWPError( $result );
+			$this->assertSame( 'woocommerce_ability_settings_invalid_value', $result->get_error_code() );
+		}
+	}
+
+	/**
+	 * @testdox Should change nothing when any item in a batch is refused.
+	 * @testWith ["woocommerce_default_country", "invalid-country", "woocommerce_ability_settings_invalid_value"]
+	 *           ["missing_field", "Paris", "woocommerce_ability_settings_not_writable"]
+	 * @param string $bad_id    ID of the refused item.
+	 * @param string $bad_value Value of the refused item.
+	 * @param string $code      Expected error code.
+	 */
+	public function test_batch_is_all_or_nothing( string $bad_id, string $bad_value, string $code ): void {
+		update_option( 'woocommerce_currency', 'USD' );
+		update_option( 'woocommerce_store_city', 'Berlin' );
+		update_option( 'woocommerce_default_country', 'DE' );
+		$values = array(
+			'woocommerce_currency'   => 'EUR',
+			'woocommerce_store_city' => 'Paris',
+			$bad_id                  => $bad_value,
+		);
+
+		$result = $this->sut->execute( $this->input( 'general', $values ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( $code, $result->get_error_code() );
+		$this->assertSame( array( $bad_id ), $result->get_error_data()['ids'] );
+		$this->assertStringContainsString( $bad_id, $result->get_error_message() );
+		$this->assertStringNotContainsString( 'woocommerce_currency', $result->get_error_message() );
+		$this->assertSame( 'USD', get_option( 'woocommerce_currency' ) );
+		$this->assertSame( 'Berlin', get_option( 'woocommerce_store_city' ) );
+		$this->assertSame( 'DE', get_option( 'woocommerce_default_country' ) );
+	}
+
+	/**
+	 * @testdox Should refuse an item that sends both value and values, or neither.
+	 * @testWith [{"value": "EUR", "values": ["EUR"]}]
+	 *           [{}]
+	 * @param array $fields Value fields of the item.
+	 */
+	public function test_refuses_items_without_exactly_one_value_field( array $fields ): void {
+		update_option( 'woocommerce_currency', 'USD' );
+
+		$result = $this->sut->execute(
+			array(
+				'group'    => 'general',
+				'settings' => array( array( 'id' => 'woocommerce_currency' ) + $fields ),
+			)
+		);
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_invalid_value', $result->get_error_code() );
+		$this->assertSame( array( 'woocommerce_currency' ), $result->get_error_data()['ids'] );
+		$this->assertSame( 'These settings need exactly one of value or values: woocommerce_currency. Nothing was saved.', $result->get_error_message() );
+		$this->assertSame( 'USD', get_option( 'woocommerce_currency' ) );
+	}
+
+	/**
+	 * @testdox Should name the expected field when a setting is sent in the wrong one.
+	 * @testWith ["multiselect", "value", "live", "values"]
+	 *           ["text", "values", ["live"], "value"]
+	 * @param string $type     Field type.
+	 * @param string $field    Value field the item uses.
+	 * @param mixed  $value    Requested value.
+	 * @param string $expected Value field the setting takes.
+	 */
+	public function test_names_expected_field_for_wrong_field( string $type, string $field, $value, string $expected ): void {
+		update_option( 'extension_field', 'stored' );
+		$this->add_general_field(
+			array(
+				'type'    => $type,
+				'options' => array( 'live' => 'Live' ),
+			)
+		);
+
+		$result = $this->sut->execute(
+			array(
+				'group'    => 'general',
+				'settings' => array(
+					array(
+						'id'   => 'extension_field',
+						$field => $value,
+					),
+				),
+			)
+		);
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_invalid_value', $result->get_error_code() );
+		$this->assertSame( array( 'extension_field' => $expected ), $result->get_error_data()['expected'] );
+		$this->assertStringContainsString( "in {$expected}", $result->get_error_message() );
+		$this->assertStringContainsString( 'extension_field', $result->get_error_message() );
+		$this->assertSame( 'stored', get_option( 'extension_field' ) );
+	}
+
+	/**
+	 * @testdox Should refuse a list in value through the input schema, before any setting is looked up.
+	 */
+	public function test_input_schema_refuses_list_in_value(): void {
+		$result = $this->sut->execute(
+			array(
+				'group'    => 'general',
+				'settings' => array(
+					array(
+						'id'    => 'woocommerce_specific_allowed_countries',
+						'value' => array( 'DE' ),
+					),
+				),
+			)
+		);
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'ability_invalid_input', $result->get_error_code() );
+	}
+
+	/**
+	 * @testdox Should restore a list setting by sending its previous value back in values.
+	 */
+	public function test_restores_list_from_previous(): void {
+		update_option( 'woocommerce_specific_allowed_countries', array( 'DE', 'FR' ) );
+		$changed = $this->sut->execute( $this->input( 'general', array( 'woocommerce_specific_allowed_countries' => array( 'AT' ) ) ) );
+		$this->assertIsArray( $changed );
+
+		$restored = $this->sut->execute( $this->input( 'general', array( 'woocommerce_specific_allowed_countries' => $changed['settings'][0]['previous'] ) ) );
+
+		$this->assertIsArray( $restored );
+		$this->assertSame( array( 'DE', 'FR' ), get_option( 'woocommerce_specific_allowed_countries' ) );
+	}
+
+	/**
+	 * @testdox Should accept only published pages, or an empty value, for page settings.
+	 */
+	public function test_page_values(): void {
+		$page    = self::factory()->post->create( array( 'post_type' => 'page' ) );
+		$draft   = self::factory()->post->create(
+			array(
+				'post_type'   => 'page',
+				'post_status' => 'draft',
+			)
+		);
+		$product = self::factory()->post->create( array( 'post_type' => 'product' ) );
+		update_option( 'woocommerce_terms_page_id', '' );
+
+		foreach ( array( 'abc', (string) $draft, (string) $product, '999999' ) as $value ) {
+			$result = $this->sut->execute( $this->input( 'advanced', array( 'woocommerce_terms_page_id' => $value ) ) );
+			$this->assertWPError( $result, "{$value} should be refused." );
+			$this->assertSame( 'woocommerce_ability_settings_invalid_value', $result->get_error_code() );
+		}
+		$this->assertSame( '', get_option( 'woocommerce_terms_page_id' ) );
+
+		$result = $this->sut->execute( $this->input( 'advanced', array( 'woocommerce_terms_page_id' => $page ) ) );
+		$this->assertIsArray( $result );
+		$this->assertSame( (string) $page, get_option( 'woocommerce_terms_page_id' ) );
+
+		$result = $this->sut->execute( $this->input( 'advanced', array( 'woocommerce_terms_page_id' => '' ) ) );
+		$this->assertIsArray( $result );
+		$this->assertSame( '', get_option( 'woocommerce_terms_page_id' ) );
+	}
+
+	/**
+	 * @testdox Should restore an unset checkout page from the previous value it reports.
+	 */
+	public function test_restores_unset_checkout_page_from_previous(): void {
+		$page = self::factory()->post->create( array( 'post_type' => 'page' ) );
+		delete_option( 'woocommerce_checkout_page_id' );
+
+		$changed = $this->sut->execute( $this->input( 'advanced', array( 'woocommerce_checkout_page_id' => $page ) ) );
+		$this->assertIsArray( $changed );
+		$this->assertSame( -1, $changed['settings'][0]['previous'] );
+
+		$restored = $this->sut->execute( $this->input( 'advanced', array( 'woocommerce_checkout_page_id' => $changed['settings'][0]['previous'] ) ) );
+		$this->assertIsArray( $restored );
+		$this->assertSame( '', get_option( 'woocommerce_checkout_page_id' ) );
+		$this->assertSame( -1, wc_get_page_id( 'checkout' ) );
+
+		$result = $this->sut->execute( $this->input( 'advanced', array( 'woocommerce_checkout_page_id' => '-2' ) ) );
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_invalid_value', $result->get_error_code() );
+	}
+
+	/**
+	 * @testdox Should refuse page settings that would share a page, against both the batch and the stored pages.
+	 * @testWith ["woocommerce_checkout_page_id", "woocommerce_cart_page_id"]
+	 *           ["woocommerce_myaccount_page_id", "woocommerce_checkout_page_id"]
+	 *           ["woocommerce_terms_page_id", "woocommerce_checkout_page_id"]
+	 *           ["woocommerce_refund_returns_page_id", "woocommerce_cart_page_id"]
+	 *           ["woocommerce_refund_returns_page_id", "woocommerce_checkout_page_id"]
+	 *           ["woocommerce_refund_returns_page_id", "woocommerce_myaccount_page_id"]
+	 *           ["woocommerce_checkout_page_id", "woocommerce_refund_returns_page_id"]
+	 * @param string $requested Page setting the batch changes.
+	 * @param string $stored    Page setting that already uses the page.
+	 */
+	public function test_refuses_shared_pages( string $requested, string $stored ): void {
+		$page = (string) self::factory()->post->create( array( 'post_type' => 'page' ) );
+		update_option( $stored, $page );
+		update_option( $requested, '' );
+
+		$result = $this->sut->execute( $this->input( 'advanced', array( $requested => $page ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_page_conflict', $result->get_error_code() );
+		$this->assertSame( array( $requested ), $result->get_error_data()['ids'] );
+		$this->assertSame( '', get_option( $requested ) );
+
+		$other  = (string) self::factory()->post->create( array( 'post_type' => 'page' ) );
+		$result = $this->sut->execute(
+			$this->input(
+				'advanced',
+				array(
+					$requested => $other,
+					$stored    => $other,
+				)
+			)
+		);
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_page_conflict', $result->get_error_code() );
+		$this->assertSame( $page, get_option( $stored ) );
+	}
+
+	/**
+	 * @testdox Should refuse the shop page as the refund and returns policy, from either the advanced or the products group.
+	 */
+	public function test_refuses_shop_page_as_refund_policy(): void {
+		$page = (string) self::factory()->post->create( array( 'post_type' => 'page' ) );
+		update_option( 'woocommerce_shop_page_id', $page );
+		update_option( 'woocommerce_refund_returns_page_id', '' );
+
+		$result = $this->sut->execute( $this->input( 'advanced', array( 'woocommerce_refund_returns_page_id' => $page ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_page_conflict', $result->get_error_code() );
+		$this->assertSame( array( 'woocommerce_refund_returns_page_id' ), $result->get_error_data()['ids'] );
+		$this->assertSame( '', get_option( 'woocommerce_refund_returns_page_id' ) );
+
+		$refund = (string) self::factory()->post->create( array( 'post_type' => 'page' ) );
+		update_option( 'woocommerce_refund_returns_page_id', $refund );
+
+		$result = $this->sut->execute( $this->input( 'products', array( 'woocommerce_shop_page_id' => $refund ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_page_conflict', $result->get_error_code() );
+		$this->assertSame( $page, get_option( 'woocommerce_shop_page_id' ) );
+	}
+
+	/**
+	 * @testdox Should queue a rewrite rules flush after every save, including endpoint slug and shop page changes, but not after a refused one.
+	 */
+	public function test_save_queues_rewrite_flush(): void {
+		update_option( 'woocommerce_queue_flush_rewrite_rules', 'no' );
+		$this->sut->execute( $this->input( 'advanced', array( 'woocommerce_myaccount_orders_endpoint' => 'my-orders' ) ) );
+		$this->assertSame( 'my-orders', get_option( 'woocommerce_myaccount_orders_endpoint' ) );
+		$this->assertSame( 'yes', get_option( 'woocommerce_queue_flush_rewrite_rules' ) );
+
+		$shop = self::factory()->post->create( array( 'post_type' => 'page' ) );
+		update_option( 'woocommerce_queue_flush_rewrite_rules', 'no' );
+		$this->sut->execute( $this->input( 'products', array( 'woocommerce_shop_page_id' => $shop ) ) );
+		$this->assertSame( $shop, wc_get_page_id( 'shop' ) );
+		$this->assertSame( 'yes', get_option( 'woocommerce_queue_flush_rewrite_rules' ) );
+
+		update_option( 'woocommerce_queue_flush_rewrite_rules', 'no' );
+		$this->sut->execute( $this->input( 'general', array( 'woocommerce_currency' => 'EUR' ) ) );
+		$this->assertSame( 'yes', get_option( 'woocommerce_queue_flush_rewrite_rules' ) );
+
+		update_option( 'woocommerce_queue_flush_rewrite_rules', 'no' );
+		$this->assertWPError( $this->sut->execute( $this->input( 'general', array( 'missing_field' => 'value' ) ) ) );
+		$this->assertSame( 'no', get_option( 'woocommerce_queue_flush_rewrite_rules' ) );
+	}
+
+	/**
+	 * @testdox Should recount product terms when out of stock visibility changes, and only then.
+	 */
+	public function test_out_of_stock_visibility_change_recounts_terms(): void {
+		update_option( 'woocommerce_hide_out_of_stock_items', 'no' );
+		$term_id = (int) wp_insert_term( 'Recount category', 'product_cat' )['term_id'];
+		$product = \WC_Helper_Product::create_simple_product();
+		$product->set_category_ids( array( $term_id ) );
+		$product->set_stock_status( ProductStockStatus::OUT_OF_STOCK );
+		$product->save();
+		wc_recount_all_terms( false );
+		$this->assertSame( 1, (int) get_term_meta( $term_id, 'product_count_product_cat', true ) );
+
+		$recounts = 0;
+		$counter  = static function ( $recount ) use ( &$recounts ) {
+			++$recounts;
+			return $recount;
+		};
+		add_filter( 'woocommerce_product_recount_terms', $counter );
+
+		$this->sut->execute( $this->input( 'products', array( 'woocommerce_hide_out_of_stock_items' => false ) ) );
+		$this->assertSame( 0, $recounts );
+
+		$this->sut->execute( $this->input( 'products', array( 'woocommerce_hide_out_of_stock_items' => true ) ) );
+		remove_filter( 'woocommerce_product_recount_terms', $counter );
+
+		$this->assertSame( 'yes', get_option( 'woocommerce_hide_out_of_stock_items' ) );
+		$this->assertSame( 0, (int) get_term_meta( $term_id, 'product_count_product_cat', true ) );
+	}
+
+	/**
+	 * @testdox Should invalidate cached shipping rates after shipping or tax changes, and only then.
+	 */
+	public function test_shipping_and_tax_changes_invalidate_shipping_rates(): void {
+		set_transient( 'shipping-transient-version', 'stale' );
+		$this->sut->execute( $this->input( 'shipping', array( 'woocommerce_shipping_hide_rates_when_free' => true ) ) );
+
+		$this->assertSame( 'yes', get_option( 'woocommerce_shipping_hide_rates_when_free' ) );
+		$this->assertNotSame( 'stale', \WC_Cache_Helper::get_transient_version( 'shipping' ) );
+
+		set_transient( 'shipping-transient-version', 'stale' );
+		$this->sut->execute( $this->input( 'tax', array( 'woocommerce_tax_based_on' => TaxBasedOn::BILLING ) ) );
+
+		$this->assertSame( TaxBasedOn::BILLING, get_option( 'woocommerce_tax_based_on' ) );
+		$this->assertNotSame( 'stale', \WC_Cache_Helper::get_transient_version( 'shipping' ) );
+
+		set_transient( 'shipping-transient-version', 'stale' );
+		$this->sut->execute( $this->input( 'general', array( 'woocommerce_currency' => 'EUR' ) ) );
+
+		$this->assertSame( 'stale', \WC_Cache_Helper::get_transient_version( 'shipping' ) );
+	}
+
+	/**
+	 * @testdox Should refuse a batch that names the same setting twice.
+	 */
+	public function test_refuses_duplicate_ids(): void {
+		$input               = $this->input( 'general', array( 'woocommerce_currency' => 'EUR' ) );
+		$input['settings'][] = array(
+			'id'    => 'woocommerce_currency',
+			'value' => 'GBP',
+		);
+		update_option( 'woocommerce_currency', 'USD' );
+
+		$result = $this->sut->execute( $input );
+
+		$this->assertWPError( $result );
+		$this->assertSame( array( 'woocommerce_currency' ), $result->get_error_data()['ids'] );
+		$this->assertSame( 'These settings are named more than once: woocommerce_currency. Send each setting once. Nothing was saved.', $result->get_error_message() );
+		$this->assertSame( 'USD', get_option( 'woocommerce_currency' ) );
+	}
+
+	/**
+	 * @testdox Should update one member of an email settings option without touching the others.
+	 */
+	public function test_updates_array_option_key(): void {
+		update_option(
+			'woocommerce_new_order_settings',
+			array(
+				'subject'   => 'Old subject',
+				'recipient' => 'private@example.test',
+			)
+		);
+
+		$result = $this->sut->execute( $this->input( 'email_new_order', array( 'subject' => 'New subject' ) ) );
+
+		$this->assertSame( 'Old subject', $result['settings'][0]['previous'] );
+		$this->assertSame( 'New subject', $result['settings'][0]['value'] );
+		$this->assertSame(
+			array(
+				'subject'   => 'New subject',
+				'recipient' => 'private@example.test',
+			),
+			get_option( 'woocommerce_new_order_settings' )
+		);
+	}
+
+	/**
+	 * @testdox Should keep the autoload flag the settings page declares, as the admin save does.
+	 */
+	public function test_keeps_declared_autoload(): void {
+		delete_option( 'woocommerce_enable_guest_checkout' );
+		add_option( 'woocommerce_enable_guest_checkout', 'yes', '', false );
+
+		$result = $this->sut->execute( $this->input( 'account', array( 'woocommerce_enable_guest_checkout' => 'no' ) ) );
+
+		$this->assertIsArray( $result );
+		$this->assertSame( 'no', get_option( 'woocommerce_enable_guest_checkout' ) );
+		$this->assertArrayNotHasKey( 'woocommerce_enable_guest_checkout', wp_load_alloptions( true ) );
+	}
+
+	/**
+	 * @testdox Should keep backslashes in text values, whether saved through the admin save or as an option member.
+	 */
+	public function test_keeps_backslashes(): void {
+		$this->add_general_field( array() );
+		$this->add_general_field(
+			array(
+				'id'   => 'extension_textarea',
+				'type' => 'textarea',
+			)
+		);
+
+		$result = $this->sut->execute(
+			$this->input(
+				'general',
+				array(
+					'extension_field'    => 'C:\Reports',
+					'extension_textarea' => 'C:\Reports\\\\Archive',
+				)
+			)
+		);
+
+		$this->assertIsArray( $result );
+		$this->assertSame( 'C:\Reports', get_option( 'extension_field' ) );
+		$this->assertSame( 'C:\Reports\\\\Archive', get_option( 'extension_textarea' ) );
+		$this->assertSame( 'C:\Reports', $result['settings'][0]['value'] );
+
+		$this->sut->execute( $this->input( 'email_new_order', array( 'subject' => 'C:\Reports' ) ) );
+
+		$this->assertSame( 'C:\Reports', get_option( 'woocommerce_new_order_settings' )['subject'] );
+	}
+
+	/**
+	 * @testdox Should refuse an email recipient, which is not opted in to writes.
+	 */
+	public function test_refuses_email_recipient(): void {
+		$result = $this->sut->execute( $this->input( 'email_new_order', array( 'recipient' => 'attacker@example.test' ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_not_writable', $result->get_error_code() );
+	}
+
+	/**
+	 * @testdox Should return the group error for unknown groups.
+	 */
+	public function test_unknown_group(): void {
+		$result = $this->sut->execute( $this->input( 'missing', array( 'id' => 'value' ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'woocommerce_ability_settings_group_not_found', $result->get_error_code() );
+	}
+
+	/**
+	 * @testdox Should refuse customers without changing the setting.
+	 */
+	public function test_refuses_customer(): void {
+		update_option( 'woocommerce_currency', 'USD' );
+		wp_set_current_user( self::factory()->user->create( array( 'role' => 'customer' ) ) );
+
+		$result = $this->sut->execute( $this->input( 'general', array( 'woocommerce_currency' => 'EUR' ) ) );
+
+		$this->assertWPError( $result );
+		$this->assertSame( 'USD', get_option( 'woocommerce_currency' ) );
+	}
+
+	/**
+	 * @testdox Should leave the settings query output unchanged by write opt-ins.
+	 */
+	public function test_settings_query_output_is_unchanged(): void {
+		update_option( 'woocommerce_currency', 'GBP' );
+		$this->add_general_field( array( 'title' => 'Extension field' ) );
+		update_option( 'extension_field', 'stored' );
+
+		$result = wp_get_ability( 'woocommerce/settings-query' )->execute(
+			array(
+				'group'   => 'general',
+				'include' => array( 'extension_field', 'woocommerce_currency' ),
+			)
+		);
+
+		$this->assertSame( 2, $result['total'] );
+		$this->assertSame( array(), $result['omitted'] );
+		$settings = array_column( $result['settings'], null, 'id' );
+		$this->assertSame(
+			array(
+				'id'          => 'extension_field',
+				'label'       => 'Extension field',
+				'description' => '',
+				'type'        => 'text',
+				'value'       => 'stored',
+				'default'     => '',
+			),
+			$settings['extension_field']
+		);
+		$this->assertSame( array( 'id', 'label', 'description', 'type', 'value', 'default', 'options' ), array_keys( $settings['woocommerce_currency'] ) );
+		$this->assertSame( 'GBP', $settings['woocommerce_currency']['value'] );
+	}
+}