Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Login, Register, Forgot password, Email Confirmation in Front-end only?

@wpweaver

Participant

I don’t think there is a plugin or existing feature that does this.

I’m really surprised that this isn’t a common question, as it is a real huge issue that allows spammers a backdoor to register as a user to your site. Very bad. This code will redirect all login and password attempts to a static page on your site which can use the regular bbp login, register, and pass shortcodes.

You can use this custom code:

<?php
// intercept the Register and Lost your password? links from the standard WP login screen

define( 'REGISTRATION_URL', 'https://example.com/register');

	add_filter('register_url','custom_redirect_login_register');
	add_filter('lostpassword_url','custom_redirect_login_register');

	function custom_redirect_login_register($reg_url) {
		return home_url( REGISTRATION_URL );
	}

	/**
	 * Redirects visitors to <code>wp-login.php?action=register</code> to
	 * <code>site.com/registration-page-name</code>
	 */

	add_action( 'login_form_register', 'custom_catch_register' );
	function custom_catch_register()
	{
		wp_redirect( home_url( REGISTRATION_URL ) );
		exit();
	}

	/*
	 * intercept bbforum.me/wp-login.php?action=lostpassword and
	 *           bbforum.me/wp-login.php?action=retrievepassword
	 *
	 */

	add_action( 'login_form_lostpassword', 'custom_filter_option' );
	add_action( 'login_form_retrievepassword', 'custom_filter_option' );
	/**
	 * Simple wrapper around a call to add_filter to make sure we only
	 * filter an option on the login page.
	 */
	function custom_filter_option()
	{
		wp_redirect( home_url( REGISTRATION_URL ) );
		exit();
	}
?>

There are articles on how do add custom code to your bbPress installation.

Note that this is an option provided with my plugin “Weaver for bbPress” which is a fully turn-key solution to creating a bbPress site. I have not created a stand alone version of this option yet.

Skip to toolbar