<p>You can use the <code>level()</code> parameter (<a href="https://craftcms.com/docs/3.x/entries.html#level" rel="nofollow noreferrer">docs</a>) on your query:</p>
<pre class="lang-twig prettyprint-override"><code>{% set entries = craft.entries()
    .section('yourSectionHandle')
    .level(1)
    .all() %}
</code></pre>

CC BY-SA 4.0
2021-09-16T06:30:31.887Z
Thank you so much @Oli. I really appreciate your help. Thank you again.
sam
CC BY-SA 4.0
2021-09-16T02:07:26.613Z
2021-09-16T02:07:26.613Z
Oli
<p>Suppose I have a structure Section with Entries like this:</p>
<ul>
<li>Parent A
<ul>
<li>Child X</li>
</ul>
</li>
<li>Parent B</li>
<li>Parent C
<ul>
<li>Child Y</li>
</ul>
</li>
</ul>
<p>How would I return this list of Entries?</p>
<pre><code>[Parent A, Parent B, Parent C]
</code></pre>

<craft3><structure><elementquery>
Is there a way to query for structure Entries that have no Parent?
# Is there a way to query for structure Entries that have no Parent?

(Asked by: username_0 on 2021-09-15)

Suppose I have a structure Section with Entries like this:

Parent A

Child X


Parent B
Parent C

Child Y



How would I return this list of Entries?
[Parent A, Parent B, Parent C]

**Tags:** craft3, structure, elementquery


---

## 1 answers

### Answer by username_1 on 2021-09-16. Score: 2

You can use the level() parameter (docs) on your query:
{% set entries = craft.entries()
    .section('yourSectionHandle')
    .level(1)
    .all() %}

> **Comments:**
> **username_0**: Thank you so much @username_1. I really appreciate your help. Thank you again.  

---

