Title: Mandatory Login
Last modified: May 15, 2018

---

# Mandatory Login

 *  Resolved [ximenavin](https://wordpress.org/support/users/ximenavin/)
 * (@ximenavin)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/mandatory-login/)
 * Hi,
 * I need users to log in or create an account before they can register for an event.
   How can I do that?
    Regards.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmandatory-login%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [roundupwp](https://wordpress.org/support/users/roundupwp/)
 * (@roundupwp)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/mandatory-login/#post-10283892)
 * Hey ximenavin,
 * Restricting registration for logged-in users is a feature available in the paid“
   Pro” version.
 * Otherwise, you can put together a quick snippet to do this in the free version
   as well. Take a look at this FAQ: [https://roundupwp.com/codex/action-rtec_before_display_form/](https://roundupwp.com/codex/action-rtec_before_display_form/)
 * Basically you need to add this to the functions.php file for your theme:
 *     ```
       function ru_filter_event_meta( $event_meta ) {
   
       	if ( ! is_user_logged_in() ) {
       		$event_meta['registrations_disabled'] = true;
       	}
   
       	return $event_meta;
       }
       add_filter( 'rtec_event_meta', 'ru_filter_event_meta' );
   
       function ru_show_log_in_message( $args ) {
   
       	if ( $args['event_meta']['registrations_disabled'] && ! is_user_logged_in() ) {
       		echo '<p class="rtec-success-message tribe-events-notices"><strong>Please log in to register</strong></p>';
       	}
   
       }
       add_action( 'rtec_before_display_form', 'ru_show_log_in_message' );
       ```
   
 *  Plugin Author [roundupwp](https://wordpress.org/support/users/roundupwp/)
 * (@roundupwp)
 * [8 years ago](https://wordpress.org/support/topic/mandatory-login/#post-10305488)
 * Hello again,
 * Were you able to get something working? I’ll mark this as resolved but let me
   know if you have more questions!
 * – Craig

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Mandatory Login’ is closed to new replies.

 * ![](https://ps.w.org/registrations-for-the-events-calendar/assets/icon-256x256.
   png?rev=3518819)
 * [Registrations for the Events Calendar - Event Registration Plugin](https://wordpress.org/plugins/registrations-for-the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/registrations-for-the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/registrations-for-the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/registrations-for-the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/registrations-for-the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/registrations-for-the-events-calendar/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [roundupwp](https://wordpress.org/support/users/roundupwp/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/mandatory-login/#post-10305488)
 * Status: resolved