0

I have a bilingual site. Previously I was using a language plugin that would store the different languages in the same post which means all my comments belonged to that post. I switched to WPML which manages 1 post per language. In my migration process, I therefore ended up with twice as many posts since the migration tool essentially read each post, took the second language from the post and created a new post with it. Previously

  • one post, 2 languages, and a plugin that displays the relevant language
  • one comment section no matter the language displaying a mix of comments in both languages

Now with WPML:

  • 2 posts, one per language
  • the original post contains the primary language and ALL the comments
  • the new post contains the secondary language and no comments whatsoever.

That didn't worry me because there are plenty of plugins to copy / move comments from a post to another. So I started migrating some comments from posts in one language to the corresponding ones in a different language. However... I just noticed the ratings did not get copied over. Additionally, when I look at the backend (/wp-admin), I cannot see the ratings inside a given comment.

So... are ratings stored separately? I'm not using any rating plugin AFAIK. This is the core Wordpress feature. Or is there another plugin I'm not aware of that's adding this feature?

Thanks

4
  • 3
    Comments don't have ratings in WordPress, are you sure this isn't a feature from your theme or a plugin? You'd have to disable them all then enable them 1 by 1 to figure out which one is providing this functionality, then contact their support
    – Tom J Nowell
    Commented Apr 7, 2020 at 23:51
  • I went on and inspected the HTML source for one of my posts and figured out which plugin generated the rating based on the CSS class name. I should have known better. Thanks anyway for taking the time. Commented Apr 8, 2020 at 0:45
  • 1
    No worries, which plugin was it btw?
    – Tom J Nowell
    Commented Apr 8, 2020 at 14:12
  • WP Tasty plugin. It lets you rate the recipes Commented Dec 18, 2020 at 19:49

1 Answer 1

1

As stated in the comments below the question,

Comments don't have ratings in WordPress

I went on and inspected the HTML source for one of my posts and figured out which plugin generated the rating based on the CSS class name. I should have known better. The plugin is Tasty Recipes by WP Tasty.

I then looked at my SQL DB and figured out that comment ratings are stored in wp_commentmeta with a key of ERRating:

    SELECT * FROM `wp_commentmeta` WHERE meta_key='ERRating'

Here's a more complete SQL statement that shows how to retrieve the rating:

SELECT c.comment_id, 
       c.comment_post_id, 
       c.comment_author, 
       c.comment_content, 
       m.meta_key, 
       m.meta_value 
FROM   `wp_del201712_comments` AS c 
       LEFT JOIN wp_del201712_commentmeta m 
              ON m.comment_id = c.comment_id 
WHERE  c.comment_post_id = 12066 
       AND c.comment_approved = '1' 
       AND m.meta_key = 'ERRating' 

Just replace the post ID with yours to see the results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.