Is it possible to create an unapproved comment using the WordPress XMLRPC API?

I’m trying to create a comment, using the Python library for WordPress’s XMLRPC API, and set the comment’s status to unapproved or “hold”. But all comments insertions via the API seem to create approved comments.

  comment = WordPressComment()
  comment.content = body
  comment.status = 'hold'
  wp.call(NewComment(post_id, comment))

Is this parameter not supported on the create comments method?

Related posts

Leave a Reply

1 comment

  1. Answer: it’s not directly possible by setting the status on the NewComment request.

    But you can use the pre_comment_approved filter to define your own handler and add an unapproved status when the comment is inserted into the database.