Hello,
Please make a backup of your WordPress database before proceeding below. Kindly try editing your active theme’s functions.php and append the following
add_action( 'admin_post_purge_reviews', function() {
global $wpdb;
$comments = get_comments( array(
'type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
'fields' => 'ids',
) );
foreach ( $comments as $comment_id ) {
wp_delete_comment( $comment_id );
}
$wpdb->delete( $wpdb->postmeta, array( 'meta_key' => 'wp_review_user_reviews' ) );
$wpdb->delete( $wpdb->postmeta, array( 'meta_key' => 'wp_review_review_count' ) );
wp_die( 'Ratings removed' );
} );
Then, visit /wp-admin/admin-post.php?action=purge_reviews. If you see Ratings removed, you can remove the code added above and check if the ratings have now been removed.
Thank you
MyThemeShop: Great, it works perfectly, thank you!
-
This reply was modified 8 years, 6 months ago by
jardazet.