Add a Username Change Form to Any Page

Get Started

Shortcode Usage

The Advanced Username Manager plugin provides a simple shortcode that you can add to any page or post to display a username change form. This gives you complete flexibility in where and how users can change their usernames.

The Username Manager Shortcode

The shortcode is:

[username_manager]

This shortcode displays a complete username change form with:

  • Current username field (read-only)
  • New username input field
  • Real-time username availability check
  • Username suggestions
  • Save Changes button

Adding the Shortcode to a Page

Step 1: Create or Edit a Page

  1. Log in to your WordPress admin dashboard
  2. Navigate to PagesAdd New (or edit an existing page)
  3. Give your page a title (e.g., “Change Username” or “Account Settings”)

Create a new page for the username change form

Step 2: Add the Shortcode

For Block Editor (Gutenberg):

  1. Click the + button to add a new block
  2. Search for “Shortcode” block
  3. Click the Shortcode block to add it
  4. Type [username_manager] in the shortcode field

Add the shortcode using the Shortcode block

For Classic Editor:

  1. Place your cursor where you want the form to appear
  2. Type [username_manager] directly in the editor
  3. The shortcode will appear in square brackets

Add the shortcode in the Classic Editor

Step 3: Publish the Page

  1. Click Publish (or Update if editing an existing page)
  2. View the page on the frontend to see the form

The username change form displays on the frontend

What the Form Looks Like

When users visit a page with the [username_manager] shortcode, they will see:

For Logged-In Users with Permission

The complete username change form for authorized users

The form includes:

  1. Current Username – Displays the user’s current login username (read-only field)
  2. New Username – Input field where users type their desired new username
  3. Real-Time Validation – Instant feedback as users type
  4. Username Suggestions – Alternative options if the username is taken
  5. Save Changes Button – Submit the username change

For Logged-Out Users

If a user is not logged in, they see a message:

“To change your username, please log in first.”

Message shown to logged-out users

For Users Without Permission

If a logged-in user doesn’t have the required role, they see:

“You do not have permission to change usernames. Please contact the administrator for assistance.”

Message shown to users without proper permissions

When Feature is Disabled

If username changes are disabled in settings, users see:

“Username changes are temporarily disabled. Please try again later or contact support for assistance.”

Using the Form: Step-by-Step

Step 1: Enter New Username

  1. The Current Username field shows your existing username (cannot be edited)
  2. Click in the New Username field
  3. Start typing your desired new username

Type your desired username in the New Username field

Step 2: Check Availability

As you type, the plugin automatically checks if the username is available:

If Available:

Green checkmark indicates the username is available

You’ll see: “Great! This username is available.”

If Taken:

Red X indicates the username is already in use

You’ll see: “Sorry, this username is already in use. You can select from the following suggestions.”

The form will display alternative username suggestions you can choose from.

Step 3: Validate Username Requirements

The form checks your username against the configured rules:

  • Minimum Length: Username must meet the minimum character requirement
  • Maximum Length: Username cannot exceed the maximum character limit
  • Valid Characters: Only letters, numbers, and underscores allowed
  • Not Same: New username must be different from current username

Validation Errors:

Error messages guide users to valid usernames

Examples:

  • “The username must be at least 5 characters long.”
  • “The username must not exceed 12 characters.”
  • “Please enter a different username!”

Step 4: Save Changes

  1. Once you enter a valid, available username, the Save Changes button becomes enabled
  2. Click Save Changes
  3. Wait for the form to process (a loading indicator may appear)

Click Save Changes to update your username

Step 5: Success

After successful username change:

Success message confirms the username change

You’ll see: “Username has been changed successfully!”

What Happens Next:

  1. Email Notification – You receive a confirmation email
  2. Auto Re-login – You remain logged in with your new username
  3. Cooldown Activated – The rate limit timer starts
  4. Page Refresh – For BuddyPress users, the page redirects to the new profile URL

Email Notification

After changing your username, you’ll receive an email like this:

Subject: “{Site Name} Your Username Has Been Successfully Updated !”

