How to exclude content (and other returned values) from WP_query()?

Question

Does a method exist that can return a simple array of the pages in the site that are published? I only want the name and the slug returned, not the full content or other default values.

I’ve tried WP_query(), get_posts(), get_pages() and query_posts() but they all return the post/page content. I’m only looking to get the post name and slug returned.

If there’s no lighter method, I can use one of these. Just want to make sure.

Any help, much appreciated.

0
Scott B 2 years 2020-09-01T20:11:20-05:00 0 Answers 43 views 0

Leave an answer

Browse
Browse