WP Payment Pal Documentation
← Back to site

Requiring User Login

Require customers to be logged in to their WordPress account before they can make a purchase. This guide covers setting up login requirements.

Reading time: 3 minutes | Difficulty: Beginner

Overview

Require customers to be logged in to their WordPress account before they can make a purchase. This guide covers setting up login requirements.

Prerequisites

  • A payment form created
  • WordPress user registration enabled (if needed)

Accessing Login Settings

  1. Edit your payment form
  2. Click the Restrictions tab
  3. Find the Login Required section
Restrictions tab overview

Step 1: Enable Login Requirement

  1. Toggle Require Login on
  2. Save the form
Require Login toggle ON
Require login toggle highlighted

Customer Experience

Logged Out Visitors

When a logged-out visitor views the form:

  • Form is hidden
  • Login prompt displays
  • Link to login/register page

Logged In Users

When a logged-in user views the form:

  • Form displays normally
  • Full checkout functionality
  • User info may auto-populate

Login Message

Customize the message shown to logged-out visitors:

  1. Find Login Message setting
  2. Enter your custom message
  3. Save the form
Login message field highlighted

Example messages:

  • “Please log in to continue with your purchase.”
  • “Members only. Log in to access this offer.”
  • “Sign in to your account to complete checkout.”

Common Use Cases

Member-Only Pricing

Form: Member Discount Store
Login: Required
Purpose: Special prices for registered members

Subscription Management

Form: Manage Subscription
Login: Required
Purpose: Users must identify themselves

Returning Customer Discount

Form: Loyalty Rewards
Login: Required
Purpose: Track purchase history

B2B Portal

Form: Wholesale Orders
Login: Required
Purpose: Business customer verification

Course Enrollment

Form: Course Registration
Login: Required
Purpose: Link enrollment to user account

Benefits of Login Requirement

For You

  • Customer tracking – Know who’s purchasing
  • Purchase history – Link transactions to accounts
  • Communication – Verified email addresses
  • Fraud reduction – Additional verification layer

For Customers

  • Auto-fill – Pre-populated information
  • Order history – View past purchases
  • Account management – Manage subscriptions

Field Auto-Population

When logged in, fields can auto-fill from user profile:

  • Customer Name → WordPress display name
  • Email → WordPress email
  • Phone → User meta (if stored)

Use Smart Tags for default values:

  • {user-email}
  • {user-first-name}
  • {user-last-name}

WordPress Registration

If you require login, ensure users can register:

  1. Go to Settings > General
  2. Check “Anyone can register” (if desired)
  3. Set default user role

Or use a membership plugin for more control.

Combining with Role Restrictions

Login required + role restriction:

  1. Enable Require Login
  2. Enable Role Restriction
  3. Select allowed roles

User must be:

  • Logged in AND
  • Have an allowed role

See Restricting by User Role.

Guest Checkout Alternative

If you want to allow both:

Option 1: Separate Forms

  • Form A: Login required (member pricing)
  • Form B: No login (guest pricing)

Option 2: No Requirement

  • Don’t require login
  • Logged-in users still get auto-fill benefits
  • Guests can checkout without account

Payment Pages and Login

For Payment Pages with login required:

  • Page is accessible
  • Form area shows login prompt
  • User logs in, page refreshes with form

Shortcodes and Login

[wppal_checkout form_id="123"]

Behavior:

  • Shows login prompt if required and not logged in
  • Shows form if logged in (or not required)

Testing Login Requirement

Test as Logged Out

  1. Log out of WordPress
  2. Visit form page
  3. Verify login prompt appears

Test as Logged In

  1. Log in to WordPress
  2. Visit form page
  3. Verify form displays normally

Test Login Flow

  1. Start logged out
  2. Click login link
  3. Log in
  4. Verify redirect back to form

Best Practices

  1. Easy registration – Don’t make it hard to sign up
  2. Clear messaging – Explain why login is required
  3. Quick login – Consider social login options
  4. Guest option – Offer alternative if appropriate
  5. Mobile-friendly – Test login on mobile devices

Troubleshooting

Form not showing after login

  • Check for redirect issues
  • Clear browser cache
  • Verify user has appropriate role (if role-restricted)

Login prompt not appearing

  • Verify Require Login is enabled
  • Save form and refresh
  • Check for caching

Auto-fill not working

  • Verify Smart Tags in field defaults
  • Check user profile has the information
  • Ensure fields are configured for auto-fill

What’s Next?