---
title: "How to Use the Query Loop Block in WordPress (Step-by-Step, 2026)"
url: https://nexterwp.com/blog/how-to-use-the-query-loop-block/
date: 2026-07-16
modified: 2026-07-16
author: "Aditya Sharma"
description: "How to use the Query Loop block in WordPress: choose a pattern or start blank, switch to a custom query, filter posts, and build list or grid layouts."
image: https://nexterwp.com/wp-content/uploads/2026/07/8jva5b-1024x538.jpg
word_count: 2186
---

# How to Use the Query Loop Block in WordPress (Step-by-Step, 2026)

#### Key Takeaways
- The Query Loop block displays a dynamic list of posts based on rules you set. WordPress describes it as a way to build a PHP loop without the code.- When you add it, you either Choose a pattern from your theme or Start blank, then build the layout from nested blocks like Post Template, Title, Featured Image, Excerpt, and Pagination.- The setting most people miss: change Query type from Default to Custom, or the post type, filter, and order options never appear.- You control which posts show using Post type, Order by, Sticky posts, Display options such as Items per Page and Offset, and Filters for taxonomies, authors, keyword, and format.- For layouts the core block cannot do, such as carousels, masonry, or a category filter, a free block library like Nexter Blocks adds Post display blocks that read the same content.

 

A client once asked me for something that sounded simple. They wanted a page that showed only their case studies, newest first, in a three-column grid, and they did not want to install another plugin to do it. A year earlier I would have reached for a page builder or a bit of custom code. This time I opened the block editor, added one block, changed one setting, and the grid was on the page in about five minutes. That block was the Query Loop, and it is one of the most useful tools in WordPress that most people never touch because it looks intimidating at first.

This guide walks through the Query Loop block from scratch: what it does, how to add it, how its nested parts fit together, and the one setting that unlocks all the filtering options. Every detail here matches the current WordPress documentation, updated for WordPress 7.0. By the end you will be able to build a filtered, paginated list of any content on your site.

Table of Contents

## What Is the Query Loop Block?

The Query Loop block displays posts based on parameters you choose. The WordPress documentation calls it an advanced block that works "like a PHP loop without the code," and describes it as a more powerful version of the Latest Posts block. If you have ever seen a theme show a grid of recent articles or a list of related posts, that is the kind of output the Query Loop produces, except you control it yourself from the editor.

