How to modify the D7 user login page html to remove the register and new password options for non-admins? So, I'm maintaining a Drupal 7 site for which we recently switched the users over to SSO through a third-party OAuth provider. The implementation isn't fancy, but added a login link to what I assume is the standard login page with a tabs for "registration, login, and password reset."

What I would like to do is remove the menu options altogether for regular users, keeping just the OAuth login link and some additional text to inform users of new registration procedures. For admins, I would like to preserve the regular name and password based login options. 

I am aware of the Tab Tamer module, but I'd like a little more granular control. I believe I need to approach this with hook targeting the login block, but I haven't found any examples on how to control what HTML in the block itself.

So, how to do modify the login block's HTML to remove the extra tabs for regular users, but preserve it for admin users?
I don't think you've thought this through. The standard login page (/user/login) only shows the login form when a user is not yet logged in. So if you want the ability for admin users to see the usual options on that page, you will need to show them to all users -- since you don't know whether or not the user is an admin before they log in. If a user is already logged in (whether through OAuth or standard login) they will not be prompted to log in again.

If, instead, you want to modify the user login options for all users, this can be accomplshed via hook_form_alter() in a custom module, replacing MODULENAME with the name of your module in the hook implementation:

function MODULENAME_form_alter(&amp;$form, $form_state, $form_id) {
  if ($form_id == 'user_login_block' || $form_id == 'user_login') {
    // Your code to modify the form goes here
    $form['some_text'] = [
      '#markup' =&gt; '&lt;p&gt;Some text to inform users of new registration procedures&lt;/p&gt;',
    ];
  }
}


EDIT: If you have never made a Drupal module before, don't be intimidated! The type of thing you're trying to do can be accomplished with a very small module.

Keep in mind that the Drupal Form API is basically just a bunch of PHP arrays. 

To add markup to a form array, use the #markup form element as I've shown im my example above.

To remove an element from a form array, you can unset() that value before the array is rendered. For example:

&lt;?php 
unset($form['buttons']['preview']);
?&gt;


I'm not sure what form elements you'll want to remove, but this technique should help.

This stuff is well documented on Drupal.org and all over this forum.


Remove unwanted form elements 
Add markup to a form
hook_form_alter()
Drupal Form API reference