0

I've been struggling with this for a long time and would appreciate some help.

I would like to change a value inside WP database using phpmyadmin. Sadly, this change seems to corrupt the database (some things do not work anymore) when the field value has a specific form. I explain:

I want to change a value inside options table, where option_value has the following form:

a:29:{s:9:"recaptcha";a:4:{s:8:"_builtin";i:1;s:7:"sitekey";s:0:"";s:4:"type";s:9:"recaptcha";s:5:"label";s:9:"reCAPTCHA";}s:9:"instagram";a:3:{s:8:"_builtin";i:1;s:4:"type";s:4:"text";s:5:"label";s:14:"Instagram
............

When changing something the site does not work properly (basically I want to change some hardcoded strings for translation reasons).

It seems to me the newlines are the problem but I do not know how to edit without inserting them.

To be more detailed. If for example I export the database and then import the SQL file it works fine. But, if I open this sql file, do NOT change anything and save it again and import, the problem occurs.

1

The data is serialized. You can try an online editor like this one (just use JSON), otherwise you can do it with a little PHP:

$data = unserialize( $your_serialized_data );
$data['this'] = 'that';

echo serialize( $data );
  • Thank you for your reply. I am really sorry but I do not understand how to use the online editor. – fesarlis Oct 13 '15 at 11:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.