• Resolved microrruptor

    (@microrruptor)


    Hi again, Blaz!

    After a few days testing my site, I will publish it and it is neccesary to reset all ratings and feedback of all posts of the site. How can delete the stats for all my posts? Maybe directly from database…?

    Thank you very much in advance,

    Jose.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Blaz K.

    (@blazk)

    Hi Jose,

    good question! I haven’t really thought about that and as you figured out there is at the moment no easy way to reset everything at once.

    You could use delete_post_meta_by_key function in custom made plugin or your theme’s functions. I haven’t tested this method but it should work. More about the function here: https://developer.www.ads-software.com/reference/functions/delete_post_meta_by_key/

    So your code should look something like this below:

    
    delete_post_meta_by_key( 'rmp_vote_count' ); 
    delete_post_meta_by_key( 'rmp_rating_val_sum' );
    delete_post_meta_by_key( 'rmp_feedback_val' );
    

    Another option If you are in development environment, is to add the following code to \rate-my-post\admin\inc\class-rate-my-post-admin-helper.php after line 74 (just before the push to array comment):

    
    delete_post_meta($postID, 'rmp_vote_count');
    delete_post_meta($postID, 'rmp_rating_val_sum');
    delete_post_meta($postID, 'rmp_feedback_val');
    

    Then you just have to click on Rate my Post in the menu (backend) and everything should be reset ?? Don’t forget to remove the code above after clicking – or just delete the plugin and install it again. I also recommend to do backup of DB before doing this – just in case. I know it’s not ideal but I’ll try to add an option for complete reset in one of the future versions.

    Blaz

    • This reply was modified 5 years, 10 months ago by Blaz K..
    Plugin Support Blaz K.

    (@blazk)

    @microrruptor I assume that you managed to reset everything since I haven’t heard from you. I’m marking this as resolved. If you need further assistance, let me know.

    Blaz

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Delete all stats’ is closed to new replies.