Skip to content

Instantly share code, notes, and snippets.

@rmarcano
Created June 20, 2025 22:44
Show Gist options
  • Save rmarcano/33595d42a8e77148ee456a83de71ca4e to your computer and use it in GitHub Desktop.
Save rmarcano/33595d42a8e77148ee456a83de71ca4e to your computer and use it in GitHub Desktop.
Add "IsAccessibleForFree" to the Article schema
/**
* 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