title: Open redirected link in a new tab using custom field in wordpress
body: <p>I have used a custom field called <code>redirect</code> in Woocommerce  product single page and this makes it redirect to a link other than the single product page link. However, I want to open that redirected link in a new tab. My followed solution opens that link in the same window.</p>
  
  <p>The code I followed:</p>
  
  <pre><code>&lt;?php
  global $post; // &lt; -- globalize, just in case
  $field = get_post_meta($post-&gt;ID, 'redirect', true);
  if($field) wp_redirect(clean_url($field), 301);
  get_header();
  ?&gt;
  </code></pre>
  
  <p>Source: <a href="http://www.nathanrice.net/blog/how-to-redirect-a-page-using-custom-fields-in-wordpress/" rel="nofollow">nathanrice.net</a></p>