Email Content:

Hello John, We’re writing to let you know that your username on Example Site has been successfully updated. Your new username is: johndoe2026 If you did not request this change, please contact our support team immediately to secure your account. Thank you for being part of Example Site! Best regards, The Example Site Team

Rate Limiting (Cooldown Period)

If you try to change your username again before the cooldown period expires, you’ll see a message:

Rate limit message shows when the next change is allowed

“You have already updated your username. You can change it again after February 22, 2026.”

The cooldown period is set by the site administrator (7, 15, or 30 days).

Adding the Shortcode to Widgets

You can also add the shortcode to widget areas:

For Block-Based Widgets (WordPress 5.8+):

  1. Go to AppearanceWidgets
  2. Click + to add a block
  3. Search for “Shortcode”
  4. Add the Shortcode block
  5. Enter [username_manager]
  6. Click Update

For Classic Widgets:

  1. Go to AppearanceWidgets
  2. Drag a Text widget to your desired widget area
  3. Enter [username_manager] in the content field
  4. Click Save

Using Shortcode in Page Builders

Elementor

  1. Add a Shortcode widget to your page
  2. Enter [username_manager] in the shortcode field
  3. Style the widget as desired

Beaver Builder

  1. Add a HTML module
  2. Enter [username_manager] in the HTML field
  3. Save the module

Divi Builder

  1. Add a Code module
  2. Enter [username_manager] in the code field
  3. Save the module

WPBakery Page Builder

  1. Add a Raw HTML element
  2. Enter [username_manager] in the content field
  3. Save the element

Styling the Form

The shortcode outputs standard HTML with CSS classes you can customize:

Main Form Class

.aum-standard-form {
    /* Your custom styles */
}

Input Field Classes

.aum-input-field {
    /* Container for each input field */
}

.aum-input-field label {
    /* Label styling */
}

.aum-input-field input {
    /* Input field styling */
}

Button Styling

#username_change_submit {
    /* Save Changes button */
}

Message Styling

.aum-error {
    /* Error message container */
}

Add these styles to AppearanceCustomizeAdditional CSS or your child theme’s stylesheet.

Common Use Cases

Use Case 1: Dedicated Username Change Page

Create a page called “Change Username” with only the shortcode:

[username_manager]

Add this page to your user account navigation menu.

Use Case 2: Account Settings Page

Create an “Account Settings” page with multiple shortcodes:

<h2>Profile Settings</h2>
[profile_edit_shortcode]

<h2>Change Username</h2>
[username_manager]

<h2>Change Password</h2>
[password_change_shortcode]

Use Case 3: Sidebar Widget

Add the shortcode to a sidebar widget that appears only on user profile pages:

  1. Create a widget area
  2. Add the shortcode to a Text/Shortcode widget
  3. Display the widget conditionally using a plugin like Widget Options

Troubleshooting Shortcode Issues

Shortcode Displays as Text

Problem: The shortcode appears as [username_manager] instead of showing the form.

Solution:

  1. Verify the plugin is activated
  2. Check that you’re using square brackets [] not parentheses or curly braces
  3. Ensure there are no extra spaces in the shortcode
  4. Try switching to the Text/HTML editor and back

Form Not Showing

Problem: Nothing appears where the shortcode is placed.

Solution:

  1. Verify username changes are enabled in General Settings
  2. Check if you’re logged in
  3. Verify your user role has permission to change usernames
  4. Check for JavaScript errors in the browser console
  5. Disable other plugins to check for conflicts

Form Appears Unstyled

Problem: The form looks broken or has no styling.

Solution:

  1. Clear your browser cache
  2. Clear your site cache (if using a caching plugin)
  3. Check if your theme’s CSS is conflicting
  4. Verify the plugin’s CSS files are loading

Save Button Stays Disabled

Problem: The Save Changes button remains grayed out.

Solution:

  1. Ensure you’re entering a valid username
  2. Check that the username meets length requirements
  3. Verify the username is available
  4. Check browser console for JavaScript errors

Related Documentation

Last updated: February 15, 2026