Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andrewlimaza/bc872c22c3bca203dd3ddc1c8d9541d5 to your computer and use it in GitHub Desktop.
Save andrewlimaza/bc872c22c3bca203dd3ddc1c8d9541d5 to your computer and use it in GitHub Desktop.
Bulk update user's expiration dates via SQL - Paid Memberships Pro
/**
* 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment