How to Hide ActivityPub Admin Menus

function plt_hide_activitypub_menus() {
	//Hide the "Settings → ActivityPub" menu.
	remove_submenu_page('options-general.php', 'activitypub');

	//Hide the "Users → ⁂ Followers" menu.
	remove_submenu_page('users.php', 'activitypub-followers-list');
	//Hide the "Users → ⁂ Extra Fields" menu.
	remove_submenu_page('users.php', 'http://127.0.0.1/wp-admin/edit.php?post_type=ap_extrafield');
}

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

Where do I put this code?