Introductory Pricing: Save 50% on your first year of any plan. Use coupon code:

FIRSTYEAR50

  • Log In
  • Welcome
  • Features
  • Pricing
  • Documentation
  • Case Studies
  • Add Ons
  • Support
  • Learn
  • Events
  • Blog
  • Contact

Log In

Join Now | Lost Password?
Skip to content
Paid Memberships Pro WordPress Membership Plugin
  • Log In
  • Choose a Plan
  • Features
    • PMPro Platform
      • Plugin Features
      • Restrict Access
      • Register Members
      • Subscriptions
      • All Features
    • Payment Gateways
      • Stripe
      • PayPal Express
      • Paystack
      • CCBill
      • All Gateways
    • Add Ons
      • Integrations
      • Free Add Ons
      • Standard Add Ons
      • Plus Add Ons
      • All Add Ons

    Launch a Free Demo
    Explore PMPro in action with your own private demo site—preloaded with members, protected content, and premium Add Ons.

    Try PMPro Now
  • Use Cases
    • Associations
    • Blog and News
    • Communities
    • Courses
    • Directories
    • Paid Newsletters
    • Private Videos
    • Podcasting
  • Documentation
    • Download & Install
      • Download PMPro
      • Install Add Ons
      • Memberlite Theme
      • Setup WordPress
      • Staging Sites
      • Support
    • Initial Setup
      • Customize Pages
      • Payment Settings
      • Restrict Content
      • Membership Levels
      • Member Emails
      • User Fields
    • More Docs
      • Shortcodes & Blocks
      • Design Settings
      • Page Builders
      • Reporting
      • For Developers
      • Actions & Filters
      • All Docs

    Get your membership site up and running with Kim's help.

    Watch Initial Setup
  • Community
    • Engage & Learn
      • Upcoming Events
      • Courses
      • Videos
      • Step-by-Step Guides
      • Join Slack
      • Get Support
    • Blog
      • Case Studies
      • Product Comparison
      • Code Recipes
      • Release Notes
      • Migration Guides
      • All Blog Posts

    Join the Community
    Connect with other membership site creators who use PMPro to get paid.

    Join Slack
  • Pricing
Home  >  Blog  >  Apply a Default PMPro Membership Level During WordPress User Registration

Apply a Default PMPro Membership Level During WordPress User Registration

Estimated reading time: 3 minutes

TweetFacebookLinkedIn

For some membership site setups, it makes sense to use a different user registration process than the built-in PMPro Membership Checkout process.

But how do you give these users a membership level when they aren’t using our plugin’s checkout page?

In this recipe, we show you how to assign a free default membership level when users register through another method on your site. This code recipe works for sites that register users through the default WordPress user register screen, BuddyPress, BuddyBoss, WooCommerce and more.

Banner for Advanced Code Recipe Tutorial for Paid Memberships Pro

Table of contents

  • About the Hooks and Functions in this Code Recipe
    • user_register Hook
    • pmpro_changeMembershipLevel Function
  • The Code Recipe
  • Caveats and Limitations of The Code Recipe

About the Hooks and Functions in this Code Recipe

user_register Hook

The user_register hook in WordPress triggers immediately after a new user is registered. By attaching custom functions to this hook, developers can run additional actions. The code recipe in this post hooks into the user_register action to make changes to the new user that is created. You can also use this hook to send custom welcome emails or log registration details to another table.

pmpro_changeMembershipLevel Function

The pmpro_changeMembershipLevel function is a key function used throughout Paid Memberships Pro. The function allows developers to programmatically change a user’s membership level. The code recipe in this post uses this function to assign the user a default membership level. You can also use this function to upgrade or downgrade memberships, add additional membership levels, or in any other custom workflow you need.

Related: Change Membership Level on Cancellation or Expiration

Andrew Lima - Paid Memberships Pro

