use caching plugins, that is why they exist – to offload work from the DB.
If you don’t want to do full page caching and you know that the resulting HTML do not change much you can use transients to store the result for something like an hour before recalculating it.
Related Posts:
- Query posts only with featured image
- In loop: posts have thumbnail AND other variables
- post thumb nail
- Trying to check and see if a post has a featured image outside of the main loop
- Query sticky posts with thumbnails
- Retrieve featured image (thumbnail) url from multiple posts with one query
- Get image of latest post from taxonomies/categories
- Multiple instances of Featured Image Query
- post thumbnail not showing up with shortcode
- How WordPress attaches its Featured Images with posts?
- getting post thumbnail within loop causes an error
- WP_Query condition affects posts_per_page count
- Site not getting correct featured image from my query
- Retrieve posts using thumbnail id as meta key
- WP Query – Post Thumbnail
- How can I check for a thumbnail in WordPress?
- how would i change post->ID to work correctly when querying pages?
- How to display the featured image for each post?
- Query posts only without featured image
- Featured images loop for Orbit Slider
- how to put thumbnail below category’s title?
- WP_Query how to add a thumbnail to the first post from the last 5 posts?
- Featured Image as Background with Offset
- Trying to use “Medium” featured image for custom post type on home page
- wp_get_attachment_image not to get the post_thumbnaill
- Featured image not showing on page
- Display First posts without the default featured image
- Display only posts with thumbnails
- WordPress get_posts function, 1300 lines long
- Exclude a category if post is only in that category using wp_Query
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- Use of caller_ get_ posts
- Tax_query terms ID’s using variable
- Pagination custom query
- WP_Query and name__in
- Order posts by tags count?
- Querying Multiple Custom Taxonomy Terms
- Unable to combine “search value” and “tax_query” using WP_Query
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- WP_Query search for whole words
- WP_QUERY returns empty set when fired from a WP-CRON scheduled event
- Interupting the loop with extra divs to display data, and how to get it to work responsively
- WP_Query, tax_query and term_meta: How to?
- How do I reset this wp_list_categories query?
- How to pass many ids in post__in?
- Query with a meta value inside a given range
- Pagination of a WP_Query Loop in a child-page page template
- Add condition of user capability in WP_query
- How do I run through a WordPress loop called from a filter function?
- How do I get the title of a category in a custom loop?
- Is it a good idea to improve meta query performance by adding tax query?
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- How to display user order by role
- WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?
- hide custom post types with specific meta key ON admin backend
- Orderby listing issue
- Current post in AJAX call is always zero
- Multiple filter conditions for WP_Query
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- WP_query : Force last posts number over Reading Settings
- Order by most used tag
- How to display the number of posts in a category using WP Query
- how can I get seperate the HTML in the_content(); output?
- Is wp_reset_postdata always necessary?
- wp_query: implicit paging? I get less posts that I should
- Specific html within wordpress loop
- WP Query Meta Value – How To Identify Specific, Unique Values?
- Get user first name from custom endpoint
- Shortcode Not Working in Slider When Added To Post Title
- Displaying pages on an archive page
- Multiple pagename WP Query
- How I can repeat 2 HTML templates in a WordPress Query?
- Loop categories by recent post
- Meta query with compare by more than 2 fields
- Why doesn’t my WP Meta Query return any results?
- How to build the WP_Query using the code?
- How go give $value to wp_query
- How to make the ‘request’ filter work?
- Related categories order posts by category
- Why pagination is not working with tax_query param?
- Finding post ID dynamically on click
- paginate_links method doesn’t show second page of my custom wp_query
- Wp_Query Post per page not working?
- Order Element By Custom Field in WordPress
- ACF Post Object meta-query by title not ID
- Case insensitive ORDERBY in wpquery
- Sorting with meta_query and multiple, optional meta keys
- getting posts by tags
- WP_Query & Duplicate entries
- Query child posts with tax query on parents
- From admin edit user page query either the user_nicename or username field value of the user profile being edited or viewed
- Calculating efficiently on large amount of data generated by wp_query
- Include post_status check within $wpdb query
- Return on a quest all these meta_value
- Complicated WP_Query
- Custom query to show posts
- Taxonomy related query not working
- error with $query->have_posts()
- Multiple Orderby is not working right
- Is there another way to retrieve a post_id from post_meta other than a SQL query?