You should be able to write a function that fetches all comments by comment type using get_comments()
, then loop through them and set status using wp_set_comment_status()
.
e.g.
Retrieve all comments associated with posts in the debate
post type:
$debate_comments = get_comments( array( 'post_type' => 'debate', 'status' => 'approve' ) );
Loop through each one, and change from approved to moderated:
foreach( $debate_comments as $debate_comment ) {
wp_set_comment_status( $debate_comment, 'hold' );
}
Related Posts:
- Why are the comments disabled by default on my custom_post_types?
- Why are comments and trackbacks still getting through for custom post types?
- Display Authors Comments on Profile Page
- List all posts commented by current user
- Custom Comment Types
- modify all posts of a category to “no comments allowed”
- Custom comment status possible?
- feed links for custom post type pages
- Seperating custom post type comments from regular blog posts comments
- Add comments meta fields to comments metabox on post edit screen
- Exclude post_type from admin comments_list
- Recent comments on author page?
- wp_query and comment_parent – select only posts with top level comments
- changing default comment form arguments [duplicate]
- Comment moderation on custom post types
- Automatically check “Allow comments” for custom post type [duplicate]
- How could I create a ‘private comments’ section on a custom post type?
- Disable comments from showing up public for Custom Post Type
- Custom Post Type loops and Disqus
- “Allow Comments” box cannot be checked
- Separate comment section for post type in dashboard
- Count all comments of a custom post type
- custom comments on specific post type
- Insert data on comment post
- get_comments not working on custom post types
- Custom Post Type Set Comments ON by default without show METABOX
- WordPress comments_open for specific user role or post type
- Add custom field in comments form
- Create another comment system for CPT
- How can the recipients and content for comment email notifications on a custom post type be changed?
- Convert comments to Custom Post Type
- How to assign classes to all elements?
- custom comments form for custom post type
- What functions does WordPress use for filtering / sanitizing comments?
- comment_notification_text filter for custom post type
- get comments by current user inside page template
- User-submitted reviews of different custom post types
- Check if user has comment on current post
- Enable comments on custom page type – option not showing in “customize” for theme
- Allow anonymous comments just in a custom post type
- duplicate comment section functionality and call it something else for custom post types
- Send email messages after comment was submitted
- comments hooks on custom post type
- custom comment fields on CPT
- Enable comments for post when comments meta box removed
- Get the latest comment from a custom post type where depth = 1?
- Why will comments not remain open on custom post types?
- How to add comments to my custom post type but hide it from default WordPress Comments section?
- How to change the comments form title based on post type
- Comments on posts with new custom post type redirected to another post
- Display custom posts, ordered by most commented, without duplicates
- get comments for custom post type
- How to create a discussion post when a custom post is created?
- Adding second comments.php for reviews
- Custom post type updated to support comments, yet comments don’t appear
- Comments not enabled for custom post types
- Turn off comments for given CPT checkbox?
- Author profile comments system
- Custom post type: can’t enable comments by default
- Comment moderation with disqus comments
- add comments custom fields after user is logged in
- Comments are not working on Custom Post Type
- Error 403 when posting comments to a custom post type from a different page
- Comments not working (error not allowed) on posts with custom post status
- Custom post type: Add “Edit | Quick Edit | Trash | View” links to date (if title is not shown in column)?
- Display custom post type with shortcode
- Adding meta values to permalink
- How to create a mini directory in WordPress?
- Anyway to assign custom post types to a specific category?
- List with categories, subcategories and posts of custom posttype
- Show custom post type randomly in any page
- How to create custom post listing in the admin?
- only a certain role has access to a cpt
- Wrong request query on cpt and tax
- Permalink for a custom post type isn’t working and I don’t know why
- Custom post type, organized by categories
- How to import files to individual posts of a custom type
- Listing custom terms in custom post meta
- What content types are shown at a search page?
- Display posts with tag for custom post type only
- Assigning a category to a custom post type in WordPress
- Custom Attachment Type
- custom post type or taxonomy, which approach is better?
- Custom post type, permalink, add query variables problem
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- WordPress is ignoring my post rewrite rule
- Duplicate content problems after adding an archive page to the article’s post type
- CPT relations use in permalinks under single post type
- Attach a post type to other one
- bad practice for Custom Post Type
- Redirect Custom Post Type from Child Taxonomies
- put a list of one post type in other post type to select from it and display selected item in second post type’s single page
- Meta_query by date for Events archive
- WordPress get all post with like in terms [duplicate]
- wordpress form processing to custom post type not working
- Loop multiple taxonomy in custom post
- $post breaking container loop
- why get_post_meta is returning 0?
- How to create an upload page (front side)
- Get all active posts that are tied to a custom taxonomy for a custom post type