title: How to check if custom field exist even if meta value is empty in WordPress
body: <p>I have a pretty working condition to check if custom field exist, this is the line:</p>
  
  <pre><code>if (((get_post_meta($post-&gt;ID, $my_metakey, TRUE))=='')
  </code></pre>
  
  <p>However as you have noticed, it will only be effective to check for meta key if its value is set to empty.</p>
  
  <p>I would like to know how to check if the custom field name/meta key already exist in the database even if I set the meta value to empty or blank at defaults.</p>
  
  <p>Is there an efficient approach of doing this with WordPress?
  Thanks for any tip.</p>
  
  <p>Update: Also this one won't work:</p>
  
  <pre><code>&lt;?php if (strlen(get_post_meta($post-&gt;ID, $metakey, true)) &gt; 0) : ?&gt;
  </code></pre>
  
  <p>As it is similar to checking if the custom field is empty.</p>