Title: Serialized Data Issue
Last modified: August 20, 2016

---

# Serialized Data Issue

 *  Resolved [dliciaga](https://wordpress.org/support/users/dliciaga/)
 * (@dliciaga)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/serialized-data-issue/)
 * 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(
                   '!(?<=^|;)s:(\d+)(?=:"(.*?)";(?:}|a:|s:|b:|i:|o:|N;))!s',
                   'serialize_fix_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.
 * [http://wordpress.org/extend/plugins/search-and-replace/](http://wordpress.org/extend/plugins/search-and-replace/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/serialized-data-issue/#post-3356274)
 * 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.

Viewing 1 replies (of 1 total)

The topic ‘Serialized Data Issue’ is closed to new replies.

 * ![](https://ps.w.org/search-and-replace/assets/icon-256x256.png?rev=1776844)
 * [Search & Replace](https://wordpress.org/plugins/search-and-replace/)
 * [Support Threads](https://wordpress.org/support/plugin/search-and-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/search-and-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/search-and-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/search-and-replace/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/serialized-data-issue/#post-3356274)
 * Status: resolved