# Hide Links on the Login Page

> Removes the "Go to site", "Lost your password?" and privacy policy links from the login screen, each one switchable on its own.

- Type: PHP
- Runs: Run everywhere
- Category: [Login](https://wpide.com/library/category/login/)
- Tags: login, cleanup, links
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/hide-login-page-links/

## Code

```php
// Choose which links to hide.
$wpide_hide_login_links = array(
    'back_to_site'  => true,  // "← Go to Site Name"
    'lost_password' => false, // "Lost your password?"
    'privacy'       => true,  // Privacy policy link
);

add_action( 'login_enqueue_scripts', function () use ( $wpide_hide_login_links ) {
    $selectors = array();

    if ( ! empty( $wpide_hide_login_links['back_to_site'] ) ) {
        $selectors[] = '#backtoblog';
    }
    if ( ! empty( $wpide_hide_login_links['privacy'] ) ) {
        $selectors[] = '.login .privacy-policy-page-link';
    }

    if ( $selectors ) {
        wp_add_inline_style( 'login', implode( ',', $selectors ) . '{display:none !important;}' );
    }
} );

add_filter( 'lost_password_html_link', function ( $html ) use ( $wpide_hide_login_links ) {
    return empty( $wpide_hide_login_links['lost_password'] ) ? $html : '';
} );
```

## Notes

Hiding the lost password link does not disable password resets.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Links on the Login Page" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
