How to Remove Dokan Vendor Registration Button From Your Customer Account
Dokan has this amazing feature where a customer can apply to be a vendor from his account. There is a button in the customer account “Become a Vendor“, which they can use to become a vendor.
However, some of the marketplace owners don't want that button in the customer's account. There are a few reasons behind it-
- They don't want to distract the customer
- Limit the number of vendors in the marketplace
- Make sure that anybody can't apply to be a vendor
- Stop the migration of customers to vendors.
That is why today we are going to show you how to remove and hide the “Become a Vendor” button. In short, how to perform Dokan disable vendor registration.
Let's get into the details-
Dokan Disable Vendor Registration: 3 Easy Steps to Remove Vendor Registration Button
Before showing you how to disable or hide the vendor registration button from a customer's my account section, let us show you what it looks like on a customer my account page.
Actually, hiding the “Become a Vendor” button is very easy than you think. You may be wondering if we are going to remove the code altogether for removing the button. Hell, no! Removing coding is always a bad idea, as they are interconnected. You remove a function here, and it can affect other functions as well.
Instead of removing any code, we are going to share a simple 2 lines of code that you can add to get your job done. Yes, it's that easy.
So, let's get started!
Step 1: Create a Child Theme
You can directly apply these changes to your main theme. That being said, it's always a better idea to edit the child theme. Because if the situation is out of your hand, it won't affect your main site. So, our suggestion is to apply this experiment to the child theme.
If you don't have a child theme ready in the first place, create a child theme now. Then follow this tutorial.
Creating a child theme is not rocket science. You can do it all by yourself by following proper guidelines. You can follow our step-by-step guide to create a child theme for you. Also, there are plugins in the WordPress repository to create a child theme with ease. You can use any child theme generator plugin to get your job done.
Step 2: Copy the Code in the Child Theme's function.php File
After creating the child theme, access the function.php file to edit the file.
Go to finder or folders and navigate to WP-Content–> Themes–> Your Child Theme Name–> Open functions.php file.
If you're editing the main theme, navigate to WP-Content–> Themes–> Theme Name –> Open functions.php file.
Now copy the below code and paste it to the bottom of the functions.php file.
remove_action( 'woocommerce_after_my_account', array( Dokan_Pro::init(), 'dokan_account_migration_button' ) );
Note: Apart from the Dokan Pro version, we have added the “Become a Vendor” button to the Dokan Lite version as well. So, if you are using the latest Dokan Lite version (3.7.21 or later), you'll see this button on the customer's my account page while using the Dokan free version.
For the latest version, use the below-mentioned code:
#-- Remove Become a Vendor Button --#
function remove_become_a_vendor_button() {
remove_action( 'woocommerce_after_my_account', [ dokan()->frontend_manager->become_a_vendor, 'render_become_a_vendor_section' ] );
}
add_action( 'wp_head', 'remove_become_a_vendor_button' );
Step 3: Save the Code and Refresh Your Site
After you paste and save the code, log in to a test customer's account and refresh the website. You will see that the “Become a Vendor” button has disappeared.
This is how you can easily remove or hide the vendor registration button in Dokan.
We have published a video tutorial on Dokan disable vendor registration button, you can check this video as well to get your job done with ease.
A Few Common FAQs on Dokan Disable Vendor Registration Button
No, there is no such option in the Dokan settings panel to enable/disable the vendor registration button. You have to add a tiny code to your theme's function.php file to remove the “Become a Vendor” option.
To remove the “Become a Vendor” button from the customer my account page, you will need to either upgrade to Dokan Pro or ensure that you have the latest version of Dokan Lite installed (3.7.21 or later). Previous versions of Dokan Lite do not have the feature to remove the button.
No, it's not possible to remove the “RMA Requests” from the customer's my account menu as of now. If we ever add this feature to the Dokan plugin, we will announce it.
Remove Dokan Vendor Registration Button- A Quick Recap for You
As WordPress and its plugins are open sources, you can easily add customizations to make the necessary changes. We have already shown you how to hide the vendor registration button from the customer's my account menu. Follow these 3 steps to get your job done in a few moments:
- Create a child theme (not mandatory but recommended)
- Copy and paste the code to your theme's functions.php file (we've shown the code in the 2nd step)
- Save the code and refresh your site
That's all!
Hopefully, now you will be able to hide the vendor button from your customer's account. If you have any queries, do let us know in the comment section below. We always appreciate queries from our readers and users.