title: How to get product specific meta data in WooCommerce
body: <p>I'm using WooCommerce and want to get the meta keys specifically for the product e.g. price, color and so on...
  But the problem is that I don't want to get all meta keys but only the ones needed. For example I don't need <code>_edit_last</code>, <code>_edit_lock</code>, <code>_wc_review_count</code> ... and just need <code>price</code> and <code>color</code> (as an example). If it was a web page that wasn't important but I don't want to show them on web page but I want to send them as json to somewhere else. So the data should be filtered. BTW it is in plugin and I want to share it with others so I can't/shouldn't access their WooCommerce api.</p>
  <p>my code that gets all meta keys (but I want only some of them):</p>
  <pre><code>$attributes = get_post_meta($product-&gt;get_id());
  foreach($attributes as $key =&gt; $value) {
      $result['products'][$p]['attributes'][$key] = $value[0];
  }
  </code></pre>
  <p>and the result of code above is:</p>
  <pre><code>[attributes] =&gt; Array
  (
      [_edit_last] =&gt; 1
      [_edit_lock] =&gt; 1594817821:1
      .
      .
      .
  )
  </code></pre>
  <p>but I want:</p>
  <pre><code>[attributes] =&gt; Array
  (
      [price] =&gt; 1000
      [color] =&gt; 'red'
      .
      .
      .
  )
  </code></pre>