How do I update a nested option?

wp option does all you need. See wp option patch in particular.

Updates a nested value in an option.


Get a nested option value:

$ wp option pluck ez-toc-settings auto_insert_post_types

Set a nested option value (with an array):

$ wp option patch update ez-toc-settings auto_insert_post_types '{"post":"post"}' --format=json

Leave a Comment