geminilabs

Untitled

Oct 28th, 2021
791
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- MySQL Query to select all reviews that are assigned to a post and have review content
  2. -- which can be used to export as a CSV and imported as WordPress comments.
  3.  
  4. SELECT
  5.     r.name as comment_author,
  6.     r.email as comment_author_email,
  7.     r.ip_address as comment_author_IP,
  8.     p.post_date as comment_date,
  9.     p.post_date_gmt as comment_date_gmt,
  10.     p.post_content as comment_content,
  11.     r.is_approved as comment_approved,
  12.     ap.post_id as post_id,
  13.     p.post_author as user_id
  14. FROM wp_glsr_ratings AS r
  15. INNER JOIN wp_posts AS p ON r.review_id = p.ID
  16. INNER JOIN wp_glsr_assigned_posts AS ap ON r.ID = ap.rating_id
  17. WHERE p.post_content IS NOT NULL
RAW Paste Data