1 Answer. Use the page-specific meta box hook & accept the $post object that's passed to it - then you can check if it currently has a page template of sky-template. php . add_action( 'add_meta_boxes_page', function ( $post ) if ( $post->_wp_page_template === 'sky-template.