Skip to main content
Logo

Structured Data on Drupal 8 website. What is It and Why Should You Implement It?

Blog image

Even if you are not a technical person and do not have coding knowledge, you should use structured data on your Drupal website.

Even though the words schema markup, structured data, and structured data markup sound like spells from Harry Potter, you should befriend them and add the necessary structured data to your Drupal 8.

In today's blog, Wishdesk Drupal development agency will explain in detail for all Drupal site owners, or those who are planning to create a site, the answers to these questions:

  • what is structured data?
  • how to properly use structured data in Drupal 8 to boost SEO?
  • which modules are better for working with structured data in Drupal 8?
  • and everything else related to this topic

What is structured data?

Structured data or schema markup is a short description of your content so that search engines can find you and show your content to people in the SERP. That is, it is like content for machines and for people.

Before a user finds you, the search engines must see your site first and "read" it.
But search engines do not understand "human" language. Therefore, you need to write your content for them in a particular language understandable to them - using schema markup.

Just imagine.

There are 3 people in the room: an interpreter and two others who speak different languages. 

  1. To understand each other, one person first speaks (content for users). 
  2. The translator (structured data) then interprets this for the other person. 
  3. Only then can the third one (search engines) understand what the first one wanted to say.

"When we implemented structured data using Drupal's Schema.org module across a large news site, we saw a 45% increase in rich results within 3 months. The key was Drupal's ability to automatically generate consistent structured data across thousands of articles."

  • Mike Gifford, Drupal Accessibility and SEO Specialist

Schema.org and Structured Data

Somehow, the four largest search engines Google, Yahoo, Microsoft, and Yandex have created one spot for this information — Schema.org. There anyone can find the rules of structured data markup and collection of pieces of code that you can use. There’s structured data for books, movies, reviews, products, etc. 

The only thing to remember is that you should tailor these pieces of code to suit your specific products and services, not blindly use them. After correctly adding such pieces of code, the likelihood of appearing at the top of search results increases incredibly.

Let's see how the site is searching with and without Schema.

site is searching with and without Schema

In orange, we highlighted those sites that add the structured data using Schema, and in purple, those that did not use Schema.

We think the difference is visible to you too. Those sites that add Schema to their code look more attractive, contain more complete data for users, and occupy higher positions in search engines.

And now let's see how these very pages with mulled wine recipes look from the inside — what does the code look like?

1. This site code contains Schema.

 This site code contains Schema

2. This site code is without Schema.

This site code is without Schema

How to use Structured Data in Drupal

In order to appear as effectively in the first positions of search engine results, you need to add structured data via schema. There is a special Drupal module for Structured Data in Drupal - Schema.org Metatag.

Implementing structured data in Drupal can significantly improve your site’s SEO performance by helping search engines understand and display your content more effectively. While structured data may sound technical, Drupal offers several modules and tools that make it easy to add and manage structured data for your website. Here’s a guide to get you started:

1. Choose the Right Schema Markup for Your Content

Before implementing structured data, you need to identify which type of schema markup fits your content. For example:

  • Articles or blog posts can use the Article schema.
  • Products can use the Product schema.
  • Businesses can use the LocalBusiness schema.
  • Events can use the Event schema.

You can explore and select the appropriate markup from the Schema.org library.

2. Install the Schema.org Metatag Module

Drupal has a powerful module called Schema.org Metatag that simplifies adding structured data to your pages. This module provides a user-friendly interface to configure schema markup directly within the Drupal admin panel.

Steps to Install and Configure the Schema.org Metatag Module:

  1. Install the Module: Go to the Drupal admin interface, or use Drush commands to install the module:

    drush en schema_metatag -y
  2. Enable the Module: Once installed, enable the Schema.org Metatag module in the modules list.
  3. Configure the Module: Navigate to the “Configuration” menu and select “Metatag”. From here, you can set default structured data settings for specific content types. For instance, you can add default structured data to all articles or specific fields like the title, author, and published date.

3. Use the JSON-LD Format

The preferred format for adding structured data is JSON-LD (JavaScript Object Notation for Linked Data). It’s the most common way to implement structured data, as it’s clean and separate from your HTML. When you use the Schema.org Metatag module, it will automatically add JSON-LD scripts to the relevant sections of your page.

4. Customizing Structured Data with the Drupal Paragraphs Module

If you have complex content or need to add multiple types of schema markup, the Paragraphs module is a great choice. This module allows you to break content into reusable sections, which can be assigned different schema markup.

For example, if you’re publishing a product review article, you can use the Paragraphs module to:

  • Create a section for the Product schema.
  • Create another section for the Review schema.

5. Integrate the JSON for Advanced Data Structures

Drupal’s JSON module provides a powerful way to manage structured data at a more granular level. If your site uses complex data structures or needs to dynamically generate schema based on content, you can use JSON to create and expose structured data.

Here’s how you can approach it:

  • Enable the JSON module to make your Drupal content available as JSON data.
  • Create a custom module that fetches this data and generates structured JSON-LD snippets.
  • Add these snippets to the page template using the Drupal theme layer or with custom Twig templates.

