User Registration

  1. Home
  2. Docs
  3. User Registration
  4. How to?
  5. How to edit user registration template files such as login form?

How to edit user registration template files such as login form?

Editing UserRegistration plugin’s file from plugin directory is not recommended as all the changes will be lost after upgrading.

So, UserRegistration has introduced template files which contain the markup and template structure for frontend.

Template files can be found within the /user-registration/templates/ directory: View template file

On those files, you will see all the hooks that allow you to add or move content without needing to edit template files.

To override plugin’s template file:

  1. Create a folder naming user-registration inside your theme like: themes/yourtheme/user-registration/myaccount.
  2. Copy the template file from plugins/user-registration/templates/myaccount folder maintaining same folder structure to themes/yourtheme/user-registration directory created before.

Suppose, you need to edit dashboard,
-> Go to wp-content/plugins/user-registration/templates/dashboard.php
-> Copy this file.
-> Go to wp-content/themes/your-choosen-theme/ and create a folder user-registration and inside this folder create folder myaccount.
-> Paste the copied dashboard.php file here and edit to your requirements. This file will override the plugin’s file.

Basically, the path to be: yourtheme/user-registration/myaccount/dashboard.php

Now, the copied file will override the User Registration default template file.
It means you can add/edit codes in the newly copied file to make changes to our plugin’s template file.

Login Form:

You can override our login form, which is provided as template for flexibility to it’s contents in your case, the message Lost your password?

The login file is located at user-registration->templates->myaccount->form-login.php

You can override the login template by copying it to the yourtheme/user-registration/myaccount/form-login.php

Steps:
-> Go to wp-content/plugins/user-registration/templates/myaccount/form-login.php
-> Copy this file.
-> Go to wp-content/themes/your-choosen-theme/ and create a folder user-registration and inside this folder create folder myaccount.
-> Paste the copied form-login.php file here and edit to your requirements. This file will override the plugin’s file.

Basically, the path to be: yourtheme/user-registration/myaccount/form-login.php

Also, you can left the endpoint empty from User Registration->Settings->Geneal to hide the default tabs.

You may also want to know How to add additional endpoints in my account tab.

Was this article helpful to you? Yes No

How can we help?