I just found out WP_AJAX_GET_COMMENTS($action) function to retrieve comments on WordPress. Someone know how to use it?

Thank you so much Stefano

  • The documentation is available here: wp_ajax_get_comments(). (Note that the function is all lowercase, not UPPERCASE.)
    – Pat J
    Dec 26, 2023 at 17:18
  • Yes, but there aren't any examples. How to retrieve the comment using this function? I don't understand..
    – Stefano
    Dec 29, 2023 at 4:34
  • Fatal error: Uncaught Error: Call to undefined function wp_ajax_get_comments()
    – Stefano
    Dec 29, 2023 at 4:36
  • Please edit your question to include the code you're trying to debug. That might help us determine where you're having trouble.
    – Pat J
    Dec 29, 2023 at 14:37

1 Answer 1


It is being used under wp-admin/js/post.js the function commentsBox.get. The purpose is to get Post comments. The UI related to it should be shown under the Comments page of WordPress. Though if you will further check the code, the selectors aren't present there. So there's no way you could use it just by calling out the function.

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.