Title: [Plugin: Advanced Custom Fields] all custom fields data is corrupted
Last modified: August 20, 2016

---

# [Plugin: Advanced Custom Fields] all custom fields data is corrupted

 *  Anonymous User 2630056
 * (@anonymized-2630056)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/)
 * All custom fields data is corrupted and lost, it returns some numbers as field
   values.
 * [http://wordpress.org/extend/plugins/advanced-custom-fields/](http://wordpress.org/extend/plugins/advanced-custom-fields/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [raphaelsuzuki](https://wordpress.org/support/users/raphaa00/)
 * (@raphaa00)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317594)
 * I’m having this same issue.
 * This started after the plugin asked to do an Upgrade Databas, and actually nothing
   happened but corrupting the data.
 *  [darthe](https://wordpress.org/support/users/darthe/)
 * (@darthe)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317706)
 * I am also having huge problems since the upgrade. All the Admin boxes are empty.
   The content is still there if I go to html mode but that is not good for my client.
   I am getting no feedback on his site.
 * I would like to stop using this plugin and learn more about custom fields or 
   custom taxonomies so that my site is not at the mercy of someone elses bad programming.
 * Anyone know of a good book on this topic?
 *  Thread Starter Anonymous User 2630056
 * (@anonymized-2630056)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317708)
 * The wordpress codex explains it very good actually. I’ve used it and it’s not
   complicated at all, I was just lazy with this project, now I regret it.
 *  [darthe](https://wordpress.org/support/users/darthe/)
 * (@darthe)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317709)
 * Thanks peachepe, I appreciate your responding. The codex is mostly about using
   custom fields for posts and I am working with pages so that was my difficulty
   with that. But, I think I will print out that codex page and start there. Also
   at Lynda.com there is a new class on WordPress that explains custom taxonomies
   that I started a couple of days ago. It looks like it might be a solution for
   me also.
 * But now I have to tear this whole site apart. I hate disabling the ACF plugin
   and seeing that fatal error message on the home page. Better do it over night
   so it will be up by the morning.
 * I have looked at the other plugins for custom fields and they do not seem to 
   be being kept up by the authors.
 *  Thread Starter Anonymous User 2630056
 * (@anonymized-2630056)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317751)
 * Hi,
 * I found that data is still there, I’m able to retrieve it using get_post_meta.
 * So I made my own meta boxes, unistalled Advanced Custom Fields, and everything
   is back to normal.
 * Here’s some code if anyone needs help doing that:
 *     ```
       add_action('add_meta_boxes', 'lonchera_add_infoproducto');
   
       function lonchera_add_infoproducto()
       {
       	add_meta_box('lonchera_infoproducto', 'Informaci&oacute;n del producto', 'lonchera_infoproducto', 'post', 'normal', 'default');
       }
   
       function lonchera_infoproducto() {
           global $post, $wp_locale;
   
           wp_nonce_field( plugin_basename(__FILE__), 'lonchera_infoproducto_noncename' );
   
       	$codigo = get_post_meta($post->ID, 'codigo', true);
   
       	$lol = '<label for="marca">C&oacute;digo:</label> <input type="text" name="lonchera_codigo" value="'.$codigo.'" id="lonchera_marca" />';
   
       	echo $lol;
       }
   
       function lonchera_save_infoproducto($post_id, $post) {
   
           if ( !wp_verify_nonce( $_POST['lonchera_infoproducto_noncename'], plugin_basename(__FILE__) )) {
           	return $post_id;
         	}
   
       	// verify if this is an auto save routine. If it is our form has not been submitted, so we dont want
       	// to do anything
       	if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {
       		return $post_id;
       	}
   
       	// Check permissions
       	if ( 'page' == $_POST['post_type'] ) {
       		if ( !current_user_can( 'edit_page', $post_id ) )
       		return $post_id;
       	} else {
       		if ( !current_user_can( 'edit_post', $post_id ) )
       		return $post_id;
       	}
   
           // OK, we're authenticated: we need to find and save the data
           // We'll put it into an array to make it easier to loop though.
   
           $metas['codigo'] = $_POST['lonchera_codigo'];
   
       	foreach ($metas as $key => $value) { // Cycle through the $events_meta array!
               if( $post->post_type == 'revision' ) return; // Don't store custom data twice
               $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)
               if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value
                   update_post_meta($post->ID, $key, $value);
               } else { // If the custom field doesn't have a value
                   add_post_meta($post->ID, $key, $value);
               }
               //if(!$value) delete_post_meta($post->ID, $key); // Delete if blank
           }
   
       }
   
       add_action('save_post', 'lonchera_save_infoproducto', 1, 2);
       ```
   
 *  Thread Starter Anonymous User 2630056
 * (@anonymized-2630056)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317752)
 * [http://pastebin.com/cCTc9rnv](http://pastebin.com/cCTc9rnv) for nice code format
 *  [darthe](https://wordpress.org/support/users/darthe/)
 * (@darthe)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317753)
 * Thank you for the code, peachepe. I am going to start on this tomorrow. I will
   post again if I run into something I don’t understand. But so far, I think I 
   can do this.
 *  [ogravitymedia](https://wordpress.org/support/users/ogravitymedia/)
 * (@ogravitymedia)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317760)
 * ARGH! just tried to update and the same thing happened. clients site now shows
   just ID#s. does anyone have a fix to this that doesn’t involve scrapping the 
   whole plugin? is the developer on these forums?
 *  [darthe](https://wordpress.org/support/users/darthe/)
 * (@darthe)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317771)
 * I just got mine repaired. First had to deactivate current version of ACF and 
   then deleted it. I went and found the backups I have and reinstalled the sql 
   into the database from the beginning of September. Then I went on the plugins
   page at WordPress for ACF and installed version 2.0.5. That seems to be working
   for me just fine. My site is back to the way it was. I learned some valuable 
   lessons in restoring backups.
 * Here is the link to the author’s forum:
    [http://support.plugins.elliotcondon.com/categories/acf-bugs](http://support.plugins.elliotcondon.com/categories/acf-bugs)
 * Good luck.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘[Plugin: Advanced Custom Fields] all custom fields data is corrupted’
is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [darthe](https://wordpress.org/support/users/darthe/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-all-custom-fields-data-is-corrupted/#post-2317771)
 * Status: not resolved