<p><code>status('disabled')</code> should do the trick for you </p>

<pre><code>{% set entries = craft.entries()
    .section('profileEntry')
    .status('disabled')
    .all() %}
</code></pre>

CC BY-SA 4.0
2019-02-18T12:10:26.513Z
Thanks it kind of does what I asked but doesn't quite do what I needed
Andrew
CC BY-SA 4.0
2019-02-18T15:19:12.787Z
@Andrew sorry about that, what exactly do you need it do do? Not sure I follow completely...
Jalen Davenport
CC BY-SA 4.0
2019-02-18T16:25:56.513Z
Not your fault, I started a new question to make it more explicit https://craftcms.stackexchange.com/questions/29556/display-notification-if-no-entries-exist-for-status-criteria-and-logged-in-user
Andrew
CC BY-SA 4.0
2019-02-18T23:02:20.593Z
Gotcha; Robin's answer on that question is perfect 
Jalen Davenport
CC BY-SA 4.0
2019-02-15T17:54:26.260Z
2019-02-15T17:54:26.260Z
Jalen Davenport
<p>I want to test for the existence of disabled entries for the logged in author in a section. So far I have this:</p>

<pre><code>{% set profileEntryQuery = craft.entries()
    .section('profileEntry')
    .status(null) %}

{% set entries = profileEntryQuery.all() %}    

{% for entry in entries %}

  {% if currentUser.id == entry.author.id %}
</code></pre>

<p>But the status(null) checks for disabled <em>and</em> enabled entries. How can I get a positive if only disabled entries exist but not enabled.</p>

<entries><status>
Test for entry status
# Test for entry status

(Asked by: username_0 on 2019-02-15)

I want to test for the existence of disabled entries for the logged in author in a section. So far I have this:
{% set profileEntryQuery = craft.entries()
    .section('profileEntry')
    .status(null) %}

{% set entries = profileEntryQuery.all() %}    

{% for entry in entries %}

  {% if currentUser.id == entry.author.id %}

But the status(null) checks for disabled and enabled entries. How can I get a positive if only disabled entries exist but not enabled.

**Tags:** entries, status

---

## 1 answers

### Answer by username_1 on 2019-02-15. Score: 3 | Accepted answer

status('disabled') should do the trick for you 
{% set entries = craft.entries()
    .section('profileEntry')
    .status('disabled')
    .all() %}

> **Comments:**
> **username_0**: Thanks it kind of does what I asked but doesn't quite do what I needed  
> **username_1**: @Andrew sorry about that, what exactly do you need it do do? Not sure I follow completely...  
> **username_0**: Not your fault, I started a new question to make it more explicit https://craftcms.stackexchange.com/questions/29556/display-notification-if-no-entries-exist-for-status-criteria-and-logged-in-user  
> **username_1**: Gotcha; Robin's answer on that question is perfect   

---

