Support » Fixing WordPress » Possible to include, not exclude, certain Pages?

  • WPChina


    I have a bunch of pages I created, but I only want 3 or 4 to be displayed.

    I found that there is a way to exclude, with code like this:

    <?php wp_list_pages(‘exclude=57,58&title_li=’) ?>

    But if I try to use “include” instead of “exclude”, it doesn’t work. Any idea if it is possible to only INCLUDE certain pages?


Viewing 7 replies - 1 through 7 (of 7 total)
  • You can use only the parameters listed in the Codex: Template_Tags/wp_list_pages




    I can hack the code to create an “include” feature, but when future upgrades to WP arrive I will always need to to tweak. If the developers are watching this thread, it would be great to have this feature in future versions.

    The reason this is important is that if you “include”, you don’t have to worry about adding more info to the tag in the future when you add more pages. However if you only use “exclude”, each time you create a page you must remember to make changes to the code to exclude it (if you want) from being seen by users.

    tks! 🙂

    Very true.. good point.

    Actually I agree with this logic, too. Unfortunately I am not a developer, just a volunteer helper in the forum.
    Let’s hope somebody is watching this thread…

    You can try another approach.
    If you sort your links by category, such as “Blogroll”, “Good Sites”, “Whatever”…, you can do the following:’

    o Delete the wp_list_pages() section from your sidebar

    o In the Links/Link Categories add a new link category named “Pages”

    o Go to Manage/Pages and copy the permalinks for the pages you want to list.

    o Now go to Links/Manage and add the permalinks to the “Pages” link category.

    The links to your selected pages will show up in a separate list block in your links list.

    I’ve made an example for you at
    Far down at the right side under Blogroll and Friendly Sites, you find the Pages heading, with one link to my About page.



    Ahhh, very good suggestion petit! I woould still like to see an “include” addition to the native code in the future, but I will use your suggestion now, as it works pretty easily!


    Shure, all software is refined under the pressure of its users 😉

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Possible to include, not exclude, certain Pages?’ is closed to new replies.