Setting a default level for new users is a smart way to get them into your funnel and give them a taste of your premium features — without giving away too much for free.

In our experience, the freemium model works great. It helps boost conversions and keeps customers engaged.

—Andrew Lima, Director of Operations at Paid Memberships Pro

The Code Recipe

The code recipe below assigns a default membership level to the new user right after the user registration.

You must change the default membership level ID by editing line 27.

Not sure where to find your level IDs? Navigate to Memberships > Settings > Levels. Each level’s ID is in this list of levels.

Screenshot of navigation to locate membership level IDs

Caveats and Limitations of The Code Recipe

It’s important to note that this code recipe does not accept any payments or process any membership subscription payments, so it’s best for 100% free membership levels.

The recipe also does not set an expiration date on the membership, although this is possible by modifying the example code.

Finally, this code recipe only applies the default level for the initial user registration. If a user upgrades their membership after registration using the Paid Memberships Pro checkout and then cancels their higher-tier level (or it expires), the default level will not be reassigned.

Adding the Recipe to Your Website

You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.

Jason Coleman

Author: Jason Coleman

Jason Coleman is the co-founder and CEO of Paid Memberships Pro, the most trusted membership platform that grows with you. With a deep passion for open source software, Jason is the author of Building Web Apps With WordPress, published by O'Reilly Media.

Jason's entrepreneurial spirit is driven by uncertainty, risk, and the thrill of new opportunities. With over two decades of experience in development, management, and marketing, he is committed to Paid Memberships Pro: the only open source platform focused on helping creators get paid so they can find freedom in their life and fulfill their goals.

View more articles by Jason Coleman »

Free Course: Membership Site Development—The Basics

Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.

Take Free Course Now
Featured Image for Membership Site Development Course: The Basics


Was this article helpful?
YesNo
Tagged: pmpro_changeMembershipLevel, pmpro_login_redirect. Posted in Code Recipes, Free Code Recipes. Bookmark the permalink. Last updated: March 5, 2015.
Post navigation
← Redirect the s2member IPN URL to the PMPro IPN URL
Modify Level Price at Checkout Based on User-Selections →

Paid Memberships Pro is recommended by our customers and users

Plugin Reviews

4.3 out of 5

G2

4.8 out of 5

Capterra

5 out of 5

We’re 100% GPL

Our plugin's code is not obfuscated, runs on as many sites as you want and can be customized to fit your project's needs. We just ask that you follow the GPLv2 guidelines by applying the GPLv2 license to any altered or unaltered version of PMPro that you distribute. License Details »

GPL v2

Recent Articles and Updates

  • Banner Image for Styling Your Membership Map using Google Maps Code Recipe
    Style Your Membership Map using Google Maps JSON Styling
  • Theunis Coetzee
    Award MyCRED Points for Membership
  • Featured image for Remove Map and Directory Opt-Out Fields code recipe post
    Remove Membership Map and Directory Opt-Out Fields For Specific Levels

Platform

  • Pricing
  • Features
  • Product Comparison
  • Reviews
  • Case Studies
  • Best Membership Plugins
  • WordPress vs SaaS
  • Step-by-Step Guides

Use Cases

  • Associations
  • Blog & News
  • Community
  • Courses
  • Member Directory
  • Paid Newsletter
  • Podcast
  • Videos

Add Ons

  • Free
  • Standard
  • Plus
  • Admin
  • Integration
  • Payment
  • Third Party
  • View All

Get Help

  • Support
  • Documentation
  • Download & Install
  • Hosting
  • Developers
  • Blog
  • Slack Community
  • Contact Us

Company

  • About Us
  • Events
  • Brand Assets
  • Affiliates
  • Accessibility Statement
  • Sitemap
  • Privacy Policy
  • Terms of Service
Join Our Community
Follow Us On

© 2025 Paid Memberships Pro™. Paid Memberships Pro is a trademark of Stranger Studios, LLC. All Rights Reserved.