Diwali Offer 20% offUse Coupon Code Diwali2021 shop Now

How can we help?

Hide/Show registration button on specific events

Not all your events need a Registration Button/ tab. So here is the solution to remove the registrations tab/button in WP Event Manager.

There are certain events where the organizer does not want the people to register for the event and hence does not requires a registration tab.

Hide/Show registration button on specific events

The following code can be implemented in the Functions.php file of the child theme to disable or enable the Registration tab on specific events.

  1. Open your child theme function.php.
  2. Add this code:
    * Register meta box(es).
    add_action( 'add_meta_boxes', 'wpdocs_register_meta_boxes' );
    function wpdocs_register_meta_boxes() {
        add_meta_box( 'registration-button-settings-meta-box', __( 'Registrations button meta box', 'wp-event-manager' ), 'wpdocs_my_display_callback', 'event_listing' ,'side');
    /* Meta box display callback.
    @param WP_Post $post Current post object.
    function wpdocs_my_display_callback( $post ) {
    	// Display code/markup goes here. Don't forget to include nonces!
        $show_regi_btn = get_post_meta($post->ID,'_show_hide_registration_button',true);
        <label for="wporg_field">Hide registrations button</label>
        <input type="checkbox" name="show_hide_registration_button" id="show_hide_registration_button" value="1" <?php if(isset($show_regi_btn) && $show_regi_btn == 1) echo 'checked="checked"'; ?> >
    // Save your meta box content
    add_action( 'save_post', 'wpdocs_save_meta_box' );
    /* Save meta box content.
    @param int $post_id Post ID
    function wpdocs_save_meta_box( $post_id ) {
    	// Save logic goes here. Don't forget to include nonce checks!
    	$show_hide_registration_button = isset($_POST['show_hide_registration_button']) ? $_POST['show_hide_registration_button'] : '0';
       	update_post_meta($post_id,'_show_hide_registration_button', $show_hide_registration_button);
     * registration_limit_restriction
     * @param $method,$post
     * @return $method
     * @since 3.1.11
    function your_child_theme_registration_disable($method,$post){
        $disable_button = get_post_meta($post->ID,'_show_hide_registration_button',true);
        //disable button if settings in event meta box
        if( $disable_button == 1){
             return false;
            return $method;
    add_filter( 'submit_event_form_fields', 'show_hide_registration_button' );
    function show_hide_registration_button( $fields) {	
    	$fields['event']['show_hide_registration_button'] =  array(
    										'label'       => __( 'Show Hide Registration Button', 'wp-event-manager-registrations' ),
    										'type'        => 'checkbox',
    										'required'    => false,
    										'priority'    => 22,
    	return $fields;
Was this article helpful?
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Quick Links