Schema.org metadata is one of the most crucial SEO optimization topics. It helps all major search engines understand and emphasize detailed information about a website's content. So, you can optimize your site to rank higher in search engines.
Almost every tool used for creating websites allows the implementation of metadata. All you need is access to templates containing HTML tags that catch your interest. For example, it could be a news website. When you organize and publish numerous news articles on your website, Google reads the meta data included in the listings (such as content type 'News,' date, title, author, etc.), and presents them in search results. This way, you become more visible.
In Drupal, data is generally managed by two modules; one is found in the core of RDF, and the other is created by the Schema.org Metatag community.
And today, we will focus on the Schema.org Metatag module. In this blog post, we will guide you through the steps of installing and configuring the Schema.org Metatag module for your Drupal website.
As Schema.org Metatag is technically a sub-module of the Metatag module, the Metatag module is required.
The Metatag module in Drupal simplifies the process of managing and optimizing meta tags. It allows you to manage the mapping and storage of data, enabling you to enter fixed encoded values or define patterns using tokens to explain where the data comes from.
The Schema.org Metatag module creates Metatag groups for each Schema.org object type and Metatag tags for the Schema.org properties associated with that object. It uses the JSON-LD format and allows for the configuration of field mapping through a convenient administration panel.
Step 1: Log in to Drupal.
Step 2: Schema.org Metatag Complete the download process using the download link.
If not already installed, install the Metatag module.
Step 3: Install the new plugin.
Menu > Modules > Install new plugin (/admin/modules/install) click to select the file you downloaded from your local computer, and proceed by clicking 'Continue' to complete the download process.
Step 4: Click to enable the newly added modules.
Schema.org Metatag adds over a dozen options to your list of plugins for various use cases. Select the checkboxes for the schema types that best suit your needs and click 'Install' at the bottom.
For example, for a news website with the content type 'news,' you can add the corresponding Schema.org Article.
Step 1: After enabling the appropriate schema tags for you, select Configuration > Search and metadata > Metatag from your menu.
Step 2: To add the schema to all Drupal pages, click the edit button on the right of Global. Additionally, we can add the schema to specific pages; let's configure it for the 'news' content type.
You can edit what is needed to generate the desired output for this node. If possible, stick to the defaults for the site-wide settings.
Step 3: Select 'Save Configuration' at the bottom.
When configured in this way, the JSON-LD on each node will automatically include values matching the displayed content.
<script type="application/ld+json">{
"@context": "http://schema.org",
"@graph": [
{
"@type": "Article",
"description": "Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Donec sollicitudin molestie malesuada. Donec rutrum congue leo eget malesuada. Nulla quis lorem ut libero malesuada feugiat. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui.",
"datePublished": "2009-11-30T13:04:01-0600",
"dateModified": "2017-05-17T19:02:01-0500",
"headline": "Curabitur arcu erat]",
"author": {
"@type": "Person",
"name": "Minney Mouse",
"sameAs": "https://example.com/user/2"
},
"publisher": {
"@type": "Organization",
"name": "Example.com",
"sameAs": "https://example.com/",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/sites/default/files/logo.png",
"width": "600",
"height": "60"
}
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/story/example-story"
},
},
]
}</script>
After configuring your structured data output, you need to validate it and address any issues that may arise.