Tips on Customizing ActivityPub

How to Hide ActivityPub Admin Menus

function plt_hide_activitypub_menus() {
	//Hide "Outbox".
	remove_menu_page('edit.php?post_type=ap_outbox');
	//Hide "Settings → ActivityPub".
	remove_submenu_page('options-general.php', 'activitypub');

	//Hide "Users → Followers ⁂".
	remove_submenu_page('users.php', 'activitypub-followers-list');
	//Hide "Users → Extra Fields ⁂".
	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?

How to Hide ActivityPub Dashboard Widgets

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

	//Remove the "ActivityPub Plugin News" widget.
	remove_meta_box('activitypub_blog', 'dashboard', 'normal');
	//Remove the "ActivityPub Author profile" widget.
	remove_meta_box('activitypub_profile', 'dashboard', 'normal');
}

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