<p>I figured it out. The problem was that the code that set seoAuthor on every template was still there. So even tho the field was removed from the layout, the db still contains that field, so is able to retrieve it. </p>

<p>The fix was to remove the code that set the variable in the templates, and now works as intended. </p>

<p>One thing that still confuses me is why craft still pulls the data if is not in the layout anymore. </p>

CC BY-SA 4.0
2019-09-18T22:34:53.697Z
Unless you totally delete the field Craft will save whatever content it had previously for that entry in that field. It's technically still available if you call the field in your template, but the field UI doesn't show when you publish or edit an entry.
kmgdev
CC BY-SA 4.0
2019-09-17T21:29:13.627Z
2019-09-17T21:29:13.627Z
JSosa
<p>So I'm setting my meta author tag this way: </p>

<pre><code>&lt;meta name="author" content="{% if seoAuthor is defined %}{{seoAuthor}}{% else %}{{globalSeo.seoAuthor}}{% endif %}"&gt;
</code></pre>

<p>seoAuthor is a field that only appears in some entrie's layout (blog posts). At first the field was on every entry, but I changed it later. </p>

<p>The problem is that the data on the entries that no longer have that field in their layout is still displaying. </p>

<p>So is it possible to only show fields that are currently in the layout of the entry ?</p>

CC BY-SA 4.0
2019-09-17T09:11:34.160Z
Are you caching and have you tried clearing your cache? Are you also able to edit your question to show how seoAuthor is set.
dmatthams
<entries><database><field><variable>
Field removed from entry layout is still displaying
# Field removed from entry layout is still displaying

(Asked by: username_0 on 2019-09-16)

So I'm setting my meta author tag this way: 


seoAuthor is a field that only appears in some entrie's layout (blog posts). At first the field was on every entry, but I changed it later. 
The problem is that the data on the entries that no longer have that field in their layout is still displaying. 
So is it possible to only show fields that are currently in the layout of the entry ?

**Tags:** entries, database, field, variable

> **Comments:**
> **username_1**: Are you caching and have you tried clearing your cache? Are you also able to edit your question to show how seoAuthor is set.  

---

## 1 answers

### Answer by username_0 on 2019-09-17. Score: 1

I figured it out. The problem was that the code that set seoAuthor on every template was still there. So even tho the field was removed from the layout, the db still contains that field, so is able to retrieve it.

The fix was to remove the code that set the variable in the templates, and now works as intended.

One thing that still confuses me is why craft still pulls the data if is not in the layout anymore.

> **Comments:**
> **username_2**: Unless you totally delete the field Craft will save whatever content it had previously for that entry in that field. It's technically still available if you call the field in your template, but the field UI doesn't show when you publish or edit an entry.  

---

