Manual Organization Schema Markup

Here’s a code snippet for organization schema markup with dynamic content from a WordPress site:

<?php
// Get the site name and URL
$site_name = get_bloginfo( 'name' );
$site_url = get_bloginfo( 'url' );
?>

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "name": "<?php echo $site_name; ?>",
  "url": "<?php echo $site_url; ?>",
  "logo": "<?php echo get_template_directory_uri(); ?>/images/logo.png",
  "contactPoint": [
    {
      "@type": "ContactPoint",
      "telephone": "+1-555-555-5555",
      "contactType": "customer service"
    }
  ],
  "sameAs": [
    "https://www.facebook.com/your-page",
    "https://www.twitter.com/your-page",
    "https://www.instagram.com/your-page"
  ]
}
</script>

In this example, we’re using PHP to dynamically populate the organization schema markup with the site name, URL, and logo. You can customize the contact information and social media links as needed. Make sure to place this code snippet in the header of your WordPress site so that it is included on all pages.

Leave comment or code correction