Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Grant,

    Looking at the source for wp-login, it looks like the text is output in the page. However, you may be able to at least hide this using CSS and an action added to your theme’s functions.php file.

    Maybe something like this (untested):

    function hide_password_email_message() {
    	?>
    	<style type="text/css">
    		#reg_passmail {
    			display: none;
    		}
    	</style>
    	<?php
    }
    add_action( 'register_form', 'hide_password_email_message' );

    Thread Starter grantkessler

    (@grantkessler)

    Unfortunately that did not work. It just displayed it as raw code in the header of my website.

    personally I would hide it with CSS (as drew above would)
    First inject a stylesheet into the login page:

    Add the below to your functions.php

    function custom_login_css() {
    echo '<link rel="stylesheet" type="text/css" href="'.get_stylesheet_directory_uri().'/login/login-styles.css" />';
    }

    Above we have a function that takes a style sheet in a sub directory called “login” within your Theme directory.

    Then go and create the login-styles.css (or whatever you wish to name it)

    add these styles to it

    #reg_passmail
    {
    display: none;
    }

    (if the above css does not work right off the bat, try adding using “display: none!important;” before calling it quits.

    Good luck!
    Lemme know how it turns out.

    (Side Note) You can also use this to add custom CSS to any element on the login/registration page.

    Hmm, the original solution I posted worked for me: https://cl.ly/image/3I2d3z1C0i1p

    Maybe try using a later priority, since I’d assume whatever you’re using to set a password on the registration form is also hooked to the register_form hook.

    Maybe change this:

    add_action( 'register_form', 'hide_password_email_message' );

    To this:

    add_action( 'register_form', 'hide_password_email_message', 100 );

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to disable: A password will be e-mailed to you.’ is closed to new replies.