GTIN/EAN

#79134
  • Resolved Radu Bogdan
    Rank Math free

    I’ve installed (as recommended) the “Product GTIN (EAN, UPC, ISBN) for WooCommerce” (by Emanuela Castorina). It’s all good, I can see the plugin settings, it’s also displayed within every product’s details page when I edit one, so I can just copy/paste the SKU to the EAN/GTIN field. However, I’m still getting the error in Search Console (GTIN missing), so I guess I’m missing some kind of small script in my functions.php (or elsewhere).
    Note: I am only using External/Affiliate product type of products for the time being.

    Can you please point me into the right direction on how to achieve this? Thank you for your time.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Nothing to worry, found the solution myself. Here is the code:

    //Add EAN to Rich Snippet
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    	global $product;
    	$entity['gtin8'] = $product->get_meta( '_wpm_gtin_code' );
    	return $entity;
    });

    Looks like Google only appreciates the name “gtin8” in the snippet. He ignored it when I wrote “gtin”

    • This reply was modified 4 years, 2 months ago by Radu Bogdan.
    Alberto
    Rank Math business

    Hello,

    Those are good news! Then, do you have any other questions? Or do you want us to close this thread? In any case, we will be here if you have any other questions or issues in the future.

    Looking forward to help you.

    All good Alberto, you can close it.
    P.S. Keep it handy for others having the same issue, it will save them time :)))

    Hello,

    Thank you a lot for the information.

    We are glad your issue is now resolved. If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

    Will gladly do, Michael, just bear in mind I’ve solved the issue myself, just posted it for others to see the resolve 🙂

    Hello,

    We are thankful for that.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘GTIN/EAN’ is closed to new replies.