Adding in thumbnailURL to Video Snippet

#94998
  • Resolved Jess
    Rank Math free

    Is there any way I can use the RankMath plugin to add thumbnailURL to Video objects or do I need to contact a web developer?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have the same issue. The Google Search Console complains about missing thumbnailURL

    Hello,

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

    Please head over to your theme editor and add the following to the functions.php file

    
    add_filter( "rank_math/snippet/rich_snippet_videoobject_entity", function( $entity ) {
    	global $post;
     $featured_img_url = get_the_post_thumbnail_url($post->ID,'full'); 
        $entity['thumbnailUrl'] = $featured_img_url;
        return $entity;
    });
    

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Ron
    Rank Math free

    This change appeared to work for me but google says it needs a day or two to verify. Will this code stay in functions.php with the next astra theme update or will it be overwritten?

    Hello,

    To make sure your custom snippets are never overwritten with theme updates, it is recommended to create a child theme of active theme. Here is a guide to help you: https://www.hostinger.com/tutorials/how-to-create-wordpress-child-theme

    Looking forward to helping 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 4 replies - 1 through 4 (of 4 total)

The ticket ‘Adding in thumbnailURL to Video Snippet’ is closed to new replies.