Title: Auto moderate posts
Last modified: August 31, 2016

---

# Auto moderate posts

 *  [kchegwin](https://wordpress.org/support/users/kchegwin/)
 * (@kchegwin)
 * [10 years ago](https://wordpress.org/support/topic/auto-moderate-posts/)
 * Hi Guys,
 * Is there a way the I can auto set a post to draft if a number of terms are not
   met. For example:
    -  if the post title contains the text ‘[http://&#8217](http://&#8217); the 
      post will be disabled.
       if the price of the product goes over a certain amount.
 * The reason I want to do this is that I am importing products and sometimes the
   import goes wonky if the feed is showing incorrect data.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  [Clarion Technologies](https://wordpress.org/support/users/clarionwpdeveloper/)
 * (@clarionwpdeveloper)
 * [10 years ago](https://wordpress.org/support/topic/auto-moderate-posts/#post-7416802)
 * Hello kchegwin,
 * Please use the following code:
 *     ```
       add_filter( 'wp_insert_post_data', 'set_post_to_draft', 99, 2 );
   
       function set_post_to_draft( $data, $postarr ) {
   
         if ( your_condition ) {
           $data['post_status'] = 'draft';
         }
   
         return $data;
       }
       ```
   
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘Auto moderate posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Clarion Technologies](https://wordpress.org/support/users/clarionwpdeveloper/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/auto-moderate-posts/#post-7416802)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
