• Resolved swinggraphics

    (@swinggraphics)


    It doesn’t look like there are filters for the schema data. How do I, for example, change the Organization url and add a “sameAs” item? Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    I’ve added the filter at the very end of the parsing. You can use this filter:

    add_filter( 'the_seo_framework_receive_json_data', function( $data, $key ) {
    
    	switch ( $key ) :
    		case 'website':
    			// Adjust "website" Schema.org here...
    			break;
    
    		case 'links':
    			// Overwrite Organization URL.
    			$data['url'] = 'https://example.com/';
    
    			// Add more sameAs URLs.
    			$data['sameAs'][] = 'https://example-social-network.com/my-profile';
    			$data['sameAs'][] = 'https://another-example-social-network.com/my-profile';
    			break;
    
    		default:
    			// Unknown key... don't do anything.
    			break;
    	endswitch;
    
    	return $data;
    }, 10, 2 );

    Cheers ??

    Thread Starter swinggraphics

    (@swinggraphics)

    Thank you very much, that’s wonderful!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filter schema output’ is closed to new replies.