When WPForms is installed, an Add Form button will display in the TinyMCE page/post editor options for WordPress.
This button can easily be removed by adding the code snippet below to your site. In this specific example, we’re hiding the Add Form button on pages. However, you can replace page
with any post type name.
/**
* Remove the WPForms TinyMCE media button.
*
* In the function below we disable displaying the media button
* on pages. You can replace 'page' with your desired post type.
*
* @param bool $display
* @return bool
*/
function wpf_remove_media_button( $display ) {
$screen = get_current_screen();
if ( 'page' == $screen->post_type ) {
return false;
}
return $display;
}
add_filter( 'wpforms_display_media_button', 'wpf_remove_media_button' );