Tips on Customizing Htaccess File Editor – Safely Edit Htaccess File

How to Hide the "WP Htaccess Editor" Admin Menu

function plt_hide_wp_htaccess_editor_menus() {
	//Hide the "Settings → WP Htaccess Editor" menu.
	remove_submenu_page('options-general.php', 'wp-htaccess-editor');
}

add_action('admin_menu', 'plt_hide_wp_htaccess_editor_menus', 11);

Where do I put this code?

How to Hide the "Get a WP 301 Redirects PRO license for FREE $158" Dashboard Widget

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

	//Remove the "Get a WP 301 Redirects PRO license for FREE $158" widget.
	remove_meta_box('wp301promo_widget', 'dashboard', 'side');
}

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