socialmedia not in schema

#185640
  • Resolved TourInPersia
    Rank Math free

    Hi
    I use Yoast plugin for one of my websites. For this website, Social media are show in schema. Please see this image:

    But in one of my website I use RankMath and these social media not showing in schema.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    Please note that we removed the Social Meta options for “sameAs” Schema intentionally because Google/Yandex doesn’t use it anymore. It is like the keyword meta tags that many webmasters spend extra time on but it is also ignored by Google and there is zero advantage of having the sameAs code just like there is zero advantage if you have the meta keywords on your website.

    However, if you still want to add it, then you can use the filter as follows by adding it to your theme’s functions.php or by using a plugin like Code Snippets:

    /**
    * 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 ) {
    	if(is_singular('listing')){
    	$currentSameAs = $data['Organization']['sameAs'];
            $currentSameAs[] = "https://wordpress url....";
            $currentSameAs[] = "https://blogger url....";
            $currentSameAs[] = "https://tumblr url....";
            // And so on...
    
            $data['Organization']['sameAs'] = $currentSameAs;
    	return $data;
    }, 10, 2);

    I hope that helps. Thank you, and please don’t hesitate to contact us anytime if you need further assistance with anything else.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.