How to remove the Register link from the WordPress Login

Contents

Build your own WordPress Support Plan

Expert, yet affordable WordPress support & maintenance plans.
View our pricing

Many WordPress sites don’t need to offer the option for users to register and often find spam users created which clog up your database and can cause problems down the line. Most spam users will register on your WordPress website by using the default register link found on the login screen, this can easily be removed which will reduce the number of spam user registrations on your website.

To remove the register link from the WordPress login.php screen you will need to add a small function to your theme functions.php file or create a WordPress MU plugin. We recommend using an MU plugin as this will be used no matter what theme you use and can’t be deactivated by accident by other site administrators.

Function to remove the register link from WordPress login.php

/**
* Remove the register link from the wp-login.php script
* https://wphelper.io/remove-register-link-wordpress-login/
*/
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;
});

This function will remove the register link completely which is a better method than removing the link with CSS. If you remove the link using CSS most bots will still find it as they will crawl the page HTML ignoring the CSS.

If you get stuck with adding this function to your site please leave a comment below or contact us.

For more information on removing the register link from the WordPress Login, let us help you accordingly, from start to finish, with one-Time fixes, custom plans, or monthly routines for your WordPress website.

Written By
Adam Haworth
Founder of WP Helper.
You will also like these articles

Relax Knowing Your WordPress Site Is Secure & Running Smoothly 24/7

Let us manage your WordPress site, everything from security to updates will be taken care of. Support plans also come with dedicated support so we can do anything from adding content to customising your site for you.

Same Day Professional WordPress Support

Get WordPress Support Today

Need help with a single WordPress problem, today? We can help with anything from adding analytics tracking code to site hack recovery. Full money back guarantee on all jobs.

1. Submit a Support Request

Use our support ticket form below to send details of your problem to our developers.

2. Get a Quote

We will review your request and provide a quote within 24 hours (but usually within a few hours).

3. We fix your WordPress problem

Our team will begin fixing your WordPress problem the same day.

4. 100% Money Back Guarantee

If we can’t fix the problem for the amount quoted we will refund you 100%.

  • Do you have a screenshot of the issue or have a copy of the theme or plugin that is at fault? If you want to upload php, html or css please zip first.
    Drop files here or
    Accepted file types: jpg, jpeg, png, pdf, zip, gzip, rar, doc, txt, Max. file size: 15 MB, Max. files: 10.