Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Last active March 29, 2021 02:59
Show Gist options
  • Save kimcoleman/5ac5a6989774d386e171ecc6e4363d5b to your computer and use it in GitHub Desktop.
Save kimcoleman/5ac5a6989774d386e171ecc6e4363d5b to your computer and use it in GitHub Desktop.
Example SQL to add restriction to all 'posts' for Level ID 2. Change level ID for your needs.
#Example SQL to add restriction to all 'posts' for Level ID 2. Change level ID for your needs.
INSERT IGNORE INTO wp_pmpro_memberships_pages (membership_id, page_id)
SELECT 2, ID FROM wp_posts WHERE post_type = 'post';
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Bulk methods to restrict access to posts, pages, and CPTs for a specific membership level ID via MySQL" at Paid Memberships Pro here: https://www.paidmembershipspro.com/bulk-methods-to-restrict-access-to-posts-pages-and-cpts-for-a-specific-membership-level-id-via-mysql/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment