Title: [Plugin: Exclude Pages] Plugin having no effect
Last modified: August 19, 2016

---

# [Plugin: Exclude Pages] Plugin having no effect

 *  [bowoolley](https://wordpress.org/support/users/bowoolley/)
 * (@bowoolley)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/plugin-exclude-pages-plugin-having-no-effect/)
 * Hi – any idea why the plugin doesn’t work at all on this site:
 * [http://www.kaypraptaa.com/eatndrink](http://www.kaypraptaa.com/eatndrink)
 * ? Any help will be appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Technokinetics](https://wordpress.org/support/users/technokinetics/)
 * (@technokinetics)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/plugin-exclude-pages-plugin-having-no-effect/#post-987350)
 * I’m not familiar with the inner workings of Exclude Pages, so can’t help you 
   diagnose the problem, but you might want to try [Page Lists Plus](http://wordpress.org/extend/plugins/page-lists-plus/),
   which offers similar functionality but uses a different method and so may not
   be affected by whatever it is that’s preventing Exclude Pages from working on
   your site.
 * – Tim
 *  Thread Starter [bowoolley](https://wordpress.org/support/users/bowoolley/)
 * (@bowoolley)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/plugin-exclude-pages-plugin-having-no-effect/#post-987623)
 * Thanks for the suggestion – I tried it, but it didn’t work. (But I’m keeping 
   it, it’s great!) I’ll probably have to use a different theme: the one I’m trying
   to use calls dp_list_pages and I can’t figure out how to modify that… So no plugins
   using wp_list_pages have any effect.
 *  [Technokinetics](https://wordpress.org/support/users/technokinetics/)
 * (@technokinetics)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/plugin-exclude-pages-plugin-having-no-effect/#post-987624)
 * It sounds like your theme uses its own custom function for this; dp_list_pages
   isn’t a native WP function. Check your functions.php theme file, which is where
   this function should be defined.
 * – Tim
 *  [Janja](https://wordpress.org/support/users/janjabacac/)
 * (@janjabacac)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/plugin-exclude-pages-plugin-having-no-effect/#post-987681)
 * Hi,
    I have the same problem. The code in funtions.php says:
 * ‘# Displays a list of pages
    function dp_list_pages() { global $wpdb; $querystr
   = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb-
   >posts.post_status = ‘publish’ AND $wpdb->posts.post_type = ‘page’ ORDER BY $
   wpdb->posts.post_title ASC”; $pageposts = $wpdb->get_results($querystr, OBJECT);
   if ($pageposts) { foreach ($pageposts as $post) { ?>
    - 
    - <?php
       } } }’
    - Does anyone know, how to add exclude some pages ID’d to this code? Any help
      is very much appreciated.
    - Janja
 *  [Matthias Pupillo](https://wordpress.org/support/users/mvpis/)
 * (@mvpis)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/plugin-exclude-pages-plugin-having-no-effect/#post-987726)
 * I was able to solve the problem by adding ” AND $wpdb->posts.post_parent = ‘0’”
   to the end of the query to exclude all sub pages. I am sure it could be modified
   to exclude a page by post_id
 * OLD
    `$querystr = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb-
   >posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type 
   = 'page''`
 * NEW
    `$querystr = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb-
   >posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type 
   = 'page' AND $wpdb->posts.post_parent = '0'`
 *  [riffard](https://wordpress.org/support/users/riffard/)
 * (@riffard)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/plugin-exclude-pages-plugin-having-no-effect/#post-987727)
 * In case this does no work, you can do this.
 * I just figured out how to do it. This will allow you to exclude them, while ordering
   them however you want if that is your preference.
 * Open up the “functions.php” file for the theme and replace the portion under
   “#
   Displays a list of pages”. It is located in your theme (/wp-content/themes/{name
   of your theme’s folder}/functions.php
 * Replace:
 * $querystr = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts
   WHERE $wpdb->posts.post_status = ‘publish’ AND $wpdb->posts.post_type = ‘page’
   ORDER BY $wpdb->posts.post_title ASC”;
 * With:
 * $querystr = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts
   WHERE $wpdb->posts.post_status = ‘publish’ AND $wpdb->posts.post_type = ‘page’
   ORDER BY $wpdb->posts.menu_order ASC”;
 * It took me three days to find this, so I figure I’d share. WordPress does not
   have a great support system, so if you can pass this on, please do. Please copy
   and paste the link to this post to other inquiries.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Exclude Pages] Plugin having no effect’ is closed to new replies.

 * 6 replies
 * 5 participants
 * Last reply from: [riffard](https://wordpress.org/support/users/riffard/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/plugin-exclude-pages-plugin-having-no-effect/#post-987727)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
