How to expand markup

  • Resolved Yury

    Hi!

    I found interesting information on the page:

    https://www.searchenginejournal.com/how-to-use-structured-data-to-support-e-a-t/362946/

    This Schema type offers a variety of properties that can provide additional context about your company or brand, for example:

    address
    duns
    founder
    foundingDate
    hasCredential
    knowsAbout
    memberOf
    parentOrganization

    Is there any way to add these fields to the markup? This would definitely add points to your plugin. After all, EAT factors are extremely important.

    I beg you to seriously read this article. That would be a great plugin revision on your part.

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

    Thank you for contacting Rank Math and for sharing this suggestion.

    I will pass this on to our dev team so that the feature can be considered for development on our future development roadmap.

    For now, you can seek the help of a developer to extend the Rank Math schema with the additional attributes by using the following filter:

    /**
     * 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 ) {
    	return [];
    }, 10, 2);

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hi! Please help with the logic for this filter.

    How to add ‘founder’? Please provide a working code?

    add_filter( ‘rank_math/json_ld’, function( $data, $jsonld ) {
    $data[‘Organization’] = [
    ‘founder’ => ‘TEST’,
    ];
    return $data;
    }, 10, 2);

    Does not work!

    Hello,

    Thank you for contacting Rank Math today.

    The following is a sample of how you could use it.

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    // IF STATEMENT TO TEST IF LOCAL BUSINESS SCHEMA IS EXIST ON THE PAGE BEFORE ADDING THE EXTRA FIELDS
    	$data['LocalBusiness'] = [
    	    	'@context' => 'https://schema.org',
    	    	'@type'    => 'LocalBusiness',
    	    	'@id'      => 'https://abc.com/#organization',
    		'founder' => 'Test'
    			];
    		return $data;
    }, 10, 2);

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

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

The ticket ‘How to expand markup’ is closed to new replies.