Add MPN Schema to WooCommerce Products Using Rank Math ,but it don’t work

#1037045
  • Resolved Fray Smith
    Rank Math free

    Hi Support
    1.Rankmath SEO Settings

    2. Code add_filter-add_gtin_field

    3.It didn’t work

    4.If work,it show “MPN added by Rank Math SEO). This field overrides WooCommerce GTIN data used in the Product Schema.” like this

    Can you help this issue?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Fray Smith
    Rank Math free

    Hi Support
    1.Rankmath SEO Settings

    2. Code add_filter-add_gtin_field

    3.It didn’t work

    4.If work,it show “MPN added by Rank Math SEO). This field overrides WooCommerce GTIN data used in the Product Schema.” like this

    Can you help this issue?

    Hello,

    Thank you for your patience.

    We removed our plugin’s GTIN field from the product editor since WooCommerce has started adding its own.

    However, you can add the following filter to your site to enable our GTIN field:

    /**
     * Filter to enable Rank Math GTIN field.
     */
    add_filter( 'rank_math/woocommerce/add_gtin_field', '__return_true' );

    Here is how to add a filter to your site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Once you add the filter, you can convert our GTIN field to MPN in WP Dashboard > Rank Math SEO > General Settings > WooCommerce.

    The values are saved in the _rank_math_gtin_code meta key.

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Fray Smith
    Rank Math free

    As you said, I have added filters/hooks in the functions.php file of the theme
    /**
    * Filter to enable Rank Math GTIN field.
    */
    add_filter( ‘rank_math/woocommerce/add_gtin_field’, ‘__return_true’ );

    But in the Inventory of Product data, only GTIN, UPC, EAN, or ISBN are displayed. MPN is not displayed.

    Hello,

    Sorry about that.

    Please ensure that you are using the latest version of Rank Math plugin. If not yet, please do update them. You may refer to our changelog page here: https://rankmath.com/changelog/

    Clear your website caches and check the Inventory tab on the product page again.

    If the issue persists, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    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.

    Fray Smith
    Rank Math free

    Hello, Support
    I have provided a temporary URL

    We look forward to your assistance.

    Hello,

    We can’t seem to find the filter code in your functions.php.

    We have gone ahead and applied the code using the WP code plugin in your website with high priority order, and the MPN field is now showing on the product page:

    Rank Math support

    Here’s the admin link of the code snippet: https://www.fitsparts.com/wp-admin/admin.php?page=wpcode-snippet-manager&snippet_id=68113

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Add MPN Schema to WooCommerce Products Using Rank Math ,but it don’t work’ is closed to new replies.