Skip to content

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 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
  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 New Page Create a new page for the username change form

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 Shortcode Block 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

Classic Editor Shortcode Add the shortcode in the Classic Editor

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

Published Page The username change form displays on the frontend

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

Username Change Form 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

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

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

Login Required Message Message shown to logged-out users

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.”

Permission Denied Message Message shown to users without proper permissions

If username changes are disabled in settings, users see:

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

  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

Enter New Username Type your desired username in the New Username field

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

If Available:

Username Available Green checkmark indicates the username is available

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

If Taken:

Username 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.

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:

Validation Error 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!”
  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)

Save Changes Click Save Changes to update your username

After successful username change:

Success Message 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

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: john_doe_2026

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

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

Cooldown 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).

You can also add the shortcode to widget areas:

  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
  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
  1. Add a Shortcode widget to your page
  2. Enter [username_manager] in the shortcode field
  3. Style the widget as desired
  1. Add a HTML module
  2. Enter [username_manager] in the HTML field
  3. Save the module
  1. Add a Code module
  2. Enter [username_manager] in the code field
  3. Save the module
  1. Add a Raw HTML element
  2. Enter [username_manager] in the content field
  3. Save the element

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

.aum-standard-form {
/* Your custom styles */
}
.aum-input-field {
/* Container for each input field */
}
.aum-input-field label {
/* Label styling */
}
.aum-input-field input {
/* Input field styling */
}
#username_change_submit {
/* Save Changes button */
}
.aum-error {
/* Error message container */
}

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

Use Case 1: Dedicated Username Change Page

Section titled “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.

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]

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

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

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

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

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