وردپرس

When AMP is activated it conflicts with Google Product & Review rich snippet


When AMP is activated it conflicts with Google Product & Review rich snippet.

When AMP is active, the AMP plugin adds a javascript in the head to redirect to the amp but that is somehow making some issues and in the google rich snippet testing tool when we try to test the URL or code it gives an error or doesn’t show the product and review rich snippet and if we disable the AMP, it works correctly and show the Product and review rich snippets.

Video:

https://www.loom.com/share/cfa9de8d2f724f8b8523f891fa0df56f?sid=26a8da85-eb63-4c5a-a853-8f6ae7c8058e

Code Affecting :
plugins/amp/assets/js/mobile-redirection.js
plugins/amp/src/MobileRedirection.php
in the function : add_mobile_redirect_script – ‘mobileUserAgents’ => $this->get_mobile_user_agents(), ( due to below part the issue exist )

I tried with the latest plugin version 2.5.4

Not Working Code on rich snippets:

`
    
   

Working Code on Rich snippets:


      
      

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا