Title: [Plugin: Gravity Forms &#8211; Update Post] Updating a post deactivates comments
Last modified: August 20, 2016

---

# [Plugin: Gravity Forms – Update Post] Updating a post deactivates comments

 *  [hilj](https://wordpress.org/support/users/hilj/)
 * (@hilj)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-updating-a-post-deactivates-comments/)
 * Hello,
 * Whenever I update a post the comments are deactivated. Updating the post from
   the backend keeps the comments on as suposed to.
 * It is a custom post type and I’m using the Gravity Forms custom post type plugin
   to enable this.
 * Hope somebody can help me 🙂 Thanks!
 * [http://wordpress.org/extend/plugins/gravity-forms-update-post/](http://wordpress.org/extend/plugins/gravity-forms-update-post/)

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

 *  [MarceFX](https://wordpress.org/support/users/marcefx/)
 * (@marcefx)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-updating-a-post-deactivates-comments/#post-3089878)
 * Hi,
 * Same issue :-/ Any ideas?
 * Thanks
 *  [MarceFX](https://wordpress.org/support/users/marcefx/)
 * (@marcefx)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-updating-a-post-deactivates-comments/#post-3089886)
 * Found it! So far, this fix has work for me:
 * `mysql_query("UPDATE wp_posts SET comment_status = REPLACE (comment_status, '
   closed', 'open') WHERE post_status = 'publish' AND post_type = 'product';");`
 * Add it to the end of the end of gravityforms-update-post.php
 * 😉
 *  Thread Starter [hilj](https://wordpress.org/support/users/hilj/)
 * (@hilj)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-updating-a-post-deactivates-comments/#post-3089888)
 * Very nice! Thank you 🙂
 *  [Puggy](https://wordpress.org/support/users/puggy/)
 * (@puggy)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-updating-a-post-deactivates-comments/#post-3089969)
 * I needed to get this done as well, but just running that SQL all the time didn’t
   seem like a great solution so I dug a little and found Gravity Forms’ Gform_post_data
   hook. Using this, here’s how I fixed it:
 *     ```
       add_filter("gform_post_data", "open_comments", 10, 3);
       function open_comments($post_data, $form, $entry){
           $post_data["comment_status"] = "open";
           return $post_data;
       }
       ```
   
 * This modifies the comment status as the form is submitted, without any extra 
   SQL queries. You can also modify this to your liking to be more selective about
   which post types have comments open, or whatever extra logic you need. This can
   also be placed in your functions.php rather than modifying the plugin, if you
   prefer.
 *  [myhero](https://wordpress.org/support/users/myhero/)
 * (@myhero)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-updating-a-post-deactivates-comments/#post-3089970)
 * Hi guys this seems to be the only active thread here.
 * Are you the version available here or this updated plugin:
 * [Update on Github (this is a file download link)](https://bitbucket.org/jupitercow/gravity-forms-update-post/get/master.zip)
 * I would like to use the update but I cannot get it to work, and do not know if
   I’m missing something in terms of setting it up.
 * How were you able to get it working?

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

The topic ‘[Plugin: Gravity Forms – Update Post] Updating a post deactivates comments’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gravity-forms-update-post_68a432.
   svg)
 * [Gravity Forms - Update Post](https://wordpress.org/plugins/gravity-forms-update-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-update-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-update-post/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-update-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-update-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-update-post/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [myhero](https://wordpress.org/support/users/myhero/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-updating-a-post-deactivates-comments/#post-3089970)
 * Status: not resolved