Skip to content

Instantly share code, notes, and snippets.

@warnakey
Last active April 15, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save warnakey/966634415ab9d7017c0c889dd1225053 to your computer and use it in GitHub Desktop.
Save warnakey/966634415ab9d7017c0c889dd1225053 to your computer and use it in GitHub Desktop.
Speakable Schema Example for WordPress (will use the meta description of each page for the speakable schema)
<!-- This schema can go in the header.php file of any WordPress site -->
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "WebPage",
"name": "<?php the_title(); ?>",
"speakable":
{
"@type": "SpeakableSpecification",
"xpath": "/html/head/meta[@name='description']/@content"
},
"url": "<?php the_permalink(); ?>"
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment