Tips on Customizing Contextual Related Posts

How to Hide the "Related Posts" Admin Menu

function plt_hide_contextual_related_posts_menus() {
	//Hide the "Settings → Related Posts" menu.
	remove_submenu_page('options-general.php', 'crp_options_page');
}

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

Where do I put this code?

How to Hide the "Contextual Related Posts" Meta Box

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

	//Hide the "Contextual Related Posts" meta box.
	remove_meta_box('crp_metabox', $screen->id, 'advanced');
}

add_action('add_meta_boxes', 'plt_hide_contextual_related_posts_metaboxes', 20);