-
Notifications
You must be signed in to change notification settings - Fork 381
Description
Describe the bug
When a membership level is deleted through the Paid Memberships Pro admin interface, related entries in some database tables are not removed. While the deletion process correctly clears level entries from core tables such as pmpro_memberships_users, pmpro_memberships_categories, and pmpro_membership_levels_groups, other tables like pmpro_memberships_pages may retain references to the deleted level ID.
This can result in lingering data that affects membership logic and content protection even though the level no longer exists in the system.
To Reproduce
Steps to reproduce the behavior:
- Use a tool like phpMyAdmin to access your WordPress database.
- Navigate to the
pmpro_membership_levelstable and note the IDs of existing levels. - Delete a level from the admin under Memberships > Membership Levels.
- Query the
pmpro_memberships_pagestable (or others, such aspmpro_discount_codes_levels) for any rows referencing the deletedmembership_id. - Observe that some records remain, even though the associated level has been deleted.
Screenshots
If applicable, please attach a screenshot to make your issue clearer.
Expected behavior
Deleting a membership level should cleanly remove all related records referencing that level ID across PMPro database tables, including:
pmpro_memberships_userspmpro_memberships_categoriespmpro_membership_levels_groupspmpro_memberships_pagespmpro_discount_codes_levels- Any other relevant metadata or cross-reference tables
Isolating the problem (mark completed items with an [x]):
- I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
- This bug happens with a default WordPress theme active, or Memberlite.
- I can reproduce this bug consistently using the steps above.
WordPress Environment