Tips on Customizing WP Mail SMTP by WPForms

How to Hide WP Mail SMTP Admin Menus

function plt_hide_wp_mail_smtp_menus() {
	//Hide "WP Mail SMTP".
	remove_menu_page('wp-mail-smtp');
	//Hide "WP Mail SMTP → Settings".
	remove_submenu_page('wp-mail-smtp', 'wp-mail-smtp');
	//Hide "WP Mail SMTP → Email Log".
	remove_submenu_page('wp-mail-smtp', 'wp-mail-smtp-logs');
	//Hide "WP Mail SMTP → Email Reports".
	remove_submenu_page('wp-mail-smtp', 'wp-mail-smtp-reports');
	//Hide "WP Mail SMTP → Tools".
	remove_submenu_page('wp-mail-smtp', 'wp-mail-smtp-tools');
	//Hide "WP Mail SMTP → About Us".
	remove_submenu_page('wp-mail-smtp', 'wp-mail-smtp-about');
	//Hide "WP Mail SMTP → Upgrade to Pro".
	remove_submenu_page('wp-mail-smtp', 'https://wpmailsmtp.com/lite-upgrade/?utm_source=WordPress&utm_medium=admin-menu&utm_campaign=liteplugin&utm_content=Upgrade%20to%20Pro');
}

add_action('admin_menu', 'plt_hide_wp_mail_smtp_menus', 2147483647);

Where do I put this code?

How to Hide the "WP Mail SMTP" Dashboard Widget

function plt_hide_wp_mail_smtp_dashboard_widgets() {
	$screen = get_current_screen();
	if ( !$screen ) {
		return;
	}

	//Remove the "WP Mail SMTP" widget.
	remove_meta_box('wp_mail_smtp_reports_widget_lite', 'dashboard', 'normal');
}

add_action('wp_dashboard_setup', 'plt_hide_wp_mail_smtp_dashboard_widgets', 20);