• Resolved widecast

    (@widecast)


    Hello,

    Is there an easy way to delete several thousand votes (logs and data) at once?

    For example, in my case, I’d like to delete rating IDs 1-4000 (out of 12,000 or so).

    Thanks,

    David

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Nope. You have to run MySQL Query to archive this.

    Something like:

    
    DELETE FROM wp_ratings WHERE rating_postid BETWEEN 1 AND 4000;
    DELETE FROM wp_postmeta WHERE meta_key = 'ratings_users' AND post_id BETWEEN 1 AND 4000;
    DELETE FROM wp_postmeta WHERE meta_key = 'ratings_score' AND post_id BETWEEN 1 AND 4000;
    DELETE FROM wp_postmeta WHERE meta_key = 'ratings_average' AND post_id BETWEEN 1 AND 4000;
    

    Run it at your own risk, it is not tested.

    Thread Starter widecast

    (@widecast)

    Thanks for the quick reply.

    If I understand correctly, that query would delete all ratings from post IDs 1-4000.

    I may not have been clear enough in my original question. I’d like to delete the range of vote IDs 1-4000, not post IDs.

    If it’s not too complex, please let me know if it’s possible.

    Plugin Author Lester Chan

    (@gamerz)

    That is not possible. Deleting the logs, will not force it to recalculate. The votes that are stored in the post meta are accumulative.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Mass Delete Ratings’ is closed to new replies.