Editing the UserRegistration plugin’s file from the plugin directory is not recommended as all the changes will be lost after upgrading.
So, User Registration has introduced template files that contain the markup and template structure for the 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 the plugin’s template file:
- Create a folder naming user-registration inside your theme like themes/yourtheme/user-registration/myaccount.
- Copy the template file from plugins/user-registration/templates/myaccount folder maintaining the same folder structure to themes/yourtheme/user-registration directory created before.
Example 1: How To Edit Dashboard Content? #
Suppose, you need to edit the dashboard,
-> Go to wp-content/plugins/user-registration/templates/myaccount/dashboard.php
-> Copy this file.
-> Go to wp-content/themes/your-chosen-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.
Example 2: How To Edit Login Form? #
You can override our login form, which is provided as a template for flexibility to its 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-chosen-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 leave the endpoint empty from User Registration->Settings->Geneal to hide the default tabs.
You may also want to know How to add additional endpoints to my account tab.