How to use a Custom Image in Product Snippet

#84164
  • Resolved Ajay Choudhury
    Rank Math free

    I am using product schema on my post and it is showing the default featured image besides the product details and star ratings. How can I use custom images for my product schema snippet on posts? I am not using Woocommerce.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can use the customize the following filter and add it to your theme functions.php to modify the generated schema data in the front end.

    
    /**
     * Filter to change the schema data.
     * Replace $schema_type with schema name like article, review, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_{$schema}_entity", function( $entity ) {
     return $entity;
    });
    

    Hope this helps you. Thank 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 1 replies (of 1 total)

The ticket ‘How to use a Custom Image in Product Snippet’ is closed to new replies.