For SEO purposes I use my URLs like this:


Currently I have pages like this:





I want to list some of those page-1, page-2 etc. pages on site.com/parent/ I thought the best way to do this is to add a custom field to those.

So is there a better way to do this? If not, how can I wp list pages based on custom fields?

1 Answer 1


Function wp_list_pages() accepts arguments from get_pages() function. To list pages filtered by custom field use meta_key and meta_value in parameters array. A list of accepted parameters can be found here and here.

    'meta_key' => 'your_meta_KEY',
    'meta_value' => 'searched_value', // optional

meta_value is not mandatory, if you skip it, a list of pages with any value of the custom field will be returned.

  • I will try it later (i am not at my PC now). TY Commented Apr 25, 2019 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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