The default user registration process in WordPress lets anyone register and log in to the site. In many sites, this process may lead to spam registrations with users using non-existent emails, as well as emails not owned by them. As a solution, many popular sites use email activation for new user registrations. Once email activation is enabled, users can't log in to the site or access member-specific features until the account is activated by using the activation link.
The built-in features of WordPress don't support user activation, so we have to build a custom activation process using existing actions and filters of WordPress.
In this recipe, we are going to use custom code to send an activation email for new users and block member access to the site until the account is activated.