Last active
March 29, 2021 02:59
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/