GeneralCommentsPostUserSearchOrderPaginationCustom FieldsTotal CountOverviewUse this tool to create custom code for WordPress Comment Query with WP_Comment_Query class.UsageFill in the user-friendly form.Click the “Update Code” button.Copy the code to your project.Or save it as a snippet and share with the community.ExamplesIf you are still learning how to use this tool, check out the following examples:All comment by specific emailAll unapproved commentsLast 10 approved comments on Review post typeQuery Variable Name The variable used in the code.Show The Loop YesNo Show the comments loop.Comment ID Show comment by ID.Comment Parent ID Show comments based on comment parent id.Comment Status Choose...HoldApproveSpamTrash Show comments with certain status.Comment Karma Show comments with certain karma.Comment Type Choose...CommentPingbackTrackbackPings (pingback & trackback)Custom Type Show comments with certain type.Custom Comment Type Show comments based on custom type.Post ID Show comments based on certain Post.Post Parent ID Show comments based on post parent id.Post Name Show comments based on post name.Post Author Show comments based on post author.Post Status Show comments based on post status.Post Type Show comments based on post type.User ID Show comments based on certain User.Author Email Show comments based on certain author email.Search Keyword Show comments based on a possible keyword.Order Choose...ASCDESC - Default Ascending or Descending order.Order by Choose...User IDComment IDComment TypeComment ApprovedComment ParentComment DateComment Date GMTComment Post IDComment AuthorComment Author EmailComment Author IPComment Author URLComment ContentComment AgentComment Karma Sort retrieved comments by.Number Number of comments to show.Offset Number of comments to displace or pass over.Meta Query No save snippets... Select from your saved WP_Meta_Query snippets.Total Count Choose...TrueFalse - Default The total count of comments found. Update Code Save Snippet
// WP_Comment_Query arguments $args = array( ); // The Comment Query $comment_query = new WP_Comment_Query( $args );