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:
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