Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.0   Updated Friday, February 20th, 2009 at 7:19pm

List Subpages Plugin for WordPress

This WordPress plugin generates a list of subpages for the page being viewed. You can use this plugin by inserting the trigger text in your page (where you want the list to appear), or by calling the function directly from your template file. One key feature of this plugin is that it can used outside the loop, which means you can display a list of subpages of the current page in your header, sidebar, or anywhere else. There are also several options available. You can change the sort method, exclude pages, adjust the page depth, show the date, and more.


  If you have found this page useful, please consider donating. Thanks!


  • Download the above file
  • Rename dd-list-subpages.txt from .txt to .php and upload it to your plugins directory
  • Activate the plugin from the WordPress admin panel
  • Configure the options under the admin panel: Options – DDListSubpages

Change Log

  • 04-06-07 Version 1.0 – First release.


To display the list of subpages on your page, just add the trigger text to your page:

<!-- ddlsp -->

(If you are using the visual editor in WordPress, you may have to temporarily disable it to add in the trigger text)

You can also call the function directly from a template file with the following command:

<?php echo ddlsp_generate(); ?>

If you use this method, it does not have to be in your loop, which means you can display the list of subpages anywhere you like in your theme.

Whichever method you use, just remember that it only generates the list when viewing an actual WordPress page which has subpages.


Here are the options available for this plugin under the WordPress admin panel. The options page also includes a ‘load defaults’ button.

Before List

This text is added before the list of pages.

After List

This text is added after the list of pages.

Sort Column

You can choose to sort the list by page title, menu order, page date, page modified date, page ID, page author, or page name (slug).

Sort Order

This lets you choose between an ascending or descending sort.

Excluded Items

This is a comma-separated list of page IDs you want to exclude from the list.

Included Items

This is a comma-separated list of page IDs you want to include. If you use this feature, only pages manually specified will be listed.

Page Depth

This is the depth of subpages that will be shown. The default is 1, and 0 means no limit.

Show Date

If enabled, the date will be shown after each page.

Date Format

If showing the date, this is the PHP date format that will be used.

List Title

This is an optional header for the list of pages.

Pages: [14] 13 12 11 10 9 8 7 6 5 41 » Show All

  1. Very good accessibility. I have been previously searching for age groups and you filled me with a lot of details.

  2. Useful Things available and its an thing which are been used by plugins Visit my site for more info

  3. There are also several options available. You can change the sort method, exclude pages, adjust the page depth, show the date, and more.

  4. Good

  5. The target must be to make exchange a very interesting in addition to effective guitar Click it

  6. Michael Kors Totes are perfectly sized to carry all your daily essentials. Michael Kors Outlet offers the excellent quality and eye-catching design. You can carry these new style totes wherever you go.

  7. Michael Kors Wallets are fashionable, fun, and functional. The useful and durable wallets can fit just about everything while keeping you organized. Shop our entire selection by Michael Kors Outlet Online. Can’t go wrong with these high quality wallets!

  8. This practical city bag is fashioned in lightweight Damier Canvas. It can be comfortably carried on the shoulder, or across the body, thanks to the adjustable strap with three snap fasteners.

  9. Juicy Couture Tote bags not only look so cute and faddish, but also they come in

    handy.Juicy Couture Outlet provide all kind of Juicy Couture bags for discount Juicy

    Couture, including Juicy Couture Daydreamer bags, Charm bags, Heritage Crest bags

    and so on. I believe you can’t help fall in love with them at first sight and here

    it is. Just be here find your favorite.

Pages: [14] 13 12 11 10 9 8 7 6 5 41 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.

Be sure to wrap all code in <code></code> tags.