Remove the button "Add Listing" for Contributors


I my site I only allow 1 listing per vendor. I was wondering if once they create their first listing i can remove the “add listing” button from the top right.

I already removed the button for non logged in users using this code and it worked well…just wondering if I can also remove it once they added one listing. Thanks

			return $template;
		return hivepress()->helper->merge_trees(
				'blocks' => [
					'listing_submit_link' => [
						'type' => 'content',


Please check the solution in this topic Remove add listing button, when one listing is created

1 Like

Hello Andrii,

Its not working for me. the button now disappears even for “Subscriber” users without a listing so there is no way to add a listing for them.

I would like for users without a listing to be able to see the button, and I guess once they add a listing they become “Contributor” user. So hide the add listing button for “Contributor” users


Please try this PHP snippet:

    function( $value ) {
        if ( ! is_admin() && hivepress()->request->get_context( 'listing_count' ) >=1 ) {
            return false; // do not display button

        return $value;

Thank you so much, Andrii! this works perfectly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.