Login Form Shortcode Reference

Complete parameter reference for the [attributes_login_form] shortcode.

  • Intermediate
  • 15 min read
  • Applies to 1.2.1 (Core)
  • Updated November 2025

Written for 1.2.1 (Core). It is being checked against 2.0, so a screen or a setting may sit somewhere else. Tell support if something does not match.

Overview

The [attributes_login_form] shortcode is the foundation of Attributes User Access, allowing you to embed fully functional login forms anywhere on your WordPress site. This comprehensive reference covers every parameter and option available.


Basic Usage

Minimal Shortcode

[attributes_login_form]

This displays a complete login form with default settings:

  • Username/email field
  • Password field
  • Remember me checkbox
  • Submit button
  • Lost password link

Complete Parameter Reference

Redirect Parameters

redirect

Purpose: Where users go after successful login

Type: String (URL) Default: WordPress dashboard Example:

[attributes_login_form redirect="/dashboard/"]

Accepts:

  • Relative URLs: /member-area/
  • Absolute URLs: https://yoursite.com/dashboard/
  • Page slugs: Will auto-resolve to full URL

redirect_on_logout

Purpose: Where users go after logging out

Type: String (URL) Default: Current page Example:

[attributes_login_form redirect_on_logout="/"]

Common Values:

  • / - Homepage
  • /login/ - Login page
  • /goodbye/ - Thank you page

Form Identification

form_id

Purpose: Custom HTML ID for the form element

Type: String Default: attributes_login_form Example:

[attributes_login_form form_id="my_custom_form"]

Use Cases:

  • Multiple forms on same page
  • Custom CSS targeting
  • JavaScript form manipulation
  • Analytics tracking

Important: Each form_id must be unique on the page. Duplicate IDs will cause HTML validation errors.


Label Customization

label_username

Purpose: Label text for username/email field

Type: String Default: "Username or Email" Example:

[attributes_login_form label_username="Email Address"]

Popular Alternatives:

  • "Email"
  • "Username"
  • "Email or Username"
  • "Student ID"
  • "Member ID"

label_password

Purpose: Label text for password field

Type: String Default: "Password" Example:

[attributes_login_form label_password="Your Password"]

Alternatives:

  • "Enter Password"
  • "Account Password"
  • "Secure Password"

label_remember

Purpose: Label text for remember me checkbox

Type: String Default: "Remember Me" Example:

[attributes_login_form label_remember="Keep me logged in"]

Popular Alternatives:

  • "Remember me on this device"
  • "Stay logged in"
  • "Keep me signed in"
  • "Remember on this computer"

label_submit

Purpose: Text for submit button

Type: String Default: "Log In" Example:

[attributes_login_form label_submit="Sign In"]

Creative Alternatives:

  • "Access Account"
  • "Enter"
  • "Sign In Now"
  • "Access Members Area"
  • "Continue"

label_lost_password

Purpose: Link text for password reset

Type: String Default: "Lost your password?" Example:

[attributes_login_form label_lost_password="Forgot Password?"]

Alternatives:

  • "Reset Password"
  • "Can't access your account?"
  • "Forgot your password?"
  • "Need help signing in?"

Behavior Parameters

value_remember

Purpose: Default state of remember me checkbox

Type: Boolean (true/false) Default: false Example:

[attributes_login_form value_remember="true"]

Values:

  • true - Checkbox is checked by default
  • false - Checkbox is unchecked by default

šŸ’” Security Tip: Set to false for public computers or high-security sites. Set to true for member sites where users typically use personal devices.


Complete Examples

Example 1: Simple Member Login

[attributes_login_form
    redirect="/members-only/"
    label_submit="Access Members Area"]

Use Case: Membership website with exclusive content area

Features:

  • Redirects to member dashboard after login
  • Custom button text for clarity

Example 2: E-Commerce Customer Login

[attributes_login_form
    redirect="/my-account/"
    redirect_on_logout="/shop/"
    label_username="Email Address"
    label_submit="Access My Account"
    label_lost_password="Forgot your password?"]

Use Case: WooCommerce store or online shop

Features:

  • Customer-friendly labels
  • Redirects to account page
  • Returns to shop after logout

Example 3: Corporate Intranet

[attributes_login_form
    redirect="/employee-dashboard/"
    redirect_on_logout="/login/"
    form_id="intranet_login"
    label_submit="Sign In to Intranet"
    value_remember="false"]

Use Case: Employee portal with enhanced security

Features:

  • Security-focused (no remember me)
  • Professional labeling
  • Returns to login after logout

Example 4: Educational Platform

[attributes_login_form
    redirect="/student-portal/"
    label_username="Student ID or Email"
    label_submit="Access Courses"
    label_remember="Remember me on this device"]

Use Case: Online learning platform for students

Features:

  • Student-specific terminology
  • Clear instructions
  • Device-specific remember me text

