Title: wp_insert_post not inserting given comment_status
Last modified: August 22, 2016

---

# wp_insert_post not inserting given comment_status

 *  [Lanody](https://wordpress.org/support/users/lanody/)
 * (@lanody)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wp_insert_post-not-inserting-given-comment_status/)
 * Heyo,
 * I’m having some problem with the wp_insert_post() function. I’m trying to save
   some new posts automatically and everything seems fine except for the ‘comment_status’.
   It just opens it, no matter what I enter before.
 *     ```
       $wordpress_post_data = array(
       'post_content' 		=> $fb_content,
       'post_name'		=> $fb_post_name,
       'post_title' 		=> $options['post_title'],
       'post_status' 		=> 'publish',
       'post_author' 		=> $options['post_user'],
       'post_date' 		=> $fb_created_time,
       'post_date_gmt' 	=> $fb_created_time,
       'comment_status'	=> 'closed',
       'post_category' 	=> array($options['post_category']),
       'tags_input' 		=> $options['post_tags']
       );
       	return $wordpress_post_data;
       ```
   

The topic ‘wp_insert_post not inserting given comment_status’ is closed to new replies.

## Tags

 * [wp_insert_post](https://wordpress.org/support/topic-tag/wp_insert_post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Lanody](https://wordpress.org/support/users/lanody/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/wp_insert_post-not-inserting-given-comment_status/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
