Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-18T22:34:53.697Z
Answers.Text: 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.
Answers.UserDisplayName: kmgdev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-17T21:29:13.627Z
Answers.LastActivityDate: 2019-09-17T21:29:13.627Z
Answers.UserDisplayName: JSosa
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-17T09:11:34.160Z
Comments.Text: Are you caching and have you tried clearing your cache? Are you also able to edit your question to show how seoAuthor is set.
Comments.UserDisplayName: dmatthams
Tags: <entries><database><field><variable>
Title: Field removed from entry layout is still displaying
ThreadText: # 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:
  
  ```
  <meta name="author" content="{% if seoAuthor is defined %}{{seoAuthor}}{% else %}{{globalSeo.seoAuthor}}{% endif %}">
  
  ```
  
  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.  
  
  ---
  
  