Title: Creating registration restriction
Last modified: September 17, 2018

---

# Creating registration restriction

 *  Resolved [shorio](https://wordpress.org/support/users/shorio/)
 * (@shorio)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/creating-registration-restriction/)
 * Our site has a problem of robot registering to our site. Is there a way to restrict
   access to that so that only calls from Auth0 would be allowed.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcreating-registration-restriction%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Josh C](https://wordpress.org/support/users/auth0josh/)
 * (@auth0josh)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/creating-registration-restriction/#post-10701278)
 * [@shorio](https://wordpress.org/support/users/shorio/) – Is this happening through
   the default WordPress registration? We’ve considered blocking that but it might
   have unintended effects (i.e. other plugins using that path would fail). Issue
   is here:
 * [https://github.com/auth0/wp-auth0/issues/286](https://github.com/auth0/wp-auth0/issues/286)
 * You could use the `login_init` hook to catch POST requests to `action=register`
   and redirect back to the login page. Something like this:
 *     ```
       add_action( 'login_init', 'shorio_redirect_register_post_requests', 1 );
       function shorio_redirect_register_post_requests() {
       	$is_register = isset( $_GET['action'] ) && 'register' === $_GET['action'];
       	$http_method = strtolower( $_SERVER['REQUEST_METHOD'] );
       	if ( $is_register && 'get' === $http_method ) {
       		wp_safe_redirect( wp_login_url() );
       		exit;
       	}
       }
       ```
   
 * Not tested, FYI, but that should do the trick (or get close). That will drop 
   someone back on the login page with the Lock widget showing.
    -  This reply was modified 7 years, 8 months ago by [Josh C](https://wordpress.org/support/users/auth0josh/).

Viewing 1 replies (of 1 total)

The topic ‘Creating registration restriction’ is closed to new replies.

 * ![](https://ps.w.org/auth0/assets/icon-256x256.png?rev=3351758)
 * [Login by Auth0](https://wordpress.org/plugins/auth0/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auth0/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auth0/)
 * [Active Topics](https://wordpress.org/support/plugin/auth0/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auth0/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auth0/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Josh C](https://wordpress.org/support/users/auth0josh/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/creating-registration-restriction/#post-10701278)
 * Status: resolved