Tips on Customizing Post Expirator: Automatically Unpublish WordPress Posts

How to Hide the "Post Expirator" Admin Menu

function plt_hide_post_expirator_menus() {
	//Hide the "Settings → Post Expirator" menu.
	remove_submenu_page('options-general.php', 'post-expirator.php');

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

Where do I put this code?

How to Hide the "Post Expirator" Meta Box

function plt_hide_post_expirator_metaboxes() {
	$screen = get_current_screen();
	if ( !$screen ) {

	//Hide the "Post Expirator" meta box.
	remove_meta_box('expirationdatediv', $screen->id, 'side');

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