How to update widget_text in the wp_options table


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

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.

n7rider 8 months 2020-12-08T00:10:33-05:00 0 Answers 7 views 0

Leave an answer