Customizing rich snippets shown on frontend

  • Hello,

    How do I customize the rich snippet shown on front end?

    I would like it to have a different background color and curved borders

    Added links in sensitive area

    Thank you

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

    Thank you for contacting Rank Math today.

    You can use the following filter to customize the review HTML on the frontend:

    /**
     * Filter to change review display location
     *
     * @param string $html.
     */
    add_filter( 'rank_math/review/html', function( $html ) {
    	return $html;
    });
    

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Sorry, I didn’t understand.
    Is this the css code for customizing the snippet? or something else?

    I am not looking to change the review location. Trying to customize how it looks

    How do I use it? Sorry if it seems like a basic question.

    Thanks

    Hello,

    Thank you for contacting Rank Math today.

    The above filter can be used to customize the HTML output of the review. In your case since you only want to modify the style, you can inspect the review and identify the CSS selectors that you can later use to target with custom CSS.
    For instance the wrapper div is called “rank-math-rich-snippet-wrapper” and you can add some CSS using this class.

    Looking forward to helping you. Thank you.

    ​​​​​​

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

You must be logged in to reply to this ticket.