Example 5: Client Portal

[attributes_login_form
    redirect="/client-dashboard/"
    redirect_on_logout="/services/"
    label_username="Client Email"
    label_password="Account Password"
    label_submit="Access Portal"]

Use Case: Professional services client area

Features:

  • Client-focused language
  • Descriptive labels
  • Professional branding

Using Shortcodes in Different Contexts

In Pages and Posts

Standard Usage:

  1. Edit page or post
  2. Add shortcode block (Block Editor) or paste directly (Classic Editor)
  3. Enter shortcode with desired parameters
  4. Publish or update

In Widgets

Widget Area Implementation:

  1. Go to Appearance > Widgets
  2. Add "Shortcode" or "Custom HTML" widget
  3. Paste shortcode:
[attributes_login_form
    redirect="/"
    label_submit="Login"
    form_id="sidebar_login"]

Recommended for: Sidebars, footers, header areas


In Theme Templates

PHP Method:

<?php
if (shortcode_exists('attributes_login_form')) {
    echo do_shortcode('[attributes_login_form redirect="/dashboard/"]');
}
?>

With Wrapper:

<?php
if (shortcode_exists('attributes_login_form')) {
    echo '<div className="my-custom-login-wrapper">';
    echo do_shortcode('[attributes_login_form]');
    echo '</div>';
}
?>

Conditional Display

Show Only to Logged-Out Users:

<?php
if (!is_user_logged_in() && shortcode_exists('attributes_login_form')) {
    echo do_shortcode('[attributes_login_form redirect="/member-area/"]');
} else if (is_user_logged_in()) {
    echo '<p>You are already logged in. <a href="' . wp_logout_url() . '">Logout</a></p>';
}
?>

Parameter Combination Best Practices

Keep It Simple

āœ… Good:
[attributes_login_form redirect="/dashboard/"]

āŒ Too Complex:
[attributes_login_form
    redirect="/dashboard/"
    redirect_on_logout="/"
    form_id="form1"
    label_username="Email"
    label_password="Pass"
    label_remember="Keep logged in"
    label_submit="Go"
    label_lost_password="Forgot?"
    value_remember="true"]

Recommendation: Only customize parameters you actually need.


Prioritize User Experience

Essential Parameters:

  • redirect - Where users go after login
  • label_submit - Clear call-to-action

Optional Parameters:

  • Only customize labels if defaults don't fit
  • Only change form_id if you have multiple forms
  • Only set value_remember if security requires it

Test All Combinations

After adding parameters, always test:

  • Form displays correctly
  • Labels are clear and readable
  • Redirects work as expected
  • Mobile view is functional
  • No JavaScript errors in console

Common Mistakes to Avoid

Mistake 1: Typos in Parameters

āŒ Wrong:

[attributes_login_form rediect="/dashboard/"]

āœ… Correct:

[attributes_login_form redirect="/dashboard/"]

Error Result: Parameter is ignored, default behavior applies


Mistake 2: Invalid URLs

āŒ Wrong:

[attributes_login_form redirect="dashboard"]

āœ… Correct:

[attributes_login_form redirect="/dashboard/"]

Always include leading slash for relative URLs!


Mistake 3: Duplicate Form IDs

āŒ Wrong (on same page):

[attributes_login_form form_id="login1"]
[attributes_login_form form_id="login1"]

āœ… Correct:

[attributes_login_form form_id="login1"]
[attributes_login_form form_id="login2"]

Mistake 4: Quotes Within Quotes

āŒ Wrong:

[attributes_login_form label_submit="Click "Login" Now"]

āœ… Correct:

[attributes_login_form label_submit="Click Login Now"]

Or use HTML entities:

[attributes_login_form label_submit="Click &quot;Login&quot; Now"]

Debugging Shortcode Issues

Shortcode Appears as Text

Symptoms: You see [attributes_login_form] on the page

Causes:

  • Plugin not activated
  • Shortcode in wrong context
  • Syntax error in shortcode

Solutions:

  1. Verify plugin is activated
  2. Check for typos in shortcode name
  3. Ensure shortcode is in a block that supports shortcodes

Parameters Not Working

Symptoms: Changes to parameters have no effect

Debug Steps:

  1. Check syntax: Ensure proper spacing and quotes
  2. Clear cache: Browser cache and WordPress cache
  3. Test default: Try [attributes_login_form] without parameters
  4. Browser console: Check for JavaScript errors (F12)

Form Doesn't Display

Symptoms: Blank space where form should be

Causes:

  • JavaScript error
  • CSS hiding form
  • Plugin conflict

Solutions:

  1. Check console: Look for JavaScript errors
  2. Inspect element: Look for hidden CSS
  3. Test theme: Switch to default WordPress theme
  4. Disable plugins: Test for conflicts

Related articles

Something missing or out of date? Tell support.