You can filter 'posts_fields'
, check if it is the main query and limit the queried fields to … whatever you need.
See WP_Query::get_posts()
in /wp-includes/query.php
for details and side effects.
For debugging the queries I recommend the plugin Debug Bar. If you add …
define( 'WP_DEBUG', TRUE );
define( 'SAVEQUERIES', TRUE );
… to your wp-config.php
you can see the resulting query and how it affects later queries.
Related Posts:
- Return only Count from a wp_query request?
- What is the most efficient way of querying posts based on visits and date for current day?
- Is it true $wpdb->get_results is faster than WP_Query in most cases?
- How to make an activities stream mixing posts and comments?
- WP_Query Performance Issues with meta_query
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- How to correctly pass values to wpdb->prepare()?
- Add quicklink to in the Admin posts page where I can query by a meta_key
- Custom Query num_rows returns wrong amount
- Iterating through $wpdb query without using get_results for large query results
- Slow page loads due to WordPress Core Query
- Which is faster wpdb & get_row or wp_query & ge_post_meta?
- WordPress query posts with multiple post_meta data
- Any way to use FETCH_KEY_PAIR with $wpdb?
- Doing $wpdb->get_results returns NULL, doing the same query in my DB returns correct value
- wpdb get_results() returns only 2 rows
- Optimising amount of calls to custom fields
- How much does $wpdb->prepare(), then $wpdb->query() VS straight $wpdb->query(), can slow down the load time of whole page
- how to use transient method?
- How to print the excuted sql right after its execution
- Make a WP Query search match exactly the search term
- WP_Query: query posts by ids from array?
- Query WooCommerce orders where meta data does not exist
- pre_get_posts with get_posts
- author.php with ACF and CPTs
- Query Custom Meta Value with Increment
- Identify which loop you are hooking into; primary or secondary?
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Show only oldest post by author
- How to get the posts published in last two days using WP_Query?
- Finding the next 5 posts
- Dynamically Override Fancy Title – Part II
- Transient pagination not working properly
- Can not switch the queried post in pre_get_posts hook
- Get the post permalink within the loop but without additional DB query
- List the 5 most recent child pages
- Custom Loop in Page Admin Causing Other Fields to Fail
- How would I format a query that depends on post parent taxonomy
- What is considered a default query for the request filter?
- $wpdb insert is not work
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- Improve wp query perfomance on large db
- Query total number of posts
- Creating a custom search for a specific post type
- How to query a custom post type with a taxonomy filter but display post type archive page?
- Custom query for sidebar isn’t returning results
- Change query_posts to WP_Query in page but does not work
- Optional Meta Query
- Set conditional on template based on referring page slug
- Query posts intersecting tags and categories
- Query with search and subscribers only output
- Loop Performance > JSON files vs. WP_Query vs. REST API
- How to get a query variable?
- date_query seems to be ignored by wp_query
- Query Page Content From Theme Options?
- Modify Search Query if original Query gave no results
- Include current post into loop
- Is it safe to access the underlying mysqli object from \wpdb for custom queries?
- Is it possible to query from external database? [duplicate]
- Filter post query to only show direct children of category
- Does WordPress have something like Drupal’s DB API?
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- WP_User_Query orderby meta_val_num
- WP_Query custom order and pagination
- Unable to paginate a custom page query
- What’s wrong with this wpdb query?
- meta_query where the meta value is not the post title
- Multi-layered WP_Query
- `offset` WP_Query argument dont work via `pre_get_posts`
- Pagination of custom page with custom fields query
- Save queried result into database
- setting offset to category number in archive page
- Woocommerce Get Orders By Meta Value
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- Move some posts to end of sort order, even if there is a sort in the wp_Query already
- Unusual high query of user meta data
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- How to query 5 users in random who have published more than 10 posts
- WP_Term_Query->get_terms() very slow query for WordPress filter
- Is my code correct?
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Meta query doesn’t remove placeholder escape before query
- How to show post title in content editor in backend?
- How can I modify standard search query to include also ACF custom fields values?
- WP_Query with child element
- Using URL variables on a custom WP_Query
- Website goes slow down after importing long database
- How to get query results for the next page
- Using WP_Query to re-query and sort results using a date?
- Loop through multiple custom fields with increasing number
- How to organize a WP_Query’s list of posts by category and display category title?
- Need help setting up a search form for wordpress [duplicate]
- Get WP_Query query after execution?
- shortcode using multiple WP_Query’s with multiple category names not fully functional
- Different sql queries count indicator on the main page [closed]
- Convert a WP Query into a simpler SQL query to fetch only COUNT of posts
- WordPress query very slow on +/- 300k DB entries and 7 INNER JOIN
- Use meta query only 3 or more results?
- Search results stuck on page 1
- Use value from meta key array for use in WP_Query