Skip to main content

Schema.org SEO Configuration with Drupal

İdil CAN
İdil CAN Front-end Geliştirici
Drupal
5 min. read
drupal-schemaSeo

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.

Why Do We Need Meta Data?

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.

Metadata in Drupal

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.

Schema.org Meta Tag Module.

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.

Installing Schema.org Metatag Module from Drupal Interface

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.

Schema.org Metatag Configuration

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.

Example JSON-LD

<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>

Validation

After configuring your structured data output, you need to validate it and address any issues that may arise.

Our Offices

Drupart Locations

Our Officess

London

151 West Green Road, London, England

442038156478

[email protected]

Drupart R&D

GOSB Teknopark Hi-Tech Bina 3.Kat B3 Gebze - KOCAELİ

+90 262 678 8872

[email protected]

Newark

112 Capitol Trail Suite, A437 Newark DE, 19711

+17406666255

[email protected]

Wiesbaden

Hinterbergstraße 27
65207 Wiesbaden
Deutschland

+49 (0) 6151 – 492 70 23

[email protected]