I am creating an automation script where I use wp-cli to do plugin/theme installations, configure settings and other.

This script is installing the Enfold Parent and Child theme from Kriesi and after the installation I want to update the theme settings.

Enfold has a avia_options_enfold_child record under wp_options table and in there, I see the serialised data with all the settings. My main concern is to update some nested options in this record but I don't mind if I replace the value completely.

So far, I have tried using the wp option update, wp option patch update and even search-replace commands but it was unsuccessful and I am either getting new options generated or no update at all.

I am thinking of using wp db query or wp db import instead to either run the query or import the sql file but the issue here is that every site that I want to run this script has a different db prefix and since I need to update the wp_options table, every time I run this script I have to somehow get the db prefix and change my command from the wp_options table to the randomdbprefix_options table.

Any suggestions on how I should approach this? Any alternatives?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.