[resolved] How to hide a page from the all pages list in dashboard (4 posts)

  1. matthewpolld
    Posted 9 months ago #


    My 'home' page is being used by the events manager plugin to display a list of events. So I don't want a user to try and add text to this page, by clicking 'edit' page. How can I either hide this page from the 'all pages' list or disable it in some way. I still want the page, as it's needed for the plugin.


  2. Mike Price
    WP Engine Tech Support
    Posted 9 months ago #

    Hey there,

    I found a couple of plugins that might help. The first one is free but doesn't really stop people from adding/editing text content. The 2nd one does exactly what you need but is $19 one time fee. Dont be confused that it says lock posts as it DOES lock pages as well (just tested it) Hopefully, one of these will work for what you need:



  3. matthewpolld
    Posted 9 months ago #

    Thank-you. I didn't really want to use another plugin for my site. I used this :

    add_filter( 'parse_query', 'exclude_pages_from_admin' );
    function exclude_pages_from_admin($query) {
        global $pagenow,$post_type;
        if (is_admin() && $pagenow=='edit.php' && $post_type =='page') {
            $query->query_vars['post__not_in'] = array('28');
  4. Mike Price
    WP Engine Tech Support
    Posted 9 months ago #

    Very cool! I am by no means a coder so this is over my head so I really appreciate plugins LOL Glad you were able to find the right code :)


You must log in to post.

About this Topic