Last active
January 6, 2022 04:00
-
-
Save jdevalk/72bf00d8ba2d7a6144b9a35f0f4dd5b1 to your computer and use it in GitHub Desktop.
This is how to add the copyrightHolder schema to the Website Schema piece Yoast SEO outputs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpseo_schema_website', 'example_change_website_schema', 10, 2 ); | |
/** | |
* Changes the Yoast SEO Website schema. | |
* | |
* @param array $data The Schema Website data. | |
* @param Meta_Tags_Context $context Context value object. | |
* | |
* @return array $data The Schema Website data. | |
*/ | |
function example_change_website_schema( array $data, Meta_Tags_Context $context ): array { | |
$data['copyrightHolder'] = [ '@id' => $context->site_url . Schema_IDs::ORGANIZATION_HASH ]; | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For more info see: