Rich Snippets not working AMP

#14219
  • Resolved Prince Ahmed
    Rank Math free

    Dear Sir,

    I use Schema Markup Rich Snippets By Rank Math WordPress Plugin.

    Rich Snippets is working single post and output <script type=”application/ld+json”> correctly. I want to show same ld+json output in single post AMP page. But its not showing in amp page source. I use better amp plugin.

    How to add manually application/ld+json for AMP page? Please advice me.

    I added this code my functions.php file but not working for amp page.

    if (function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) {
        add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	return [];
    }, 10, 2);
    }

    Please Help me.

    • This topic was modified 4 years, 7 months ago by Prince Ahmed.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    The schema data should be added to the page out of the box without the need for additional code. Can you confirm that the AMP module is activated on your site via Rank Math > Dashboard?

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Dear sir,
    I use only Schema Markup Rich Snippets plugin. Amp option is for rank math SEO suite. How to enable snippets for amp using Schema Markup Rich Snippets plugin.
    Please advice me the solution OR Update This Plugin

    Thanks
    Prince Ahmed

    • This reply was modified 4 years, 7 months ago by Prince Ahmed.

    Dear Sir,

    I am waiting for your response. please give me a solution for amp rank_math/json_ld.

    Thanks
    Prince Ahmed

    Hi Prince,

    Apologies for the delay.

    I have been able to replicate this behavior on my end and this has been reported to our dev team for closer investigation.

    We will be getting back to you in a short while. We appreciate your continued patience.

    Thank you.

    Hello,

    I’ve forwarded this issue to our Development team, they will release an update soon with the fix.

    For now, please add below filter code in your theme’s functions.php file to print the json_ld data on the AMP pages:

    
    add_action( 'better-amp/template/head', function() {
        do_action( 'rank_math_schema/head' );
    });
    
    

    Hope that helps. Thank you.

    Dear Sir,

    Many many thanks for this solution. the json_ld data on the AMP pages working fine.
    Thanks rank math team.
    Prince Ahmed

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/?rate=5#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Rich Snippets not working AMP’ is closed to new replies.