A query, in this context, is just a request to the database: show me these posts, in this order, filtered this way. The block runs that request and repeats a layout you design for every result it finds. Because it reads content dynamically, a Query Loop you build today keeps updating as you publish new posts, so you set it up once and it stays current. This is a core part of how modern block themes work, and it fits naturally with [the WordPress block editor known as Gutenberg](https://nexterwp.com/blog/what-is-gutenberg/).

![WordPress.org documentation page explaining the Query Loop block](https://nexterwp.com/wp-content/uploads/2026/07/9A0A9oMcqVrS65gkY-sA5rJ7oCGIld-QXG3sP-zMOutmplaY6zFxNA5ou9AyiezLLEkbzn_j19c-YhK6TNYj7A-scaled.png)The Query Loop block is documented in the official WordPress editor guide, updated for WordPress 7.0.

## How to Add the Query Loop Block

To add the block, click the (+) icon to open the block inserter, search for Query Loop, and click it. There is a faster route too: type `/query loop` in the editor and press Enter. As soon as the block lands on the page, WordPress gives you two starting options.

- **Choose.** This lets you pick from patterns in your theme that already use the Query Loop. Each pattern comes with its own combination of nested post blocks, so what you start with depends on the pattern you select. This is the quickest way to get a good-looking layout.- **Start blank.** This lets you pick a bare variation of the Query Loop and build it up yourself. Each variation begins with a different set of nested post blocks, and you add or remove blocks from there.

If you are new to the block, start with Choose so you can see a working layout, then adjust it. Once you are comfortable, Start blank gives you full control from the first block.

## The Anatomy of a Query Loop Block

The Query Loop is not a single block. It is a container made of several nested parts, and each part controls a different piece of the display. The easiest way to see this structure is to open [the block editor](https://nexterwp.com/blog/what-is-gutenberg/) List View after adding the block. According to the WordPress documentation, a Query Loop is built from these parts:

- **Query Loop.** The outer container. Its settings control which posts appear, including post type, filters, order, and how many items show.- **Post Template.** The container inside the loop that holds the layout repeated for every post. Whatever blocks you place here, such as Title, Featured Image, Excerpt, or Date, are drawn once for each result.- **Pagination (optional).** Lets visitors move through multiple pages of results with previous and next links or page numbers. You can remove it and add it back later.- **No Results (optional).** A message shown only when the query finds no posts. WordPress recommends keeping it so the area is not blank for visitors when nothing matches.

The Post Template is the part worth understanding first. Any change you make inside it repeats for every post. If you move the Featured Image above the title in one item, it moves for all of them. Common blocks to place inside the Post Template include the Title, Excerpt, Date, Featured Image, Read More, Author, Categories, and Tags blocks.

![WordPress block editor where the Query Loop and its nested blocks are built](https://nexterwp.com/wp-content/uploads/2026/06/0bcPfLHTbaZPA_mFI70eLsTCezQmBgSo44b5Z37nTb_KJGy71NBR40Z9TK7KwqVsRURC6JzJo4xBROe4vz5n5Q-scaled.png)Open List View in the block editor to see the nested parts that make up a Query Loop.

***Also Read:** [What Is a Custom Post Type in WordPress](https://nexterwp.com/blog/what-is-a-custom-post-type-in-wordpress/) since the Query Loop is one of the main ways to display custom post types on the front end.*

## Default vs Custom Query Type: The Setting Everyone Misses

Here is the moment that confuses almost everyone the first time. You add a Query Loop, open its settings, and look for the option to pick a post type or add a filter, and none of it is there. That is not a bug. It is the Query type setting, and by default it is set to the wrong mode for a custom list.

The Query type has two values, and the WordPress documentation explains them clearly:

- **Default.** The block lets the template it sits in decide which posts appear. This is set automatically and is useful inside theme templates like a blog archive.- **Custom.** The block shows a list of posts you define yourself. Only when you switch to Custom do the Post type, Order by, Sticky posts, Display options, and Filters controls appear.

So the rule is simple. To build your own list of posts on a page, select the Query Loop block and change Query type from Default to Custom in the block settings sidebar. The documentation says it plainly: if you do not see options for choosing a post type or filter settings, change Query type from Default to Custom. Do that first, and everything else in this guide becomes available.

## How to Control Which Posts Appear

With Query type set to Custom, the Settings panel gives you real control over the query. Here is what each control does, straight from the WordPress documentation.

### Post type

WordPress groups content into collections called post types. By default you will see Posts and Pages, but plugins and custom post types add more. If your site runs WooCommerce, for example, Products shows up here. Choose the post type you want the block to list.

### Order by

This sets the order of your results. The current options are Newest to Oldest, which is the default, Oldest to Newest, Alphabetical A to Z, and Alphabetical Z to A.

### Sticky posts

Sticky posts are the ones you pin to the top of your blog. In the Query Loop you can Include them, which is the default, Exclude them, Ignore them so their sticky status is ignored, or show Only sticky posts.

### Display options

Some of these are hidden until you open the Display options menu, the three dots next to the Display label. They include Items per Page, which sets how many posts show, Offset, which skips a set number of posts before the list starts, and Max page to show, which limits how many pages of results exist.

### Filters

Filters narrow the list to exactly the posts you want. They stay hidden until you add one, using the Filter options (+) button. The documentation lists these filters:

- **Taxonomies.** Show or hide posts by categories and tags. You can also exclude posts by category or tag.- **Authors.** Show posts by one or more selected authors.- **Keyword.** Show posts that match one or more keywords. If you enter more than one, results must match every keyword, not just one of them.- **Format.** Show posts assigned to a specific post format such as Gallery, Image, Quote, Video, or Audio, if your theme supports formats.

The available filters can change depending on the post type, theme, and plugins on your site. On a WooCommerce store, for instance, you may see product category filters here too. If your post type is set to Page, you also get a Parents filter to show pages nested under a chosen parent.

## List vs Grid, and Styling Each Post

Once your query is right, the look is controlled by the nested blocks, not the Query Loop itself. In fact the documentation notes that the Query Loop block does not include style settings like color and spacing. You style the pieces inside it.

To switch between a stacked list and a multi-column grid, select the Post Template block and use its toolbar to choose List View or Grid View. To make posts clickable, which does not always happen automatically, select the Title block and turn on Make title a link, then select the Featured Image block and turn on Link to Post. Because these blocks live inside the Post Template, the setting applies to every post in the loop. From there you can add layout blocks like Group, Columns, or Row inside the Post Template to build a more custom repeated card, for example a featured image on the left with the title, date, and excerpt on the right.

***Also Read:** [What Is Gutenberg](https://nexterwp.com/blog/what-is-gutenberg/) for a beginner-friendly tour of the block editor if the nested-block workflow is new to you.*

## When to Reach for Nexter Blocks Instead

The core Query Loop is genuinely capable, but it has a ceiling. It is built from nested blocks, so a custom card layout takes patience, and it does not offer designed patterns like carousels, masonry, or a front-end category filter that visitors can click. When you want those without wrestling with templates, a free block library fills the gap.

[Nexter Blocks](https://nexterwp.com/nexter-blocks/) is a free toolkit on WordPress.org with 90+ Gutenberg blocks, and it includes a group of Post and CPT display blocks built for exactly this job: Post Grid, Post Carousel, Post Masonry, Post Metro, plus a Post Category Filter, Post Load More, and Taxonomy Listing. They read the same post-type content the Query Loop does, including custom post types, but give you ready-made layouts and filtering controls that would take much longer to assemble by hand. If your goal is a designed, interactive posts section rather than a plain list, these blocks are the faster route.

![Nexter Blocks free WordPress plugin with Post Grid, Carousel, and Masonry blocks](https://nexterwp.com/wp-content/uploads/2026/07/0fxMiFNXXHYIcnfrtpuVOHno_fZWb8b6uXMYmELS8OQq97yc6yU3AdPuF0asIAL3RDlRLq2NE0XhnkjQ6jEw6Q-scaled.png)Nexter Blocks adds Post Grid, Carousel, and Masonry blocks for layouts the core Query Loop cannot produce on its own.

## Common Query Loop Mistakes to Avoid

- **Settings are missing.** If Post type, Order by, or Filters do not show, the Query type is still on Default. Switch it to Custom and they appear.- **Titles and images are not clickable.** They do not always link on their own. Turn on Make title a link on the Title block and Link to Post on the Featured Image block.- **You styled the wrong block.** The Query Loop container has no color or spacing settings. Select the Post Template or an inner block like Title or Excerpt to change styles.- **No fallback message.** Deleting the No Results block leaves a blank space when a query returns nothing. Keep it and write a short message.- **Only one keyword expected.** The Keyword filter treats multiple words as an all-must-match rule, so it cannot show posts that match just one of several keywords.

## Wrapping Up

The Query Loop block looks complicated because it is really several blocks working together, but the workflow is short once you know the path. Add the block, choose a pattern or start blank, switch the Query type to Custom, set your post type and filters, then style the nested blocks and pick a list or grid layout. That covers the large majority of what people need it for, all without touching code. And when you hit the point where the core block cannot give you the layout you are picturing, the Post blocks in Nexter Blocks are a free way to get there faster.

## Suggested Reading

- [What Is Gutenberg? The WordPress Block Editor Explained](https://nexterwp.com/blog/what-is-gutenberg/)- [What Is a Custom Post Type in WordPress?](https://nexterwp.com/blog/what-is-a-custom-post-type-in-wordpress/)- [Best Gutenberg Plugins for WordPress](https://nexterwp.com/blog/best-gutenberg-plugins/)- [Bricks Builder vs Gutenberg: Key Differences](https://nexterwp.com/blog/bricks-builder-vs-gutenberg/)- [How to Add Custom Fields in Gutenberg](https://nexterwp.com/blog/how-to-add-custom-fields-in-gutenberg/)

#### Stay updated with Helpful WordPress Tips, Insider Insights, and Exclusive Updates – Subscribe now to keep up with Everything Happening on WordPress!

Subscribe