# NO BUG: ACF Relationship Query loop showing Draft content

**URL:** <https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772>\
**Category:** Bugs\
**Tags:** v1-12-1\
**Created:** [January 29, 2025, 12:34pm UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772 "2025-01-29T12:34:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tootinghorns](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/tootinghorns/32/9366_2.png) [@Tootinghorns](https://forum.bricksbuilder.io/u/Tootinghorns)\
**Post date:** [January 29, 2025, 12:34pm UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/1 "2025-01-29T12:34:47Z")

</div>

ACF Relationship Query loop showing draft content - no way to filter by published status.

The field is working in all other respects, just no options in the “type \> ACF Relationship” input to specify published only status.  
Not sure if this is a bug or a feature request - but i as it currently is, it makes it problematic to use. I can’t see why you’d ever want to loop draft posts…  
eg. also makes any other conditional display elements think there is post content when in fact they are draft status.  
I can add a published status conditions on the loop element (as @timmse describes below) , but i want to hide a section when there is no content , not just the looped element.

 ![Screenshot 2025-01-29 at 12.28.37](https://forum.bricksbuilder.io/uploads/default/original/3X/8/8/882848636f278dfd284dda0d857f13781140ad7c.jpeg)

---

<div class="post-metadata">

**Author:** ![Tootinghorns](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/tootinghorns/32/9366_2.png) [@Tootinghorns](https://forum.bricksbuilder.io/u/Tootinghorns)\
**Post date:** [January 31, 2025, 11:27am UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/2 "2025-01-31T11:27:34Z")

</div>

Hi @timmse - should i just contact support directly about this?

The query for related “current jobs” shows a post thats has draft status - so i’ll be getting…

 ![Screenshot 2025-01-31 at 11.32.25](https://forum.bricksbuilder.io/uploads/default/original/3X/3/8/38ab040ea73fa35ccef624b98c1e5ea77025d3bb.jpeg)

…when users click the link.

Here is the example:

> **[The Great North Wood - Station to Station Business Directory](https://stationtostation.london/business/the-great-north-wood/)**
>
> Roomy gastropub with exposed brick walls & a beer garden offering classic dishes with vegan options

Best  
Pete

---

<div class="post-metadata">

**Author:** ![sinanisler](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/sinanisler/32/34468_2.png) [@sinanisler](https://forum.bricksbuilder.io/u/sinanisler)\
**Post date:** [January 31, 2025, 11:42am UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/3 "2025-01-31T11:42:22Z")

</div>

there is a high probability this is related to your acf setup or acf array.

bricks loop just gets the loop arguments and runs it as wp\_query class thats all it does really.

> **[WP\_Query – Class | Developer.WordPress.org](https://developer.wordpress.org/reference/classes/wp_query/)**
>
> The WordPress Query class.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [January 31, 2025, 12:47pm UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/4 "2025-01-31T12:47:36Z")

</div>

Hi Pete,  
If you think you have found a bug, please post your report with reproducible steps in the “bugs” category and not in “how to” 🙂

It seems as if the “Filter by post status” setting of the ACF relationship field is currently not supported, but you can use a “post status” condition on your loop item, which works fine as far as I can see.

 ![CleanShot 2025-01-31 at 13.47.07@2x](https://forum.bricksbuilder.io/uploads/default/original/3X/9/5/957b7dd52983ea63d073d86d35b13602f3c4f6ef.png)

---

<div class="post-metadata">

**Author:** ![Tootinghorns](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/tootinghorns/32/9366_2.png) [@Tootinghorns](https://forum.bricksbuilder.io/u/Tootinghorns)\
**Post date:** [January 31, 2025, 2:07pm UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/5 "2025-01-31T14:07:47Z")

</div>

Whoops - sorry @timmse i changed the category

I do already have a condition set up to hide the section if there is no ACF relationship content which works . - but not when there is a related draft post - just also treating Drafts as “Not Empty”

 ![Screenshot 2025-01-31 at 14.05.59](https://forum.bricksbuilder.io/uploads/default/original/3X/4/6/46dc3ede90fb587519bb44a8568b31a5d56d8908.jpeg)

Setting this condition on the Filtered block works but means i still see and empty section and title

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [February 3, 2025, 9:28am UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/6 "2025-02-03T09:28:14Z")

</div>

Hi Pete,  
Add a condition to your loop item that checks the post status (see my previous screenshot).

---

<div class="post-metadata">

**Author:** ![Tootinghorns](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/tootinghorns/32/9366_2.png) [@Tootinghorns](https://forum.bricksbuilder.io/u/Tootinghorns)\
**Post date:** [February 6, 2025, 8:40am UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/7 "2025-02-06T08:40:04Z")

</div>

Hi @timmse , that doesn’t help with being able to add a condition to hide the section if there is no published content i’m afraid, only the looped item.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [February 6, 2025, 11:58am UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/8 "2025-02-06T11:58:14Z")

</div>

Hi Pete,  
All right, time to try some magic 🪄

1. Setup your loop like this (search for your relationship field in “include”):  

2. Now you can use {query\_results\_count:xxx} (replace xxx with the Bricks ID of the loop) in a condition on the section. If there are only draft posts, the results count will be 0, and the section won’t show.

---

<div class="post-metadata">

**Author:** ![Tootinghorns](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/tootinghorns/32/9366_2.png) [@Tootinghorns](https://forum.bricksbuilder.io/u/Tootinghorns)\
**Post date:** [February 6, 2025, 2:36pm UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/9 "2025-02-06T14:36:18Z")

</div>

You are a wizzard @timmse - as usual you always go the extra mile, thanks so much, this will help with lots of other stuff too!

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [February 6, 2025, 4:15pm UTC](https://forum.bricksbuilder.io/t/no-bug-acf-relationship-query-loop-showing-draft-content/29772/10 "2025-02-06T16:15:31Z")

</div>

… actually, after some trial and error, I took a look at the Academy and found what I was looking for 🧙

> **[Query Loop](https://academy.bricksbuilder.io/article/query-loop/#filter-acf-relationship-by-post-type)**
>
> The Query Loop builder is available for all layout elements, Accordion, and Slider elements. It can also be enabled for the Accordion (Nestable), Tabs (Nestable), and Slider (Nestable). It lets you query your database (according to your query...
