PMPro Bulk Update Expiration Dates

PHOTO EMBED

Mon Oct 25 2021 23:27:18 GMT+0000 (Coordinated Universal Time)

Saved by @shadowtek #pmpro

/**
 * Bulk update all users to have an expiration date that belong to a specific membership level.
 * This code should be run directly inside your WordPress database.
 * Please update the wp_ prefix to match that of your database as well as the membership_id and enddate value (YYYY-MM-DD).
 *
 * IMPORTANT: Have a backup of your site before running this code.
 */

UPDATE wp_pmpro_memberships_users SET enddate = '2020-12-31 00:00:00' WHERE status = 'active' AND membership_id = 1;
content_copyCOPY