Hiding posts and pages in panel
The code you posted doesn’t work because there is no global $currentpage. There are $current_screen and $pagenow. add_action( ‘pre_get_posts’, ‘wpse_63414_hide_pages’ ); function wpse_63414_hide_pages( $query ) { if( !is_admin() ) return $query; global $pagenow; $pages = array(‘2′,’26’); if( ‘edit.php’ == $pagenow && ( get_query_var(‘post_type’) && ‘page’ == get_query_var(‘post_type’) ) ) $query->set( ‘post__not_in’, $pages ); return $query; … Read more