I
I
Ivan Vasilich2020-06-20 17:31:38
User identification
Ivan Vasilich, 2020-06-20 17:31:38

How to disable login by name in wordpress?

I can’t really find how to make it so that the user can enter the Wordpress CMS only by email. To not use a username. Since the name is visible on the main page where the posts are, and it is not difficult to see this name.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Semyon Abezgauz, 2020-06-20
@abezgauz

Hello!
There is another way:

/*
 * Сокрытие админского логина
 */
function hide_login_in_name($author) {

  if ( strstr($author, "Test") ) {
    return "Test2";
  }
  return $author;

}

add_filter('get_comment_author', 'hide_login_in_name');

Test - real name Test2
- what will be displayed instead

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question