Search & Replace
[resolved] Serialized Data Issue (2 posts)

  1. dliciaga
    Posted 3 years ago #

    So I search and replaced for serialized data. Needed to replace 1 word in a widget.

    Bad idea.....I hit the go button before I backed up my database (bigger mistake). All my widgets disappeared from my entire network.

    Got them back by hacking the includes/functions.php file:

    function maybe_unserialize( $original ) {
        if ( is_serialized( $original ) ) {
            $fixed = preg_replace_callback(
                $original );
            return @unserialize( $fixed );
        return $original;
    function serialize_fix_callback($match) { return 's:' . strlen($match[2]); }

    The question is that the data is there, you don't by chance know how to get it all back without this hack.


  2. Frank Bueltge
    Plugin Author

    Posted 3 years ago #

    The plugin don't work with serialized data, use a default sql statement for search/replace. The first area to s/r give the chance to use it about all tables and fields, often usefull, but it is important, that the user know, what he does.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Search & Replace
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.