• Google sear console have noticed me that I have invalid GTIN on my product pages. I understand it’s not necessary to fix but I still want to fix it.

    1-2 years ago GSC noticed me about missing GTIN. Then I added a code snippet that solved that problem.

    /** Use SKU as gtin8 in structured data
    */
    add_filter( ‘woocommerce_structured_data_product’,’add_gtin8′,10,2);
    function add_gtin8( $markup, $product ) {
    $markup[‘gtin8’] = str_replace(‘-‘, ”,$markup[‘sku’]);
    return $markup;
    };

    I don’t know why my GTIN is invalid? Can it be because my SKU is both numbers and letters?

    Any idea about how to solve my inavlid GTIN.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @boppar

    Thanks for reaching out!

    I understand that you are having issues with Google Search Console regarding your invalid GTIN. Furthermore, you’ve used the code snippet above to use your SKU as GTIN8 in the structured data.

    One or more of the values that you’ve submitted for the GTIN [gtin] attribute is invalid. This error usually occurs because the value contains characters that aren’t numerals, it has an invalid checksum, or it uses formatting that doesn’t match one of the standard GTIN types.

    You must only use GTIN numbers as they have been assigned by the manufacturer.

    If your product has a barcode, you can normally find the GTIN on the packaging.

    For more information about the validation of GTINs, refer to the GTIN Validation Guide.

    In addition, please refer to this article on How to fix: Invalid value: GTIN [gtin]

    Meanwhile, since you’re using the custom code above, kindly be informed that custom coding is not something we can assist with directly. However, I’ll keep this thread open for a bit to see if anyone from the community can lend a hand.

    If you have any other questions related to development or custom coding, don’t hesitate to reach out to some of the great resources we have available for support. The WooCommerce community is filled with talented open-source developers, and many of them are active on the channels listed below:

    Hope this helps!

    Thread Starter boppar

    (@boppar)

    That answer didn’t solve anything.
    As I thought the GTIN is invalid because of containing letters.

    My products are handmade products which have no GTIN.

    Maybe somebody else had the same problem with invalid GTIN and can share a solution?

    Thread Starter boppar

    (@boppar)

    Anybody with a suggestion on how to solve the problem?

    Saif

    (@babylon1999)

    Hello @boppar,

    Just to confirm, are you using the Google Listings and Ads extension to sync your products?

    If not, then I’m afraid this falls under custom development which is not something we can provide support for per our support policy. You can check the resources shared by xue28 for guidance.

    Cheers!

    Thread Starter boppar

    (@boppar)

    Hello @babylon1999

    No, I’m not using the Google Listings and Ads extension. According to the reviews the extension is really bad.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Annoying problem with Invalid GTIN.’ is closed to new replies.