Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
Could you please share two example product links, one with rich snippets enabled and one not so that we can investigate this issue further?
Looking forward to helping you. Thank you.
Hi,
We are extremely sorry about this and for the late response. Your reply was stuck in spam due to the use of links in your reply.
Please use this code in your theme’s functions.php file:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
$entity['gtin13'] = str_replace('-', '',$entity['gtin']);
return $entity;
});
That will use your GTIN field as the GTIN13 field.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
thanks for the code.
I am afraid it is not working. do i need to put it in a certain section of functions.php? (“before … after…”) ?
or maybe the problem is that the code takes EAN value from WooCommerce attributes instead of the GTIN plugin custom field?
still getting error : “This product is missing a global identifier (e.g. isbn, mpn or gtin8). Please see documentation for valid identifiers.”
Hello,
Thanks for getting back to us.
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hi,
Can you please try this:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
$entity['gtin8'] = str_replace('-', '',$entity['gtin']);
return $entity;
});
If it doesn’t work, please use s******@r***********
to share the logins.
Thank you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
info updated. I have added the revised snippet but still nothing. Maybe I have pasted it in the wrong area ?
Hi,
I am sorry but the login link doesn’t work.
Can you please verify if that is the correct one?
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
Thank you for contacting Rank Math today.
I have replaced the previous code with the following which seems to do the trick:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
global $product;
$entity['gtin13'] = $product->get_meta( '_wpm_gtin_code' );
return $entity;
});
Looking forward to helping you. Thank you.
Many thanks! ticket may be closed
Hi there,
I am glad that this is now resolved 🙂
Feel free to contact us for any other questions, comments or suggestions.
Thank you.