My wordpress sidebar widget disappeared when I changed the twitter link from the database replacing all the previous link with the new ones under wp_options table. I have not changed anything other than the link but still the widget get disappeared from the front side, what I have done wrong and how do I unable it from the database as well.
My wordpress sidebar widget disappeared when I changed the twitter link from the database
Share
I’m not certain, but I suspect your update has resulted in some invalid PHP in the database. In order to store complex structures as strings in the database, the value is serialized before storing.
For example, the following
outputs
Which looks similar to many
wp_optionsvalues. The relevant part is the 8 before “a string”. That’s the length of the string. If you change the string to one of a different length without changing that value, PHP (and WordPress) won’t be able to unserialize the value.For example,
results in
I suspect WordPress has hit that error after your update.
To fix your problem, then, I’d start by reversing the update you ran, so the serialized PHP is valid. Then update the value in the admin screens.
If updating via the admin screens isn’t possible, write a small PHP program to take the (now correct) serialized value, unserialize it, change the appropriate value, and serialize it again. Use the result of the serialization as the new value in the
wp_optionstable.