-
Hello,
I am pretty new to the coding part of things in SEO related matter.
I want to add the “thumbnailUrl” as a schema markup to all my articles. I want the “thumbnailUrl”, the actual URL be my featured image.
Now i know that I can use: https://rankmath.com/kb/filters-hooks-api-developer/#extend-json-ld-data this part, but I have no idea how it works.
So, if possible, I just want to guidance here.
I am assuming what i need is something like this?
/** * Collect data to output in JSON-LD. * * @param array $unsigned An array of data to output in json-ld. * @param JsonLD $unsigned JsonLD instance. */ add_filter( 'rank_math/json_ld', function( $data, $jsonld ) { 'thumbnailUrl' => 'the_post_thumbnail_url()'} return []; }, 10, 2);
Please advise if possible. It would be greatly appreciated! And I will be able to go from here and add more if needed. But at least ill have an example.
Thank you!
The ticket ‘Adding “thumbnailUrl” to Schema Markup’ is closed to new replies.