<p>Try adding this to the beginning of your case study entry template:</p>

<pre><code>{% if entry is not defined %}
    {% exit 404 %}
{% endif %}
</code></pre>

<p>Do you have a route set up for your case studies? </p>

<p>I've got routing set up on a client site that has the route <code>/case-studies/*</code> pointing to template <code>/_cs/entry.twig</code></p>

<p>That makes it try to the load the template, whether or not there's an entry at all. So it needs the extra bit to check if the entry is real/published.</p>

CC BY-SA 4.0
2020-01-13T17:53:46.880Z
2020-01-13T17:53:46.880Z
SamC
<p>Entry is disabled
<a href="https://monosnap.com/file/l8tgvr5Fxpw0OXPbpcwiI57JmZjL51" rel="nofollow noreferrer">https://monosnap.com/file/l8tgvr5Fxpw0OXPbpcwiI57JmZjL51</a></p>

<p>But despite that on its address I see its template loaded only without entry data.</p>

<p>I expected to see 'Page Not Found'.</p>

<entries><404-page>
Craft CMS shows disabled entry page
# Craft CMS shows disabled entry page

(Asked by: username_0 on 2020-01-13)

Entry is disabled
<https://monosnap.com/file/l8tgvr5Fxpw0OXPbpcwiI57JmZjL51>

But despite that on its address I see its template loaded only without entry data.

I expected to see 'Page Not Found'.

**Tags:** entries, 404-page


---

## 1 answers

### Answer by username_1 on 2020-01-13. Score: 1

Try adding this to the beginning of your case study entry template:
{% if entry is not defined %}
    {% exit 404 %}
{% endif %}

Do you have a route set up for your case studies? 
I've got routing set up on a client site that has the route /case-studies/* pointing to template /_cs/entry.twig
That makes it try to the load the template, whether or not there's an entry at all. So it needs the extra bit to check if the entry is real/published.


---

