Skip to content

Instantly share code, notes, and snippets.

View oliviertassinari's full-sized avatar

Olivier Tassinari oliviertassinari

View GitHub Profile
# Based on https://deanandrews.uk/export-woocommerce-reviews-wordpress/ but enhanced to include the rating and filter out other comments.
```
SELECT `post_title` AS 'Product', `comment_author` AS 'Customer Name', `comment_author_email` AS 'Customer Email', `comment_date`, `comment_content` AS 'Review', `wp_commentmeta`.`meta_value` AS 'Rating'
FROM `wp_comments`
INNER JOIN `wp_posts` ON `comment_post_ID`=`ID`
INNER JOIN `wp_commentmeta` ON `wp_commentmeta`.`comment_id`=`wp_comments`.`comment_ID`
WHERE `comment_author` != 'WooCommerce'
AND `wp_posts`.`post_type` = 'product'
AND `wp_posts`.`post_status` = 'publish'