How To Remove Post Preview Button From WordPress Post Editor

Are you working on a site or with custom post types where you don’t need post preview button? Here’s how to remove post preview button from post editor.

You will need to add the following code snippet to your website:

function adminStyle() {
	echo '
	<style>
		.editor-post-preview {
		display: none;
		}
	</style>
	';
}
add_action( 'admin_head', 'adminStyle');

That’s it! If you’re using the Code Snippets plugin, it should look like this: