Tips on Customizing Easy Table of Contents

How to Hide the "Table of Contents" Admin Menu

function plt_hide_easy_table_of_contents_menus() {
	//Hide the "Settings → Table of Contents" menu.
	remove_submenu_page('options-general.php', 'table-of-contents');
}

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

Where do I put this code?

How to Hide the "Table of Contents" Meta Box

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

	//Hide the "Table of Contents" meta box.
	remove_meta_box('ez-toc', $screen->id, 'advanced');
}

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