Remove Register Link from wp-login.php

I would like to remove the Register link from the wp-login page. (My page is /marylogin).

I found the following code and tried putting it in my child theme functions.php file and also my wp-login.php file. It didn't work in either place.

/**
* remove the register link from the wp-login.php script
*/
add_filter('option_users_can_register', function($value) {
$script = basename(parse_url($_SERVER['SCRIPT_NAME'], PHP_URL_PATH));

if ($script == 'wp-login.php') {
$value = false;
}

return $value;
});

Can you tell me please how to remove the Register link from the wp-login page when my page is marylogin.

Thank you