Tips on Customizing AMP for WP – Accelerated Mobile Pages

How to Hide Accelerated Mobile Pages Admin Menus

function plt_hide_accelerated_mobile_pages_menus() {
	//Hide "AMP".
	remove_menu_page('amp_options');
	//Hide "AMP → Settings".
	remove_submenu_page('amp_options', 'amp_options&tab=1');
	//Hide "AMP → Design".
	remove_submenu_page('amp_options', 'amp_options&tab=19');
	//Hide "AMP → Extensions".
	remove_submenu_page('amp_options', 'amp_options&tab=30');
	//Hide "AMP → Free vs Pro".
	remove_submenu_page('amp_options', 'amp_options&tab=31');
	//Hide "AMP → Fix AMP Errors".
	remove_submenu_page('amp_options', 'amp_options&tab=32');
	//Hide "AMP → Plugins Manager".
	remove_submenu_page('amp_options', 'amp_options&tab=33');
	//Hide "AMP → Send Feedback".
	remove_submenu_page('amp_options', 'amp_options&tab=34');
	//Hide "AMP → Options Object".
	remove_submenu_page('amp_options', 'amp_options&tab=35');
	//Hide "AMP → Import / Export".
	remove_submenu_page('amp_options', 'amp_options&tab=36');
	//Hide "AMP → Welcome to AMP".
	remove_submenu_page('amp_options', 'ampforwp-welcome-page');
}

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

Where do I put this code?

How to Hide Accelerated Mobile Pages Meta Boxes

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

	//Hide the "Show AMP for Current Page?" meta box.
	remove_meta_box('ampforwp_title_meta', $screen->id, 'side');
	//Hide the "AMP Page Builder" meta box.
	remove_meta_box('pagebilder_content', $screen->id, 'normal');
	//Hide the "Custom AMP Editor" meta box.
	remove_meta_box('custom_content_editor', $screen->id, 'normal');
}

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