How to register users as customers and hide the "I'm a seller" option? Dokan MultivendorHow to register users as customers and hide the "I'm a seller" option? Dokan Multivendor

Hello guys how are you? Welcome back to my blog therichpost.com. Guys today in this post, I will tell show you How to register users as customers and hide the “I’m a seller” option? Dokan Multivendor

Guys if you are new in  WordPress or in  WooCommerce then please check the below links for some good tutorials:
  1. WooCommerce Hooks
  2. WordPress Tricks
  3. WordPress Hooks
  4. Dokan

To register users only as customers and hide the “I’m a seller” checkbox in Dokan Multivendor, follow these steps:


✅ Step 1: Hide the “I’m a Seller” Option on Registration Page

Add the following code to your WordPress theme’s functions.php file or via a custom plugin:

// Remove 'I am a vendor' checkbox from Dokan registration
add_filter( 'dokan_vendor_registration_form', '__return_false' );

// Optionally remove the field via jQuery for safety
function remove_dokan_vendor_checkbox_js() {
    if ( is_account_page() ) {
        ?>
        <script>
            document.addEventListener('DOMContentLoaded', function () {
                const sellerOption = document.querySelector('.show_if_seller');
                if (sellerOption) {
                    sellerOption.style.display = 'none';
                }
                const checkbox = document.querySelector('#role');
                if (checkbox && checkbox.value === 'seller') {
                    checkbox.value = 'customer';
                }
            });
        </script>
        <?php
    }
}
add_action( 'wp_footer', 'remove_dokan_vendor_checkbox_js' );

✅ Step 2: Force Registration as “Customer” Only

You can override the default behavior to force all new users to be registered as customers:

add_filter( 'woocommerce_new_customer_data', 'set_default_customer_role_dokan', 10, 1 );

function set_default_customer_role_dokan( $args ) {
    $args['role'] = 'customer';
    return $args;
}

✅ Optional: Remove the Seller Role from the Registration Backend (Admin Panel)

If you have a custom registration form or plugin like WPForms, make sure it does not assign the “seller” role during registration.


🔒 Bonus: Prevent Role Escalation by Users

If you’re concerned users might try to manipulate the registration form, this extra check ensures only admin can assign roles:

add_filter( 'editable_roles', function( $roles ) {
    if ( ! current_user_can( 'administrator' ) ) {
        unset( $roles['seller'] );
    }
    return $roles;
} );

📌 Result

  • The “I’m a seller” checkbox will be removed from the Dokan registration form.
  • All users will be registered as customers only.
  • Prevents users from registering or switching to the seller role manually.

Let me know if you’d also like to redirect sellers trying to register, or customize the login/register form UI then feel free to comment below.

Ajay

Thanks

By therichpost

Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 19, MedusaJs, Next.js, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.