Schema

#798928
Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    Thank you so much for getting in touch.

    In our plugin, you will use the rank_math/json_ld filter to modify the entire schema structure. Here’s the converted code:

    function modify_organization_schema( $organization ) {
    	$organization = array(
    		"@type" => "NewsMediaOrganization",
    		"address" => array(
    			"@type" => "PostalAddress",
    			"addressCountry" => "NG",
    			"addressLocality" => "Lagos",
    			"addressRegion" => "LA",
    			"postalCode" => "100001",
    			"streetAddress" => "75 Opebi Rd, Ikeja GRA"
    		),
    		"description" => "Ejes Gist is a leading online news media platform dedicated to providing credible and reliable news and information to the Nigerian audience. We cover a wide range of topics including politics, business, technology, education, sports, health, and entertainment.",
    		"diversityPolicy" => "https://ejesgist.ng/policies-and-standards/",
    		"ethicsPolicy" => "https://ejesgist.ng/policies-and-standards/",
    		"correctionsPolicy" => "https://ejesgist.ng/policies-and-standards/",
    		"cookiesPolicy" => "https://ejesgist.ng/cookies-policy/",
    		"dmca" => "https://ejesgist.ng/dmca-takedown-notice/",
    		"name" => "Ejesgist News in Nigeria",
    		"email" => "i******@e**********",
    		"legalName" => "Ejes Gist Media Limited",
    		"telephone" => "+2347033247217",
    		"url" => "https://www.ejesgist.ng",
    		"image" => "https://ejesgist.ng/wp-content/uploads/2021/09/Ejes-official-Logo-2020__3_-removebg-preview.png",
    		"logo" => "https://ejesgist.ng/wp-content/uploads/2021/09/Ejes-official-Logo-2020__3_-removebg-preview.png",
    		"brand" => array(
    			array(
    			"@type" => "Brand",
    			"name" => "POOL FIXTURES",
    			"url" => "https://ejesgist.ng/pool-fixtures/"
    			),
    			array(
    			"@type" => "Brand",
    			"name" => "Ejes Gist Pool Results",
    			"url" => "https://ejesgist.ng/pool-result/"
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejesgist Technology',
    			'url' => 'https://ejesgist.ng/technology/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist Politics',
    			'url' => 'https://ejesgist.ng/politics/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist breaking news today',
    			'url' => 'https://ejesgist.ng/breaking-news-today/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist Education',
    			'url' => 'https://ejesgist.ng/education/',
    			'logo' => 'https://ejesgist.ng/wp-content/uploads/2021/09/Ejes-official-Logo-2020__3_-removebg-preview.png'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist RSK Pool Papers',
    			'url' => 'https://ejesgist.ng/pool-late-news-papers/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist Jobs',
    			'url' => 'https://ejesgist.ng/jobs-in-nigeria/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist Business',
    			'url' => 'https://ejesgist.ng/business/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist Biographical Gist',
    			'url' => 'https://ejesgist.ng/biography-and-profiles/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist Sports News',
    			'url' => 'https://ejesgist.ng/sport/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejesgist Health Tips',
    			'url' => 'https://ejesgist.ng/health/',
    			'Logo' => 'https://ejesgist.ng/health/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejesgist Pool Code',
    			'url' => 'https://ejesgist.ng/pool-code-for-this-week/'
    			),
    			array(
    			'@type' => 'Brand',
    			'name' => 'Ejes Gist Monthly Greetings & Wishes',
    			'url' => 'https://ejesgist.ng/happy-new-month-wishes/'
    			)
    		),
    		"founder" => "Don Emmanuel Omajemite ",
    		"foundingDate" => "2017",
    		"incorporationDate" => "2022"
    	);
    	return $organization;
    }
    
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	if ( isset( $data['publisher'] ) ) {
    		$data['publisher'] = modify_organization_schema('');
    	}
    	return $data;
    }, 99, 2);

    We’ve also corrected some issues inside the modify_organization_schema function as it contains invalid syntaxes.

    Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.

    Hello,

    Unlike Yoast, their hook code wpseo_schema_organization allows you to modify the organization property directly whereas our hook rank_math/json_ld modifies the entire structure so you’ll need to target the correct property (publisher) first before injecting the custom schema structure you made.

    We suggest following this format instead:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	if ( isset( $data['publisher'] ) ) {
    		$data['publisher'] = modify_organization_schema('');
    	}
    	return $data;
    }, 99, 2);

    Don’t hesitate to get in touch with us if you have any other questions.

    Anonymous
    Rank Math free

    Can just you provide me with the entire code i should use or add to the rank-math.php those schema

    Anonymous
    Rank Math free

    This is the code I’m currently using please can you please implement the necessary changes or corrections and send me the code I should use.

    function modify_organization_schema( $entity ) {
    $entity[‘@context’] = “https://schema.org”;
    $entity[‘@graph’][] = array(
    ‘@type’ => ‘NewsMediaOrganization’,
    ‘address’ => array(
    ‘@type’ => ‘PostalAddress’,
    ‘addressCountry’ => ‘NG’,
    ‘addressLocality’ => ‘Lagos’,
    ‘addressRegion’ => ‘LA’,
    ‘postalCode’ => ‘100001’,
    ‘streetAddress’ => ’75 Opebi Rd, Ikeja GRA’
    ),
    ‘description’ => ‘Ejes Gist is a leading online news media platform dedicated to providing credible and reliable news and information to the Nigerian audience. We cover a wide range of topics including politics, business, technology, education, sports, health, and entertainment.’,
    ‘diversityPolicy’ => ‘https://ejesgist.ng/policies-and-standards/’,
    ‘ethicsPolicy’ => ‘https://ejesgist.ng/policies-and-standards/’,
    ‘correctionsPolicy’ => ‘https://ejesgist.ng/policies-and-standards/’,
    ‘cookiesPolicy’ => ‘https://ejesgist.ng/cookies-policy/’,
    ‘dmca’ => ‘https://ejesgist.ng/dmca-takedown-notice/’,
    ‘name’ => ‘Ejesgist News in Nigeria’,
    ’email’ => ‘i******@e**********’,
    ‘legalName’ => ‘Ejes Gist Media Limited’,
    ‘telephone’ => ‘+2347033247217’,
    ‘url’ => ‘https://www.ejesgist.ng’,
    ‘image’ => ‘https://ejesgist.ng/wp-content/uploads/2021/09/Ejes-official-Logo-2020__3_-removebg-preview.png’,
    ‘logo’ => ‘https://ejesgist.ng/wp-content/uploads/2021/09/Ejes-official-Logo-2020__3_-removebg-preview.png’,
    ‘brand’ => array(
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘POOL FIXTURES’,
    ‘url’ => ‘https://ejesgist.ng/pool-fixtures/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist Pool Results’,
    ‘url’ => ‘https://ejesgist.ng/pool-result/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejesgist Technology’,
    ‘url’ => ‘https://ejesgist.ng/technology/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist Politics’,
    ‘url’ => ‘https://ejesgist.ng/politics/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist breaking news today’,
    ‘url’ => ‘https://ejesgist.ng/breaking-news-today/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist Education’,
    ‘url’ => ‘https://ejesgist.ng/education/’,
    ‘logo’ => ‘https://ejesgist.ng/wp-content/uploads/2021/09/Ejes-official-Logo-2020__3_-removebg-preview.png’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist RSK Pool Papers’,
    ‘url’ => ‘https://ejesgist.ng/pool-late-news-papers/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist Jobs’,
    ‘url’ => ‘https://ejesgist.ng/jobs-in-nigeria/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist Business’,
    ‘url’ => ‘https://ejesgist.ng/business/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist Biographical Gist’,
    ‘url’ => ‘https://ejesgist.ng/biography-and-profiles/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist Sports News’,
    ‘url’ => ‘https://ejesgist.ng/sport/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejesgist Health Tips’,
    ‘url’ => ‘https://ejesgist.ng/health/’,
    ‘logo’ => ‘https://ejesgist.ng/health/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejesgist Pool Code’,
    ‘url’ => ‘https://ejesgist.ng/pool-code-for-this-week/’
    ),
    array(
    ‘@type’ => ‘Brand’,
    ‘name’ => ‘Ejes Gist Monthly Greetings & Wishes’,
    ‘url’ => ‘https://ejesgist.ng/happy-new-month-wishes/’
    )
    ),
    ‘founder’ => ‘Don Emmanuel Omajemite ‘,
    ‘foundingDate’ => ‘2017’,
    ‘incorporationDate’ => ‘2022’
    );

    $entity[‘@graph’][] = array(
    ‘@type’ => ‘WebSite’,
    ‘url’ => ‘https://www.ejesgist.ng’,
    ‘potentialAction’ => array(
    ‘@type’ => ‘SearchAction’,
    ‘target’ => ‘https://www.ejesgist.ng/?s={search_term_string}’,
    ‘query-input’ => ‘required name=search_term_string’
    )
    );

    return $entity;
    }
    add_filter( ‘rank_math/json_ld’, ‘modify_organization_schema’ );

    Hello,

    The last part of the filter is wrong you need to use the function we mentioned above to add this to the publisher key:

    
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	if ( isset( $data['publisher'] ) ) {
    		$data['publisher'] = modify_organization_schema('');
    	}
    	return $data;
    }, 99, 2);
    

    Please use the complete code we shared previously from here: https://support.rankmath.com/ticket/schema-204/?view=all#post-799179

    Thank you.

    Hello,

    Our plugin automatically adds the SearchAction already, however, if you prefer that method, you can also include that.

    Once you applied the code, you can check your pages here: https://search.google.com/test/rich-results

    Looking forward to helping you.

    Anonymous
    Rank Math free

    Yes it was 💯 % Google not issues on Google rich data

    Hello,

    It seems like you’ve marked this ticket as resolved.

    Can you please confirm if you still need our assistance with this issue or anything else?

    Looking forward to hearing back from you.

    Thank you.

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

You must be logged in to reply to this ticket.