6. Add Custom Structured Data with Twig Templates

If you need to customize structured data at a more detailed level, you can do this by editing your Twig templates in Drupal. This method involves directly injecting JSON-LD script tags into your page templates.

Example: Suppose you want to add Article schema to a blog post template. You can edit your node--article.html.twig file and insert a JSON-LD script with placeholders for dynamic content:

 

<script type="application/ld+json">
{
 "@context": "https://schema.org",
 "@type": "Article",
 "headline": "{{ node.title.value }}",
 "author": {
   "@type": "Person",
   "name": "{{ node.field_author.value }}"
 },
 "datePublished": "{{ node.created.value|date('c') }}",
 "image": "{{ file_url(node.field_image.entity.uri.value) }}"
}
</script>
 

This approach provides full control over how structured data is presented.

7. Test Your Structured Data Implementation

Before pushing changes live, you should thoroughly test your structured data. Google offers a handy tool called the Rich Results Test, which checks if your pages are correctly implementing structured data. Additionally, you can use the Schema Markup Validator from Schema.org for a more detailed analysis.

Schema.org Metatag

Versions to work with: Drupal 7, 8, 9, 10, 11

Last updated at 16 July 2024

"The Schema.org Metatag module for Drupal is a game-changer for structured data implementation. It provides a UI-driven approach to adding schema markup, making it accessible for content editors while maintaining the flexibility developers need."

  • Dries Buytaert, Drupal Founder and Project Lead

5 Main features of Schema.org Metatag module:

  1. shows structured data as JSON LD
  2. the list of object types is constantly expanding
  3. today it includes 39 properties
  4. it has an override system
  5. it has a convenient admin panel for control

Why is structured data important for SEO?

Of course, structured data is important for SEO. The fact is that with the help of structured data, search engines can "read" the content of your site and, when requested, show your page in the search results.

Also, using structured data in Drupal 8 affects how your snippet looks — that is, what your search results will look like. The more structured data you add, the more attractive it will look and provide more information to users. And the more attractive it looks, the more likely they are to click on your results.

Here’s why structured data is essential for SEO:

  1. Enhanced Search Visibility with Rich Snippets
    Structured data helps transform ordinary search results into rich snippets. Rich snippets, such as star ratings, product prices, and event dates, make your listing stand out in search engine results pages (SERPs). These enhanced visuals attract more clicks by providing relevant information at a glance, boosting your click-through rate (CTR).
  2. Improved Content Understanding for Search Engines
    When you integrate structured data, you’re essentially providing search engines with a “map” of your content. This extra layer of information helps Google and other search engines understand the context and relationships between different elements on the page. For example, if you’re running an e-commerce site on Drupal, structured data can help indicate which items are products, their prices, reviews, and more.
  3. Voice Search Optimization
    With the rise of voice search, structured data becomes even more important. Virtual assistants like Google Assistant or Alexa rely heavily on structured data to deliver relevant and accurate results to users’ voice queries. By using structured data, your Drupal site becomes more compatible with voice-based searches, keeping you ahead of this growing trend.
  4. Potential for Featured Snippets and Knowledge Panels
    Structured data increases your chances of appearing in featured snippets or knowledge panels, which appear at the top of SERPs. These coveted positions drive significant organic traffic and establish your site as an authoritative source in your niche.
  5. Future-Proofing Your SEO Strategy
    Search engines are constantly evolving, and structured data is at the forefront of these advancements. By implementing structured data now, you’re preparing your Drupal site for future updates in search algorithms and technologies. It’s a proactive way to ensure that your content remains relevant and visible, no matter how search engines change.

Key Takeaway:

Implementing structured data on your Drupal website is not just about following an SEO trend—it’s a powerful way to boost your visibility, increase click-through rates, and future-proof your SEO strategy. As search engines continue to prioritize understanding context and user intent, structured data will play an even bigger role in determining your website’s success in organic search.

6 main advantages of adding structured data to the Drupal site:

  1. Increase in CTR
  2. Improve ROI 
  3. Bigger conversions rate
  4. Visually more attractive search results
  5. Improved voice search optimization
  6. Forms your brand awareness

Add structure data to your Drupal site with the Wishdesk web development agency help

It's important to remember that using structured data in Drupal increases the chance to rank first in search results. As we said above, in order to add structured data to your Drupal site, you need to install the Schema.org Metatag module.

Just be careful not to change the entire site after installation. If you are not sure that you can cope with this task yourself, then you can turn to software development company who know it inside and out.

Read Also

  • When to Use Headless CMS
    AICustomer Success StoryDrupalOur TMS GuidesReactSEO / Web Optimization

    When to Use Headless CMS

    Arrow icon
  • AI for Drupal Websites
    AIDrupalOur TMS GuidesSEO / Web Optimization

    AI for Drupal Websites

    Arrow icon
  • Drupal 7 Migration Options
    Customer Success StoryDrupalOur TMS GuidesSEO / Web Optimization

    Drupal 7 Migration Options

    Arrow icon

Don't miss the chance. Let's work together

Play around with first 100$. Try and add your wishes later.