### [How to Hide the Marketing Tab in Form Builder](https://wpforms.com/developers/how-to-hide-the-marketing-tab-in-form-builder/)

**Published:** February 14, 2023
**Author:** Editorial Team

**Excerpt:** This tutorial will show you how you can hide the marketing tab from inside the form builder using PHP. 

**Content:**

Would you like to hide the **Marketing** tab from inside your form builder? If you have many users with various roles on your site and using the [Access Controls](https://wpforms.com/docs/how-to-set-up-access-controls-in-wpforms/ "Controlling Permissions to Forms and Settings") has given them access to WPForms, perhaps you don’t want them to have the ability to set up any integrations on your forms. Using a small PHP snippet you can easily hide the marketing tab and in this tutorial, we’re going to show you how!

## Hiding the Marketing tab

By default, any user with the correct permissions can create forms on your site through the WPForms form builder with all available options.

![form builder tabs in default view](https://wpforms.com/wp-content/uploads/2023/02/wpforms-default-form-builder-view.jpg)

For the purpose of this tutorial, we want to hide the **Marketing** tab from within the form builder to all users who have the WordPress role of **Subscriber** or **Editor**. In order to achieve this, we’ll need to copy this snippet to our site.

If you need assistance with how and where to add snippets to your site, [please review this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

```

/**
 * Hide the Marketing tab inside the form builder
 *
 * @link   https://wpforms.com/developers/how-to-hide-the-marketing-tab-in-form-builder/
 */

function hide_marketing_tab_based_on_role() {
	
	// Default WordPress User Roles: subscriber, editor, contributor, author, administrator
	// For more information on WordPress roles check out https://wordpress.org/documentation/article/roles-and-capabilities/ 
	
	// Check if the current user is a subscriber OR an editor 
	if( current_user_can( 'subscriber' ) || current_user_can( 'editor' ) ) {
		echo '';
	}
}

add_action('admin_head', 'hide_marketing_tab_based_on_role');
```

For further information on WordPress user roles and capabilities, [please check out their documentation](https://wordpress.org/documentation/article/roles-and-capabilities/ "WordPress Roles and Capabilities").

![once the snippet is added you can now hide the Marketing tab](https://wpforms.com/wp-content/uploads/2023/02/wpforms-restrict-tabs.jpg)

And that’s all you need to hide the **Marketing** tab from WordPress users on your site with particular roles. Would you like to add a color picker to your forms? Have a look at our tutorial on [How to Add a Color Picker to Your Form](https://wpforms.com/developers/how-to-add-a-color-picker-to-your-form/ "How to Add a Color Picker to Your Form").

## FAQ

#### Q: Can I hide the Payments tab as well? 

**A:** If you want to hide the **Payments** tab as well.

```

/**
 * Hide the Payments tab inside the form builder
 *
 * @link   https://wpforms.com/developers/how-to-hide-the-marketing-tab-in-form-builder/
 */

function hide_payments_tab_based_on_role() {
	
	// Default WordPress User Roles: subscriber, editor, contributor, author, administrator
	// For more information on WordPress roles check out https://wordpress.org/documentation/article/roles-and-capabilities/ 
	
	// Check if the current user is a subscriber OR an editor 
	if( current_user_can( 'subscriber' ) || current_user_can( 'editor' ) ) {
		echo '';
	}
}

add_action('admin_head', 'hide_payments_tab_based_on_role');
```

#### Q: Can I hide the both tabs? 

**A:** You can hide both tabs by using this snippet.

```

/**
 * Hide the Payments and Marketing tab inside the form builder
 *
 * @link   https://wpforms.com/developers/how-to-hide-the-marketing-tab-in-form-builder/
 */

function hide_marketing_tab_based_on_role() {
	
	// Default WordPress User Roles: subscriber, editor, contributor, author, administrator
	// For more information on WordPress roles check out https://wordpress.org/documentation/article/roles-and-capabilities/ 
	
	// Check if current user is subscriber OR editor 
	if( current_user_can( 'subscriber' ) || current_user_can( 'editor' ) ) {
		echo '';
	}
}

add_action('admin_head', 'hide_marketing_tab_based_on_role');
```

**Categories:** Extending

**Tags:** Access, PHP

---

