Support » Plugin: Image Widget » [Plugin: Image Widget] Widgets disappears during a server change

  • The widget’s plugin disappears during a server change, I have no image widget in my sidebars.. any idea?

Viewing 6 replies - 1 through 6 (of 6 total)
  • I just came here looking for the answer to the very same problem

    I mnaged to get round the problem by updating all domain references except the ones for the image widget in the options table.

    Then, going through the dashboard to the widgets area I opened up each instance of the image widget and clicked save twice, which made the image re-appear. A quick check in the options table showed that the url of the image had been updated.

    If I tried to make this change directly in the table, then the widget would disappear completely from the widget area.

    Hopefully this will give someone enough clues to enable this to be sorted out a little more elegantly in future.?

    I would really like to be able to update the links directly in the database without the widget disappearing. How can I do this? What am I missing or not updating correctly to make the widget disappear when updating the links directly in the database?

    Ok, I figured out the problem. It has to do with how the PHP serialize() function works.

    Basically, your widget is stored in the wp_options table as a serialized array (the option_name for the Image Widget is widget_widget_sp_image). So, for example, here’s how a string looks serialized:


    Now, when you move to your production server, you typically do a mass replace of localhost/example with That changes the length of the above string from 51 to 45. But your search replace doesn’t change that so you get this:


    …which can’t be unserialized by the PHP unserialize() function. Thus, when WordPress tries to unserialize the content, unserialize fails and the widgets don’t show. What’s worse, if you go to the Widget area in the Admin, the Image Widget data is deleted.

    The solution is to count the number of characters in the new url, and update the string length:


    I’ve tested this and it works.

    Great explanation, thank you.

    That explains why a simple search and replace fails and destroys the widget. Unfortunately if you are using say 50 of these widgets, all of them with different file names, then you have 50 different string lengths.

    May as well click the save button (once) on each widget, 50 clicks and you’re done. To change the string values you must count (manually I assume) each instance, then change the value on each image url string.

    Unless, you have a code snippet that will count the array string and correct the the values automatically. I’d be very interested in that (respectfully), as I have much more than 50.

    Again thanks for the time and explanation.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Image Widget] Widgets disappears during a server change’ is closed to new replies.