0

Summary: Updated the option_value for a widget_text made the widget disappear from the UI. How do I bring it back?

Issue: I wanted to fix a typo in one of my widgets. I found that the following row in the wp_options table contains the text with the typo. I updated the option_value column in the row in wp_options table that contains this text. Now, the widget has completely disappeared from the screen.

option_id, option_name, option_value, autoload
83,widget_text,"a:3:{i:2;a:3:{s:5:"title";s:16:"Location";s:4:"text";s:89:"Address";s:6:"filter";b:0;}i:3;a:3:{s:5:"title";s:0:"";s:4:"text";s:334:"<div class="attribution-text">Copyright text</div>";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}",yes

I deleted the above row and refreshed the screen (to see if the old values come back), but now it has created this new row in the table

option_id, option_name, option_value, autoload
'100000000000007', 'widget_text', 'a:1:{s:12:\"_multiwidget\";i:1;}', 'yes'

Can someone help me bring back the widget's text? I backed up the original option_value but copy-pasting it to the row doesn't bring it back in the UI.

Note: I am looking to update entries directly in the database because the Appearance--> Customize got broken after a PHP version upgrade and can't be accessed for a few days.

3
  • The first version is a PHP serialized string, and the numbers are significant, e.g. for strings they're the lengths of the following string. Was that the problem, you updated a string without changing its length too? (e.g. your s:16:"Location" is now wrong because Location is 8 not 16 long, although I realise that's probably a placeholder for the question)
    – Rup
    Commented Dec 8, 2020 at 8:23
  • @Rup, yes that's right. it's just a placeholder for the question. Thanks for the info. Is there something more to it? I tried to revert back to the existing value for the column (which shouldn't have any change to the string length) but that is just getting replaced with the second snippet that I have posted above.
    – n7rider
    Commented Dec 8, 2020 at 13:19
  • I have the same issue. When I paste the string from a backup into the option_value field in phpmyadmin and save, Wordpress replaces the value with a:1:{s:12:"_multiwidget";i:1;} Did you solve your issue? I'm thinking it must be to do with the taxonomy.
    – Nick W
    Commented Jan 21, 2021 at 16:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.