how to customize the wordpress password reset form

How to Customize the WordPress Password Reset Form

Are you looking to create your own WordPress password reset forms?

By creating a custom password reset form, you’ll provide a stronger user experience by customizing these user pages to match your website theme, display your logo, and offer additional content. If you run an eCommerce company or a membership site, having consistent branding across your website is especially important.

How Do I Reset My WordPress Password?

You can reset your WordPress password by using the lost password link in WordPress. This will send you an email with a link that you can click to reset your password.

For a better user experience, a custom password reset form lets you tweak the appearance of the form and the content of the email notifications. We’ll show you how to create a custom password reset form, send the user to the page, and allow them to easily reset their password.

How to Create a Password Reset Form in WordPress

To create a custom password reset form, you’ll need the subscribe to WPForms’ premium version. The Pro license includes the User Registration addon that lets you create custom password reset, user registration, and login forms for your website

Let’s get started!

WPForms is the best WordPress Form Builder plugin. Get it for free!

1. Install WPForms

First, log in to your WPForms account. Once you’ve logged in, click on the Downloads tab.

Arrow highlighting WPForms downloads tab

This is a page with all of your available licenses. To download the plugin, click on the Download WPForms button next to the pro license. This will save a zipped file of the WPForms plugin to your computer.

Download WPForms button

After you’ve downloaded your zip file, head to your WordPress site where you’d like to install WPForms. Then, on the admin dashboard, click Plugins » Add New and then the Upload Plugin button.

Upload plugin button on WordPress

From here, click on the Choose File button and select the WPForms zip file you just downloaded.

Red arrow pointing towards the Choose File button

After your file is uploaded, click on the Install Now button.

Install now wpforms

Once the plugin is installed, click on the Activate Plugin button to activate WPForms on your site.

Red arrow pointing to the 'Activate Plugin' button

After activating the plugin, remember to verify your WPForms license key to receive automatic updates and plugin support. Adding your license key will also allow you to easily install and activate WPForms addons from inside your WordPress dashboard.

2. Install the User Registration Addon

We’re now going to install the addon we need to create the password reset forms.

In your WordPress admin area, head to WPForms » Addons.

WPForms addons

If you don’t see any addons for your license level, click on the Refresh Addons button to force a refresh.

A red arrow pointing to the orange 'Refresh Addons' button

To search for a User Registration addon, type its name into the Search Addons field located in the top-right corner of the page.

An arrow highlighting the 'Search Addons' field in WPForms

Once you’ve found it, simply click on the Install Addon button.

A red arrow pointing towards the install addon button

This will automatically install and activate the addon for you. Any addon that’s installed and ready to use will show Status: Active.

Red arrow indicating the use registration plugin is active

3. Select and Publish Form Template

To create your password reset form, go to WPForms » Add New. Search for “Password Reset” in the template library, then hover over the User Password Reset Form option and click Use Template.

Highlighting the 'Use Template' button

You can then customize the password reset form by adding or removing as many fields as you want. We recommend keeping it as simple as possible. Once you’ve finished customizing your form, we need to embed it onto your password reset page.

First, in the top right-hand corner of the form editor, click the Save button.

Save button to save your form

Once your form has been saved, click the Embed button next to it.

Embed form button

As this will be a new password reset page, we’re going to select Create New Page.

Create new page to embed form

Name your page something like Password Reset Page so you can easily find it later. Your form will now be embedded on the new page.

This next step is extremely important. 

We need to ensure we have named the URL correctly, so we’re going to update the slug’s name.

To do this, head to your WordPress admin dashboard and click Pages » All Pages. Find the new page and click Quick Edit. You’ll now see this:

Quick edit box with lostpassword as slug

Ensure the section next to Slug has lostpassword (one word) written in it. This will connect everything together. Doing this will make your page, for example, have the final URL look like this: www.example.com/lostpassword.

We’re now ready to add the code snippet.

4. Install and Use Code Snippets

To send users to your new password reset page, we’ll then need to set up a redirect using a custom code snippet. Don’t worry, it’s easier than it sounds.

First, we’re going to install the free Code Snippets WordPress plugin. On your WordPress dashboard, head to Plugins » Add New.

add new wordpress plugin

From there, search Code Snippets and click Install Now.

The Code Snippets plugin

Once you’ve clicked Activate, it’s now time to add our code. On your WordPress dashboard, click Snippets » Add New.

Add new code snippet button

After you’ve titled your snippet (we’ve gone for New Password Reset Page), copy and paste the following code into the field:

 add_filter( 'lostpassword_url', 'my_lost_password_page', 10, 2 );
function my_lost_password_page( $lostpassword_url, $redirect ) {
return home_url( '/lostpassword/?redirect_to=' . $redirect );
} 

Important: The code should only be 4 lines long. We also recommend keeping the default ‘Run snippet everywhere’ option checked.

Next, scroll down and click the button Save Changes and Activate. Note: You can also add a description and tags but it’s not necessary.

The reason we need to ensure this has been done is so people have the option to reset their passwords. If you haven’t already, quickly create a login form with our template.

Next, we’ll now add a forgot password link to your login form. To do this, we’re going to customize the Password field.

We’re going to add a link in the description here so that it displays right underneath the field. We can use the {url_lost_password} smart tag for the link.

Click on the password field to start. In the Description, paste this in:

Forgotten your password? <a href={url_lost_password} >Click here</a> to reset it.

Custom forgot password link

Your form will now have the ‘Forgotten your password? Click here to reset it’ link.

6. Final Form Tests

We now want to ensure everything is working properly. At this stage, we will have two pages with two forms:

  • A User Login page with the ‘forgot password link’ on the form
  • A new Password Reset Link page with the ‘password reset’ form on it

To ensure everything is working, head to your User Login page. Click the password reset link:

User login test page password reset link

You will then be redirected to your new reset password page (www.yourwebsite.com/lostpassword will be the URL). If it’s not, please repeat the previous steps carefully and ensure two important steps have been followed:

  • The code snippet was copied exactly as stated in step 4
  • Your reset password page has lostpassword as the slug

7. Stop Spam Password Reset Requests

Finally, prevent spam password reset requests. Constant password reset requests can be a website security risk and could indicate someone trying to break into your website, or someone trying to phish for a password. Either way, it’s annoying.

To stop these spambots, we can limit access to your site and login page by following our guide to preventing unauthorized password resets in WordPress, and eliminating these spam requests!

Next, Customize Your Password Reset Page

After you’ve embedded your password reset form onto your new page, you’ll want to brand it.

Why? By branding your password reset form and page, you’ll solidify the notion to your customer that you’re a legitimate company and increase your brand’s overall credibility.

Follow our complete guide to creating and customizing form pages on WordPress.

Also, you might want to check out this list of the best transactional email services.

Create Your WordPress Form Now

Ready to build your form? Remember to sign up for WPForms Pro as it includes the User Registration addon, lots of free templates, and a 14-day money-back guarantee.

If this article helped you out, please follow us on Facebook and Twitter for more free WordPress tutorials and guides.

Using WordPress and want to get WPForms for free?

Enter the URL to your WordPress website to install.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.