You can use SQL queries to retrieve items with likes from your WordPress database or reset their like counts.
1. Retrieve Items with Likes
To fetch all items that have one or more likes, execute the following SQL query in your database:
COPY CODE
SELECT * FROM wp_postmeta WHERE meta_key = '_item_likes' AND meta_value != 0;This query retrieves all records where the _item_likes meta key has a value other than 0.
2. Reset Item Likes
To reset the like counts for all items to zero, execute the following SQL query:
COPY CODE
UPDATE wp_postmeta SET meta_value = '0' WHERE meta_key = '_item_likes';This query sets the like count to 0 for every record using the _item_likes meta key.
Important: Before running the update query, back up your database. This operation affects all items with the specified meta key and cannot be easily undone without a backup.
