Title: WordPress function wp_list_pages not accepting &quot;exclude&quot; argument
Last modified: August 21, 2016

---

# WordPress function wp_list_pages not accepting "exclude" argument

 *  [John O](https://wordpress.org/support/users/jossoway/)
 * (@jossoway)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-function-wp_list_pages-not-accepting-exclude-argument/)
 * Hi,
 * I am trying to use the function wp_list_pages() to generate a simple site map,
   with a couple of pages excluded from the list, but the exclude argument doesn’t
   seem to be working. Am I doing something wrong? The list generates fine, and 
   accepts other arguments, it just seems to be ignoring “exclude”.
 * Here is the code i am using:
 *     ```
       <ul>
       	<?php
       	$args = array(
       	 'title_li' => '',
       	'exclude' => '4,6',
       	'sort_column'  => 'post_title'
       	);
              wp_list_pages($args);
       	?>
       </ul>
       ```
   
 * Can anyone see where I am going wrong and help? Thanks.
 * John

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

 *  [shadez](https://wordpress.org/support/users/shadez/)
 * (@shadez)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-function-wp_list_pages-not-accepting-exclude-argument/#post-4375082)
 * try with `(4,6)`
 *  Thread Starter [John O](https://wordpress.org/support/users/jossoway/)
 * (@jossoway)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-function-wp_list_pages-not-accepting-exclude-argument/#post-4375089)
 * Hi – thanks for the suggestion, but when I replace ‘4,6’ with (4,6) I get:
 *     ```
       Parse error: syntax error, unexpected ',' in (and then it indicates the line i have changed)
       ```
   
 * I also tried with (‘4,6’) but that got ignored again. 🙁
 *  [shadez](https://wordpress.org/support/users/shadez/)
 * (@shadez)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-function-wp_list_pages-not-accepting-exclude-argument/#post-4375125)
 * oops.. me bad. i did a check on my site and your code’s perfect as-is.

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

The topic ‘WordPress function wp_list_pages not accepting "exclude" argument’ is
closed to new replies.

## Tags

 * [wp_list_pages](https://wordpress.org/support/topic-tag/wp_list_pages/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [shadez](https://wordpress.org/support/users/shadez/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-function-wp_list_pages-not-accepting-exclude-argument/#post-4375125)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
