Assistance Required with Schema Price Issue Due to PPOM Fields

#894036
  • My Boost Pal
    Rank Math free

    Dear Rank Math Support Team,

    I am facing an issue with my product schema where the price is incorrectly displayed as “0”. I use the PPOM plugin to manage product prices, and I believe this is affecting the schema generated by Rank Math. Despite multiple attempts to modify the schema through filters and custom code, the price still shows as “0” at Offers schema instead of reflecting the correct value from PPOM fields.

    I should also mention that I am using a multisite environment, with multiple sites under different languages. The schema issue occurs across all sites in the multisite setup.

    Here are some details of what I have tried so far:

    Custom PHP Code: I have written custom functions to extract the PPOM price from product meta fields and use it to override the price in the Rank Math schema. Despite this, the schema output still displays the price as “0”.

    JavaScript Modifications: I attempted to use JavaScript to dynamically update the price in the meta tags, including Twitter meta tags, after the page load. This approach was also unsuccessful, and the price remains “0”.

    Removing and Replacing Schema Tags: I tried removing the existing schema tags and replacing them with updated ones that include the correct price from the PPOM fields. Unfortunately, this also did not resolve the issue.

    WooCommerce Price Filters: I have used WooCommerce hooks like woocommerce_get_price_html to try and modify the displayed price, but this has not been reflected in the schema or meta tags.

    It seems that the Rank Math schema generation may not be picking up the dynamic pricing set through PPOM, and my attempts to override it programmatically have not been effective.

    Could you please provide guidance or a solution on how I can ensure the Rank Math schema correctly reflects the product price set by PPOM?

    Thank you very much for your assistance. Any help you can provide would be greatly appreciated.

    Best regards,
    Alex

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

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    In this case, you may use and customize this filter to fetch the price data from that plugin and use it in the product schema:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    	 $entity['offers']['price'] = 'PPOM-price'; //change to actual value from PPOM
    	return $entity;
    });

    If you’re not sure how to add this code, you can follow this guide:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    You may also get in touch with that plugin support and ask to edit the code to fetch the product price from their data.

    Hope that helps.

    Hi,

    Thank you very much for the filter provided. After many attempts with various codes, I managed to get it working to get the PPOM price and to update the schema.

    Now I have another problem. For the same reason, I have the price 0 on <meta name=”twitter:data1″ content=”0,00 €”/> and I assume it is the same for Facebook.

    Can you also recommend me a filter or code example to use for this as well so that I can populate it with the correct price?

    I have currently used the rank_math/opengraph/twitter and rank_math/opengraph/facebook filters, but with no luck.

    Thank you very much for your help!

    Have a nice day!

    Hello,

    Please use the following code:

    add_filter("rank_math/opengraph/slack/twitter_data1", function ($data) {
    	$data = 'PPOM-price'; //change to actual value from PPOM
    	return $data;
    });

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

    Hi!

    Thanks for the provided code. It will work also for rank_math/opengraph/facebook or is needed another filter for that?

    Thank you!

    Hi,

    I managed to update the twitter_data1 price correctly now but I have another problem now.

    On Google Test Rich Results, I do not see my Offer Schema, even everything is set in place now, how can I have a working Offer schema for Google?

    On https://validator.schema.org/ I see the offer generating properly but when I test on Google Rich Results, I do not see there the same schema for Offer.

    What could I do for this because for sure Rank Math generates that properly but on Google Rich Results is not appearing, only on schema.org is showing.

    Thank you!

    Hello,

    Please share URL of an affected product so we can check and assist you further.

    Looking forward to helping you.

    Hi,

    Here are some URL’s from my website:

    https://www.myboostpal.com/product/buy-youtube-views/
    https://www.myboostpal.com/fr/produit/acheter-des-vues-youtube/
    https://www.myboostpal.com/es/producto/comprar-visitas-youtube/

    If you check on https://validator.schema.org/#url=https%3A%2F%2Fwww.myboostpal.com%2Fproduct%2Fbuy-youtube-views%2F, you will find the Offer Schema when you click on the Product Schema and scroll down till the end, but on https://search.google.com/test/rich-results/result?id=4-iid4lNNp7EAxeWSPyGyw is not appearing the Offer Schema.

    I checked on Product Snippets and Merchant Listings and did not see the Offer Schema and the most important thing is for Google to recognize this Offer Schema in order to display rich results on Google search results.

    Thank you very much once again for your help!

    Hello,

    We’ve reviewed your product pages and confirmed that Rank Math is correctly generating the Offer Schema. While the Offer Schema may not appear in the Google Rich Results Test, it doesn’t show any errors, which means Google can still acknowledge it. Sometimes, not all schema properties are reflected in the test, but this doesn’t necessarily impact how they are processed by Google.

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

You must be logged in to reply to this ticket.