Support » Themes and Templates » filter pages by Page Template, in wp-admin

  • I am looking for the best way, in the wp-admin area, to filter the Pages list ( wp-admin/edit.php?post_type=page ) to only show pages of a particular custom Page Template.

    Currently, I found that I could add a filter to “the_post” and do something like

    $template = get_post_meta($post->ID,'_wp_page_template',true);
    if ( $template != 'mypagetemplate.php' ) {
        $post->post_status = 'notmytemplate';

    to hide the Pages that are not using that “mypagetemplate.php” page template. But the wp admin menu still highlights All Pages, so I don’t think this is ideal.

    anyone have any advice?

  • The topic ‘filter pages by Page Template, in wp-admin’ is closed to new replies.