Title: Modify posted data
Last modified: November 13, 2017

---

# Modify posted data

 *  [etcrafinside](https://wordpress.org/support/users/etcrafinside/)
 * (@etcrafinside)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/modify-posted-data/)
 * Hello,
 * i am trying to modify the posted data of my form. I have tried adding an action
   in my functions.php named “wpcf7_before_send_mail”. Inside this action i have
   tried WPCF7_Submission::get_instance() and get_posted_data() modifying the posted
   data array but i haven’t got any luck.
 * Here is my code:
 * add_action(‘wpcf7_before_send_mail’, ‘mytheme_save_to_getresponse’, 10, 1);
    
   function mytheme_save_to_getresponse($form) { try{
 *  // get current SUBMISSION instance
    $submission = WPCF7_Submission::get_instance();
 *  // Ok go forward
    if ($submission) {
 *  // get submission data
    $data = $submission->get_posted_data_TIB(); $data[“yourage”]
   =33;
 *  }
 *  update_user_meta(1, ‘-log-form’, json_encode((array)$form));
    } catch(Exception
   $ex){ update_user_meta(1, ‘-log-exception’, $ex->getMessage()); }
 *  return $form;
    }
 * How should i do to modify the posted data?
 * Thanks!
 * Regards
 * Rafael
    -  This topic was modified 8 years, 7 months ago by [etcrafinside](https://wordpress.org/support/users/etcrafinside/).

The topic ‘Modify posted data’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/slack-contact-form-7.svg)
 * [Slack Contact Form 7](https://wordpress.org/plugins/slack-contact-form-7/)
 * [Support Threads](https://wordpress.org/support/plugin/slack-contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/slack-contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/slack-contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/slack-contact-form-7/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [etcrafinside](https://wordpress.org/support/users/etcrafinside/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/modify-posted-data/)
 * Status: not resolved