• Resolved alx359

    (@alx359)


    Great plugin. I’m using it together with facebook-for-woocommerce, hooking mandatory Pixel microdata tags still missing into the single-product page.

    The issue I have is with SEOPress. Many of the COG defaults are getting rendered and becoming duplicates of others already loaded earlier.

    Wish the ability to switch COG defaults off altogether instead of going through SEOPress (or make COG adaptiveness more effective by perhaps tweaking its priority), as my current use-case is just adding the tags I need via complete_open_graph_all_data. How to do that?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Alex MacArthur

    (@alexmacarthur)

    Hi! Just to be clear, you’re looking to disable whatever COG generates by default, and only register tags by using the complete_open_graph_all_data filter?

    Thread Starter alx359

    (@alx359)

    Yes, Alex.

    Otherwise, if also feasible, suggestions of how to fine-tune the generation for COG to better adapt to what SEO Press already generates, and don’t do it twice.

    Thanks!

    Thread Starter alx359

    (@alx359)

    Seems I figured out the first case: just resetting the array before populating the new tags.

    add_filter('complete_open_graph_all_data', 'add_fb_product_metadata');
    function add_fb_product_metadata( $data ) {
    		
      // disable COG defaults
      $data = array();
    
      // mandatory tags
      $data['product:brand'] = ['attribute' => 'property', 'value' => 'my brand'];
      $data['product:availability'] = ['attribute' => 'property', 'value' => 'available for order'];
      $data['product:condition'] = ['attribute' => 'property', 'value' => 'new'];
      $data['product:price:currency'] = ['attribute' => 'property', 'value' => 'EUR'];
      $data['product:price:amount'] = ['attribute' => 'property', 'value' => '5.3'];
    
      return $data;
    }
    Thread Starter alx359

    (@alx359)

    After further tinkering, the obvious finally came to me: put the few tags I need in wp_head. Thanks to COG though was able to comprehend the task at hand better and overcome the ‘mental block’ of new stuff I wasn’t familiar with. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘disable default generation?’ is closed to new replies.