0

I'm using the WooCommerce plugin and I can't figure how to remove the meta price information. I'm trying to remove the price info from displaying when a product gets shared on Facebook and/or Twitter. The website does have Yoast SEO plugin also installed but I'm not seeing anyway to remove it. I have no price showed on the product page.

Does anyone know how to modify meta data information? I've found the meta customer information. Just not product.

UPDATE

Basically I want to remove this:

 <!-- Misc. tags -->
 <meta name="twitter:label1" content="Price"/>
 <meta name="twitter:data1" content="50 USD"/>
 <meta property="product:price:amount" content="50"/>
 <meta property="product:price:currency" content="USD"/>
 <meta property="product:availability" content="instock"/>
 <!-- is_singular | is_product -->

You can only see it when you do a view source. The Price gets shown whenever you copy and paste the link in any social media platform.

LAST UPDATE It was the Open Graph Facebook plugin. View Kashif Rafique response below in the comments.

  • Better add some code ..less info – Latheesh V M Villa Oct 26 '18 at 19:07
  • @LatheeshVMVilla I really wasn't sure what to add code wise because I can't see what code is calling it. View the updated question for the code I want to remove that gets put in the front end. – cbloss793 Oct 26 '18 at 19:38
  • how you are sharing? which page? woocommerce does not comes with share product feature..may be you can use javascript to remove it. – Latheesh V M Villa Oct 26 '18 at 19:42
  • If you just copy and paste the URL for a variation product page in any social media site, it pulls the price from the meta description. We do have Yoast and WP Bakery Page Builder installed, but I tried to do a search in those plugin folders and never found anything regarding Woocommerce. Qcode is installed that came with the theme that had some Woocomerce customization but it looks to be just style stuff. – cbloss793 Oct 26 '18 at 19:58
  • got any links to share? – Latheesh V M Villa Oct 27 '18 at 18:33
0

You can try the following filters available in Yoast WordPress SEO:

apply_filters( 'wpseo_twitter_metatag_key', 'name' );
Source: wpseo_twitter_metatag_key

apply_filters( 'wpseo_og_' . $og_property, $content );
Source: wpseo_og_' . $og_property

EDIT - Review after seeing the product URL

Yoast SEO is not generating the Twitter/FB meta tags. Open Graph for Facebook, Google+ and Twitter Card Tags plugin is responsible for rendering these meta tags.

Seems that plugin doesn't allow product level configuration for price. It offers few filters with the meta tags inserting function:

  1. fb_og_disable
  2. fb_og_enabled
  3. fb_og_output

You would like to study the code and extend the plugin as per your need. A simple and easy solution is comment out or remove the responsible code from wonderm00ns-simple-facebook-open-graph-tags/public/class-webdados-fb-open-graph-public.php file, but it is not a recommended and future-safe way.

| improve this answer | |
  • That was a great suggestion! I tried commenting out the returns and it's still in there. – cbloss793 Oct 26 '18 at 21:39
  • 1
    Yoast SEO is not generating the Twitter/FB meta tags. wordpress.org/plugins/… plugin is responsible for this. – Kashif Rafique Oct 29 '18 at 16:09
  • 1
    That was totally it! Found it in public/class-webdados-fb-open-graph-public.php! I'm going to give your answer above the mark so you get the credit. THANKS!!! – cbloss793 Oct 29 '18 at 16:34
  • 1
    @cbloss793 Glad to help you. Also updated my answer. – Kashif Rafique Oct 29 '18 at 16:44
  • 1
    I saw there was no safe way to hide it. I just commented it out for now with the knowledge that it's gonna be overwritten if the plugin gets updated. :( Thanks for the feedback though! – cbloss793 Oct 29 '18 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.