Skip to content

Instantly share code, notes, and snippets.

@finalwebsites
Created October 16, 2024 19:19
Show Gist options
  • Save finalwebsites/d59991d73ad99b419cb5e44433ac05ab to your computer and use it in GitHub Desktop.
Save finalwebsites/d59991d73ad99b419cb5e44433ac05ab to your computer and use it in GitHub Desktop.
Structured organization data for WordPress websites
<?php
add_action('wp_head', 'fws_create_organisatie_data');
function fws_create_organisatie_data() {
$data = array(
'@context' => 'https://schema.org',
'@type' => 'Organization',
'name' => 'Bedrijfsnaam',
'legalName' => 'Volledig bedrijfsnaam',
'url' => 'https://www.website.nl/',
'logo' => 'https://www.website.nl/images/logo.jpg',
'foundingDate' => '2020',
'address' => array(
'@type' => 'PostalAddress',
'streetAddress' => 'Hoofdstraat 1',
'addressLocality' => 'Amsterdam',
'addressRegion' => 'Noord-Holland',
'postalCode' => '1000 AB',
'addressCountry' => 'NL',
),
'contactPoint' = array(
'@type' => 'ContactPoint',
'contactType' => 'Customer Service',
'telephone' => '+31-20-1234567',
'email' => '[email protected]',
),
'sameAs' = array(
'https://www.facebook.com/bedrijfsnaam',
'https://www.linkedin.com/company/je-bedrijfsnaam/'
)
);
echo '
<script type="application/ld+json">
'.json_encode($data, JSON_UNESCAPED_SLASHES).'
</script>
';
}
@finalwebsites
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment