WP ULike stores data in many databases tables. You can read more about optimizing and repairing WP ULike database tables, but here are the 3 simple steps to reset vote counts.

Step 1

Add the following code snippet in your theme’s functions.php.

/**
 * Reset the votes for WP ULike.
 *
 * All the staticstics will be deleted. No settings will be deleted.
 *
 */
add_action( 'admin_init' , 'wp_ulike_reset_votes' );

function wp_ulike_reset_votes() {

    global $wpdb;
 
    $wpdb->query( "TRUNCATE TABLE wp_ulike" );
    $wpdb->query( "TRUNCATE TABLE wp_ulike_activities" );
    $wpdb->query( "TRUNCATE TABLE wp_ulike_comments" );
    $wpdb->query( "TRUNCATE TABLE wp_ulike_forums" );
    $wpdb->query( "TRUNCATE TABLE wp_ulike_meta" );
}


Step 2

Reload your admin dashboard.

Step 3

Remove the code snippet added in your theme’s functions.php in step 1.


That’s all.


Note the Pro version of WP ULike has a built-in feature under WP ULike Pro > Developer Tools > Optimization to reset vote counts.

Get WP ULike Pro.


Did you know? You can send an email notification to the post author whenever they get a LIKE on their content

Email Notifications For WP Ulike
3 simple steps to reset vote counts of WP ULike plugin
Tagged on:     

Sanjeev Aryal

Don't bury your thoughts, put your vision into reality ~ Bob Marley.

2 thoughts on “3 simple steps to reset vote counts of WP ULike plugin

  • November 17, 2022 at 12:02 pm
    Permalink

    Is it possible to change vote via phpmyadmin to some user?

    Reply
    • November 17, 2022 at 12:44 pm
      Permalink

      Yes, but you’ll need to insert each vote as a row for wp_ulike table.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

× WhatsApp