Created
June 20, 2025 22:44
-
-
Save rmarcano/33595d42a8e77148ee456a83de71ca4e to your computer and use it in GitHub Desktop.
Add "IsAccessibleForFree" to the Article schema
This file contains hidden or 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
/** | |
* Add the 'isAccessibleForFree' property to Yoast's Article schema. | |
* | |
* @param array $data The Article schema data. | |
* @return array The modified schema data. | |
*/ | |
function add_is_accessible_for_free_to_article_schema( $data ) { | |
// Set the property to true. You can change this to false if needed. | |
$data['isAccessibleForFree'] = true; | |
return $data; | |
} | |
add_filter( 'wpseo_schema_article', 'add_is_accessible_for_free_to_article_schema' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment