So you probably know that you can change WordPress options directly in the database with an SQL query, and maybe you’ve come across the /wp-admin/options.php page where you can edit them directly from WordPress. But if the options are held as serialized data, then it gets a bit more tricky. Luckily wp-cli can help.
I’ll assume you can figure out how to download and install wp-cli yourselves. On this occasion I was trying to get rid of the annoying pop-up screen of Really Simple SSL plugin. It should disappear, never to return, when you click the x in the corner of the message, but in my case it was coming back every time I loaded every single page. Which was irritating, to say the least, and it takes up a fair chunk of space at the top of the screen. So I decided to nail it for once and for all. I found out on Google that the key was altering the rlrsssl_options => ssl_success_message_shown option.
So if you use wp-cli to get the option value it looks like this:
There is also the option to display that as json, which is what we need, so lets do that, and pipe it out to a text file.
So now we edit the ssl.txt file and change this bit from false to true.
Then we can just send that json file back into the database with the following:
wp-cli option update rlrsssl_options --format=json < ssl.txt