$post_id = wp_insert_post(array ( 'post_type' => 'your_post_type', 'post_title' => $your_title, 'post_content' => $your_content, 'post_status' => 'publish', 'comment_status' => 'closed', 'ping_status' => 'closed', 'meta_input' => array( '_your_custom_1' => $custom_1, '_your_custom_2' => $custom_2, '_your_custom_3' => $custom_3, ), ));