Skip to content

Instantly share code, notes, and snippets.

@pbrocks
Forked from strangerstudios/set_enddate_null.sql
Last active September 19, 2018 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbrocks/0cefcd7e122ce375e75bd5c1f095dd4d to your computer and use it in GitHub Desktop.
Save pbrocks/0cefcd7e122ce375e75bd5c1f095dd4d to your computer and use it in GitHub Desktop.
This SQL query will clear the expiration date for active recurring memberships in Paid Memberships Pro (PMPro).
# BACKUP FIRST
# You generally do not want to setup PMPro levels
# with both a recurring billing amount AND
# an expiration date.
# This SQL query will clear the expiration date
# for active recurring memberships.
# BACKUP FIRST
UPDATE wp_pmpro_memberships_users
SET enddate = '0000-00-00 00:00:00'
WHERE status = 'active'
AND cycle_number > 0
AND (enddate IS NULL OR enddate <> '0000-00-00 00:00:00')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment