WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some pages with shortcodes and I don't want my client to see the pages with shortcodes. Is there a way to hide these pages under Pages-->All Pages,but should be seen under Menu.Is there a plugin to achieve this?I have searched but found none.

share|improve this question
What do you mean by seen under the menu? Please explain a bit more. – sri Nov 26 '13 at 10:44

I used the following code snippet into one of my project. Use the code snippet into the functions.php within the main PHP tag:


function wpse20131126_exclude_pages_from_admin($query) {
    global $pagenow, $post_type;
    if (is_admin() && current_user_can('editor') && $pagenow=='edit.php' && $post_type =='page') {
        $query->query_vars['post__not_in'] = array(
                        '77', // the security page
                        '74', // the shortcoded page
                        '111' // the abracadabra page

add_filter( 'parse_query', 'wpse20131126_exclude_pages_from_admin' );

Add your pages inside the array to hide from the eye of User role 'Editor'.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.