Change Image in SCHEMA

#1057149
  • Resolved Thomas
    Rank Math free

    Hi!

    I want to change the image shown next to google’s search results.

    It looks like Rankmath uses ImageObject and primaryImageOfPage in its structured data and that these properties are responsible for the image in the search results. The configured URL corresponds to the image displayed.

    How can I change this URL so that it doesn’t match the first picture on my page?

    I’ve read that Rankmath uses get_avatar_url to get this URL, so I’ve used the following filter in rankmath.php to change it, but without success:

    add_filter( ‘get_avatar_url’, ‘my_get_avatar_url’, 10, 3 );

    function my_get_avatar_url( $url, $id_or_email, $args ) {
    $args[‘url’] = ‘https://example.com/wp-content/uploads/2025/01/MyPicture.jpg’;
    return $args;
    }

    Thanks for your help!

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

    We apologize for the issue you are facing with changing the image shown in Google’s search results. To change the image used in the Schema markup, you can follow these steps:

    1. Set a Featured Image: The easiest way to control the image that appears in search results is to set a featured image for your post or page. This image will be used by Rank Math as the primary image for the Schema markup.

      • Navigate to your post or page in the WordPress editor.
      • In the sidebar, scroll to the Featured Image section and click Set featured image to select an image from your media library or upload a new one.
        Click Set featured image
    2. Check Schema Settings: Ensure that the Schema module is enabled in Rank Math. You can do this by going to WordPress DashboardRank Math SEOModules and confirming that the Schema module is active.
      Enable the Schema module in Rank Math

    3. Custom Thumbnail URL: If you want to use a specific image that is not set as the featured image, you can add a custom thumbnail URL in the Video Schema settings if applicable. This is done through the Rank Math metabox when editing your post or page.

      • Open the Rank Math metabox, click on the Schema tab, and then edit the relevant schema type to add your custom thumbnail URL.
        Open the Rank Math metabox
    4. Validate Your Changes: After making these changes, you can validate your Schema markup using Google’s Rich Results Test tool to ensure that the correct image is being picked up.

      • You can access this tool here.

    If you continue to experience issues after following these steps, please reply to this ticket with your site URL so we can assist you further. Thank you for raising this concern, and we hope this helps!

    Sources:
    How to Fix Missing ThumbnailUrl Error in Schema Markup » Rank Math

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

    Thomas
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    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 2 replies - 1 through 2 (of 2 total)

The ticket ‘Change Image in SCHEMA’ is closed to new replies.