To insert a JSON-LD schema.org markup in the head section of your website, you can follow these general steps:
- Write the JSON-LD markup in a separate file, or directly within the
<head>
section of your web page. - Use a script tag with a type attribute set to “application/ld+json” to wrap your JSON-LD markup.
- Insert the script tag into the head section of your HTML document.
Here’s an example of how you can insert a JSON-LD schema.org markup in the head section of a web page:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "My Company",
"url": "https://www.example.com/",
"logo": "https://www.example.com/logo.png",
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-555-555-1212",
"contactType": "customer service"
}
}
</script>
</head>
<body>
<!-- rest of your web page content -->
</body>
</html>
If you’re using WordPress, you can insert the JSON-LD markup in the head section of your web page in several ways. One way is to use a plugin that allows you to insert code snippets into the head section of your web page. Some popular plugins for this purpose include “Insert Headers and Footers” and “Header and Footer Scripts”.
Alternatively, you can use a WordPress theme that supports adding JSON-LD markup directly into the head section of your web page. Check your theme’s documentation to see if it supports this feature, or consider switching to a theme that does.
I use the seo plugin named Seopress that has a lot of interesting function included the schema markup tool.