Deleting a category with comments orphans those comments, preventing them from loading and causing errors. Before deleting a category, you must either delete all the comments it contains or move them to another category:
To delete all the comments from a category and then delete the category itself:
Call Bulk Delete Comment with a filter for all comments where contextId matches the category ID you intend to delete.
Call Delete Category to delete the now-empty category.
To move all the comments out of a category and then delete the category itself:
Create a new category using Create Category or identify an existing category to use.
Call Bulk Move Comment By Filter with a filter where contextId matches the category ID you intend to delete. Set the destination to the new category.
Call Delete Category to delete the now-empty category.
If you notice spam from site visitors, you can turn off guest commenting to allow only site members to comment.
To restrict commenting to members only, call Update Category to modify permissionsSettings.createComment.role and permissionsSettings.createReply.role to "MEMBER".
You can retrieve recent comments written across all blog posts or product pages. Use this to display recent activity to site visitors.
Call Query Category to retrieve a list of categories available for a site and find the categoryId for the category you want to highlight.
Call List Comments By Resource with the categoryId retrieved above as the contextId and commentSort.order set to "NEWEST_FIRST".
Allow any site visitor to leave a comment on any product page, but restrict replies to these comments to only site administrators.
To restrict these replies, call Update Category and modify permissionsSettings.createReply.role to "ADMIN".