Whenever a user posts a comment, I'd like to basically have a copy of the post sent to another database for a separate site. The database part is simple, but I can't seem to find the right action hook for this. (I did my testing with a simple echo statement, a failure being it not displaying at all) 'comment_save_pre' would only work when updating a comment, 'wp_set_comment_status' only works when the comment is approved, and 'comment_post' didn't seem to work at all. Does the hook exist?

add_action('...?...', 'on_comment_post');

function on_comment_post($comment){
     echo "Test";

1 Answer 1


You can use wp_insert_comment action, which is triggered on every comment insertion.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.