Untitled-27 Back to Project

Getting Started Untitled-27

Customisation Untitled-27

Troubleshooting Untitled-27

Security Untitled-27

Users & roles Untitled-27

Working with Client Portal Untitled-27

Integrations Untitled-27

Legacy Documentation Untitled-27

Change Error Message on the Login Screen

This is an advanced workaround for Client Portal and involves editing your functions.php file. Please ensure you have a backup of your website before making this change. If you're not comfortable editing the functions.php file of your website, you can use a free plugin like Code Snippets to help.

When a client tries to log into a portal that they haven't been assigned to, an error message will display and they will be prevented from logging in.

error message when unauthorized user tries to log in

If you would like to change what the error message says, follow these steps:

First navigate to Appearance, Theme File Editor and find the functions.php link under Theme Files on the right hand side.

Then, paste the following snippet at the bottom of your functions.php file:

add_filter( 'leco_cp_login_error_message', 'my_leco_cp_login_error_message' );
function my_leco_cp_login_error_message() {
   return 'Hello there - You are not supposed to be here I guess?';
}

The above snippet will change the error message text to to "Hello there - You are not supposed to be here I guess?".

Simply change "Hello there - You are not supposed to be here I guess?" to anything you want, and you are good to go!