Tips on Customizing XPoster – Share to X and Mastodon

How to Hide the "XPoster" Admin Menu

function plt_hide_wp_to_twitter_menus() {
	//Hide the "XPoster" menu.
	remove_menu_page('wp-tweets-pro');
}

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

Where do I put this code?

How to Hide the "XPoster" Meta Box

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

	//Hide the "XPoster" meta box.
	remove_meta_box('wp2t', $screen->id, 'side');
}

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