Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Does anyone know of a way to create a sitemap by using wp_list_pages and have the order by the same orders a custom nav menu?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Using wp_list_pages you can sort order only by:

  • 'post_title'
  • 'menu_order'
  • 'post_date'
  • 'post_modified'
  • 'ID'
  • 'post_author'
  • 'post_name'

anything else (like order by custom menu order) you would have to write your own function. But a better way to get it done would be to create a custom walker for it so you could control the output.

share|improve this answer

Here's a snippet I use to create a sitemap based on custom menu order:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.