• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Archives for wpmem_securify

wpmem_securify

Restrict a post or a page to a specific user role

Chad Butler · Jun 20, 2023 ·

While the core plugin restricts posts to logged in users, and can also create memberships for other types of restriction, sometimes you may wish to restrict content to a user role.

This custom code snippet can be copy-pasted to wherever you store custom code and will add a list of roles to the WP-Members restriction meta box in the post editor, and then will restrict the content based on those roles.

Note that this functionality is included in the WP-Members Advanced Options extension.

Continue Reading →

Replace the default login and registration forms with buttons

Chad Butler · Feb 2, 2015 ·

login_reg_buttonsA frequent question that I receive is how to replace the plugin’s default process of placing the login and registration forms with a process that takes the user to a login page (and/or registration page).

I’ve put together a code snippet that you can use as-is, or customize as needed in order to create a process that displays buttons that direct to a login page and registration page.  If you look at the screen shot to the left, you’ll see what this process will produce.  The example shows a post with an excerpt using the Twenty Fourteen theme.

The example provides the code snippet (which you can customize) as well as some initial CSS (which you can also customize) and will explain the process used to implement this change. Continue Reading →

Restrict a post or a page to a specific user role – multiple select version

Chad Butler · Jan 7, 2015 ·

Similar to how we took the post/page restriction for specific users to a multiple select version, this post takes the restrict content by role idea and expands it to a multiple select version.

This is an extension of the ideas presented in the tutorial Restrict Content by Role with the twist that this version makes some minor changes to incorporate an HTML multi-select for selecting multiple roles for access to content.

The differences between these two code snippets is minimal, so I won’t actually repeat the concept in this post. But you should read the original version to get an understanding of what is being done and how it works.  This post will just highlight what’s different.  Continue Reading →

Restrict Post or Page Access to Specific Users – Multiple Select Version

Chad Butler · Dec 23, 2014 ·

This is an extension of the ideas presented in the tutorial Restrict Post or Page Access to a Specific User with the twist that this version makes some minor changes to incorporate an HTML multi-select for selecting multiple users for access to a post.  

Continue Reading →

Restrict content by user level

Chad Butler · May 16, 2014 ·

I have written code snippets before on how to restrict content by user level, but that particular code snippet is based on using categories as the user levels, with higher level users still being able to access lower level content. For example, Silver, Gold, and Platinum level users having access or not to categories of the same name.

But what if you have content that you need to block by level that is not necessarily in a category?  Or what if you are using pages that need the same level of restriction.

Here is a code snippet that will allow you to assign a “level” to any content – post or page, and then assign a user level for the users.  This example provides a working code snippet for applying a series of progressive levels (higher level users have access to lower level content).  The example begins with three generically named levels, these can be renamed and expanded or contracted as needed.Continue Reading →

  • Page 1
  • Page 2
  • Go to Next Page »

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy