Hello @justanotherguy
Thank you for contacting the support.
Assuming you are using the latest version of the plugin, that error should not be there.
Also, please add the following code to your theme’s functions.php file to use the value from the Meta Field for MPN:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
global $post;
$entity['mpn'] = get_post_meta( $post->ID, 'mpn_meta_key', true ); // Please hange mpn_meta_key with the meta from which you want to get the MPN value.
return $entity;
});
Hope that helps. Please let us know if you need any further assistance.
Thanks for the reply – for some reason wp didn’t send me an email, oh well…
Yesterday I was using the latest version at the time as it was a clean install – 1.0.35.2, and now I am using 1.0.35.3. I can confirm that with 35.3 the mpn error is not there.
I am not comfortable adding code. I was hoping for something like the “Brand” setting you already have in the WC settings, which would allow me to select a custom field as “mpn” for google meta. 🙂
Hello @justanotherguy
Since MPN is not a required field but a recommended one, we did not add an option to set that inside the plugin.
With that said, with the latest version, you can use the other plugin which was adding the MPN value(s) on your website.
Also, adding code to the theme’s functions.php file is simple and you can follow the following tutorial for the same:
https://www.rosehosting.com/blog/how-to-add-code-to-functions-php-in-wordpress/
Hope that helps. Thank you.
There can be a problem with not including mpn – using our items as an example. Almost every part we sell is either an Original Equipment replacement part, or a private label part, and neither have GTIN. Seeing as google does not count sku as a valid identifier for buyer purposes (due to sellers using different sku for same products), every product must either have a gtin or mpn for google to “know” what the product is.
If google doesn’t know what the product is, then they are not going to bother showing it.
I have even tried searching our (unique) sku for items that are indexed on google, and they do not show in search results. I can force them to show by adding keywords to the search; but, it could be argued that the keywords became the primary terms used by google to display result, and the sku was virtually irrelevant.
Therefore, mpn is crucial for items without gtin. Basically – what is the point in telling google you have a “product” but then give them NO identifier…?
I will look at the tutorial you provided later and hope I can make it work, thanks.
Hello @justanotherguy
Can you please tell us how are you adding the MPN value now? Are you using any plugin or have you created a custom field for that?
WooCoommerce by default doesn’t have any option to add the MPN. For Gtin and the brand values, Rank Math reads them from the product attributes and the selected taxonomy from the Settings.
In some cases, the brand name and MPM would be the same but for many users, it was causing a problem. So, we decided to remove it and let the users decide what value they want to add to MPN using a filter.
Adding an option in our plugin to add the MPN value would, in fact, create conflict with the WooCommerce addon plugins which provides the same option. So, we are still deciding whether to add an additional option or not.
With that being said, there are existing feature requests, so I’ve added your vote to our internal suggestions lists. If your suggestion is something that we’re able to introduce, we’ll be sure to let you know.
Thank you.