Product Schema – description, brand and price currency

#96311
  • Resolved Senada
    Rank Math free

    Product description schema, what’s the best way to enable shortcodes in the description?

    For the brand, your code stopped working for me since a recent update I suspect.

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
        $entity['brand'] = 'Rank Math';
        return $entity;
    } );
    

    For the price currency, I use a currency switcher, in the product schema, the price remains as the base price, but the currency changes depending on which currency is chosen from the currency switcher. Is there a filter I can set the “priceCurrency”?

    Thank you 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thank you for getting in touch and I am extremely sorry about the trouble this might have caused.

    1. To allow adding the shortcode in your product description, please use this filter: https://rankmath.com/kb/filters-hooks-api-developer/#allow-shortcodes-in-product-description

    2. Please check if the brand code is still intact in your functions.php. if it is, could you please share a sample product URL we can check from our end?

    3. To modify the priceCurrency you can use this filter: https://rankmath.com/kb/filters-hooks-api-developer/#change-post-schema-data

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

    Senada
    Rank Math free

    1. For shortcodes in the Schema description, because I will also use shortcodes in the SEO description fields, I will use this code

    add_filter( 'rank_math/frontend/description', function( $description ) {
        $description = apply_shortcodes( $description );
        return $description;
    });

    Will this also work for the Schema description, because I did a quick test my end and it seems to work for the Schema description as well? Or am I mistaken and should I also add your suggested code too? Both codes?

    2. The brand code is still intact, but it’s still not working in the product Schema. I think I will just leave this for now, as Google says it’s an optional field.

    3. So this would be the same as the brand code, except for of course, instead of
    $entity['brand'] = 'Rank Math';
    I would use
    $entity['priceCurrency'] = 'USD';

    Thank you…

    Alberto
    Rank Math business

    Hello,

    You can use the code you are using or the code my colleague shared, both should work without any issues.

    Looking forward to help you.

    Senada
    Rank Math free

    Confused here. Seems the shortcodes work in the schema description without any code snippet, so I guess I don;t need to add any code snippets for that?

    But for the product SEO description, this code snippet works:

    add_filter( 'rank_math/frontend/description', function( $description ) {
        $description = apply_shortcodes( $description );
        return $description;
    });

    But this code snippet doesn’t work:

    
    add_filter( 'rank_math/product_description/apply_shortcode', '__return_true' );

    For the schema data code snippets, none work, this includes for “brand” or “priceCurrency”:

    $entity['brand'] = 'Rank Math';
    $entity['priceCurrency'] = 'USD';

    Hello,

    The specified filter to apply shortcode on meta description should work. We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress logins in the designated Sensitive Data section.
    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,

    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 5 replies - 1 through 5 (of 5 total)

The ticket ‘Product Schema – description, brand and price currency’ is closed to new replies.