Exlude pages from wp_list_pages

I’m not entirely clear on what you are trying to do exactly because “I had to manually build another menu. I just created a list and inserted links to the pages I needed, without using any WordPress function.” didn’t make a whole lot of sense.

You need to exclude pages by including the exclude parameter within your wp_list_pages function.

E.g. (example: ‘exclude=3,7,31’).

<?php wp_list_pages('title_li=&depth=".$bpt_navigation_depth."&sort_column=menu_order&exclude=17'); ?>

That aside concerning the second snippet of code, you likely do not need to call each of those parameters, not unless you are using each of them.

So trim back those arguements to the bare minimum of what you need to accomplish.

<?php $args = array(
    'depth'        => 0,
    'exclude'      => '17',
    'sort_column'  => 'menu_order, post_title',
    'post_type'    => 'page',
    'post_status'  => 'publish' 
); ?>

<?php wp_list_pages($args); ?>

That’s enough to get you going and you can add or remove arguments as you need them.

If you are trying to build a list of all pages except page where ID equals 17 then the above snippet will work for you.

Let us know!