How to Remove Forgot Username and Forgot Password Links?

Author:

If you have a Joomla website and there is providing a login form for your users maybe there are several reasons to hide or remove links “Forgot username” and “Forgot password” from the login form. In this tutorial, I’ll show how to remove forgot username and forgot password links in Joomla.

Remove  Joomla Forgot Username and Forgot Password Links

There are two login forms where you can see these 2 links forgot username and forgot password. The first one is the user component and the second is the login module.

1.remove forgot password and username
1. remove forgot password and username

Step1: Remove the links from the user component 

  • Login to administrator >Dashboard
  • Go to  System > Site Templates 
2. system-site-template
2. system-site-template
  • Now you will see the all installed templates. In the below screenshot is the default Joomla 4, So there is only one template Cassiopeia.
3.template-cassiopea
3.template-Cassiopeia
4. click on create override in joomla4
4. click on Create override in joomla4
  • Now click on user component com_users
5.override-user-component-joomla4
5.override-user-component-joomla4
  •  Go > com_users  > login view(layout) and click on it.
6.override-login-user-component-joomla4
6.override-login-user-component-joomla4
  • Created successfully override.
  • Click on the editor tab Go > HTML > com_users  > login view(layout)
  • There are 3 files in the overrides folder as below
8.layout-com_users_login
8.layout-com_users_login
  • We have to select one file defualt_login.php and click on it
9.default_login.php
9.default_login.php
  • Comment HTML code as in below screenshot and save and close
10.comment code joomla 4
10. comment code Joomla 4
  • Now you can reload the page of the front-end site and check. Both links have been removed.
11.removed links from user component
11. removed links from the user component

Step2: Remove the links from the login module

  • Login to administrator >Dashboard
  • Go to  System > Site Templates 
  • Click on the template which is selected as default.
  • Now click on the Create Overrides tab same as the above steps.
  • Click on the left side module mod_login to create an override
create login module override
create the login module override
  • Go to the Editor tab and click on HTML > mod_login > default.php
edit defualt.php of mod_login
edit defualt.php of mod_login
  • Edit the default.php file and comment on the code as below screenshot
comment code in default.php
comment code in default.php
  • Now check front end login module
login-form-links removed
login-form-links removed

So now you can see we have removed forgot username and forgot password links in the Joomla user component and login module.

Let See: