Skip to main content

How to Add Schema Markup to Drupal Site?

Category: 
Published: 
Reading time
: 8 min

Schema.org metadata, or structured data, is a key search engine optimization element. Drupal has been supporting it since version 7. It is highly recommended to analyze metadata to improve your site’s visibility or monitor SEO effectiveness. Learn more about what structured data is, why it is crucial, and how to use the related Drupal module – Schema.org.

Structured data in Drupal

What Is Structured Data?

Metadata is information included in the code. It allows search engines to comprehend your site’s content and enables you to use features that make your website stand out in search results.

When implementing structured data in Drupal, you are equipped with three different formats: RDF, Microdata, and JSON-LD. Google recommends only the latter, and we will focus solely on it. JavaScript Object Notation for Linked Data (JSON-LD, in short) is the easiest data encoding method.

Metadata in Drupal – Why Is It Important?

There are a lot of various benefits from including diversified Schema.org data on your site:

  • improved adaptation to user expectations,
  • better marketing investments’ profitability caused by highlighting your website in search results,
  • bigger website competitiveness,
  • click-through rate growth,
  • boosted brand awareness,
  • optimized voice search, which is more and more often used to look for information,
  • improved conversion rate caused by better search engines’ content comprehension.

Drupal Metadata Examples

Now that you have learnt the definition of structured data, let’s move on to schema.org data types in Drupal.

  1. Schema Breadcrumb

    Structured data Schema Breadcrumb

    Schema Breadcrumb use in search results and code – an example 

    When using this type of metadata, you indicate the website’s navigation menu and display its position within the site’s hierarchy. It enables efficient motion between different levels of said hierarchy, starting with the last navigation menu element. This helps grasp your current position in the website structure and quickly reach the desired section.

    Navigation path example

    Navigation path scheme

  2. Schema Article

    You can use Schema Article to mark up the content section with blog posts and articles. While adding authors in the tags, apply the following tips to help Google recognize them:

    • in case of several authors, pinpoint each one in a separate author field;
    • enter only the author’s first and last name in the author.name field;
    • use type and url properties to help identify the given author. If it is a person, you can link their ‘about me’ website. If it is an organization, link to its home page;
    • remember to add every author in the tags;
    • use Person and Organization types, depending on who the author is.
    Structured data Schema Article

    Schema Article use in search results and code – an example 

  3. Schema Product

    This type of Schema.org data is extremely essential for e-commerce. It is divided into two main categories:

    • product descriptions - used in relation to products and their reviews. They can contain additional information such as price or availability;
    • product information - detailed data from the seller. The most frequently placed are: visual display of products available for purchase, Google Shopping knowledge panel, Google Images - product photos with additional descriptions.

    How to improve product search results?

    • add information on returns (rules, cost, waiting time, etc.),
    • indicate product availability,
    • provide delivery details, especially if it is free,
    • enable adding reviews and ratings to customers,
    • include the product’s pros and cons in the description.
    Structured data Schema Product

    Schema Product use in search results and code – an example 

  4. Schema Logo

    This type of Schema.org data helps the search engine determine the logo you want displayed in search results. We recommend following this short guidelines list for adding an image:

    • minimum size: 112 x 112 px,
    • image URL should be downloadable and indexable,
    • you must use one of the following Google Image formats: BMP, GIF, JPEG, PNG, WebP, or SVG.
    Structured data Schema Logo

    Schema Logo use example 

    If you are using the ImageObject type, remember to provide a valid contentUrl or url property, following the same guidelines as the URL type.

  5. Schema Organization

    It is a structured data schema that describes the company. You can apply it to showcase the organization’s name, logo, address, and other relevant information.

    The more tags you include, the better users can understand your site’s content. Incorporate as much information as possible, for example:

    • organization name,
    • description - accurate depiction,
    • logo,
    • your organization’s website url,
    • sameAs - URL address of pages on another website with information about your organization,
    • telephone - phone number,
    • email,
    • address - either physical or digital company address,
    • foundingDate - date of organization establishment in PT[H]H[M]M[S]S format. After PT (Period of Time), there are H (hours), M (minutes), and S (seconds).
    Structured data Schema Organization

    Schema Organization use in search results and code – an example 

  6. Schema FAQPage

    If you have Q&A sections on your subpages, consider using Schema FAQPage. Sites with frequently asked questions must be properly marked up. It allows them to be displayed with additional functions in search results. Your website can reach interested users thanks to features such as content snippets and responses in Google Assistant actions.

    Use the FAQPage Schema when there is no option for users to add their own answer. Otherwise, use QAPage.

    Also remember:

    • not to use FAQPage as an advertisement,
    • to include the entire question and answer in suitable markups,
    • full questions and answers should be directly available and visible to users visiting your website.
  7. Schema LocalBusiness

    If you’re operating locally, it is efficient to add the following schema metadata. It will help you share information about opening hours, various company departments, reviews, and more with Google.

    Structured data Schema LocalBusiness

    Exemplary simple business card for a local business.

    To use Schema LocalBusiness properly, Google requires two properties:

    • address - the company’s location. The amount of information affects results’ visibility - the more, the better,
    • company name.

    However, there are more options, including:

    • URL - link to the company’s website,
    • geo - company headquarters’ coordinates,
    • menu - applies to restaurants, and it is the menu’s URL,
    • openingHoursSpecification.closes - closing hours in hh:mm:ss format,
    • openingHoursSpecification.opens - opening hours,
    • telephone - the phone number by which customers can contact the company. Must include the country and area codes,
    • priceRange - up to 100 characters.

    When defining the locally operating company’s type, use the most specific subtype possible, for example, Dentist, HealthAndBeautyBusiness, TravelAgency, Restaurant, etc. If your business offers more than one service, list them in an array.

  8. Schema SoftwareApplication

    This type of structured data schema is used to describe applications. It presents clear information about different types of software, e.g., mobile apps. Schema SoftwareApplication includes numerous properties used to describe applications, such as name, depiction, version, category, system requirements, homepage link, etc. Add this schema to your Drupal site to provide precise data presentation about the application in search results.

    To use this structured data type, Google requires you to provide:

    • application name,
    • offers.price - application purchase cost; for free apps set “price”: ”0”,
    • aggregateRating or review - the first one applies to the average app rating, the latter to a single review.

    Apart from that, it is recommended to include operatingSystem to specify its requirements and applicationCategory to choose the application type from the list of supported ones.

    Structured data Schema SoftwareApplication

    Schema SoftwareApplication use in code and search results 

    Google supports extended app subtype properties, namely MobileApplication and WebApplication.

  9. Schema JobPosting

    This is a Schema type for describing job offers. They contain info such as job title, description, location, requirements, salary, publication date, and so on.

    Schema JobPosting helps display this data in a more attractive way, which increases the offer’s visibility and draws suitable candidates’ attention.

    Basic properties to include in Schema JobPosting:

    • title - job title,
    • description - job depiction,
    • datePosted - job offer publication date in YYYY-DD-MM format,
    • hiringOrganization - information about the job offering organization,
    • jobLocation - workplace location.

    Other included information welcome:

    • actual basic salary (baseSalary),
    • employment form (employmentType), e.g., FULL_TIME, VOLUNTEER, TEMPORARY,
    • offer availability time in YYYY-DD-MM format (validThrough).
    Structured data Schema JobPosting

    Exemplary job offer saved as JSON-LD code

    While using this schema metadata in job offers, search engines might display their snippets, for example:

  10. Schema Video

    This schema markup in Drupal is used to describe video content. It helps search engines with effective comprehension and indexation. Schema Video exploits various properties, such as title, description, duration, author, publication date, thumbnail, reviews, and comments. This way, the video is better tailored to user preferences and expectations.

    Schema Video requires:

    • name - video’s name,
    • thumbnailUrl - thumbnail’s file URL,
    • uploadDate - first publication date in YYYY-DD-MM format and time in HH:MM:SS format.

    Additional markups that might be helpful:

    • description - video depiction,
    • duration - video length in PT[H]H[M]M[S]S format,
    • interactionStatistic - play count.

    To label your video as “LIVE”, you need to add BroadcastEvent property in publication markup.

    Schema Video metadata

    By manipulating access to the video, you can set regionsAllowed and indicate countries where it can be watched. Without specifying the markup, the video is available without exception. Whereas, using expires, you set the video’s expiration date.

    Schema Video use

    An exemplary code and its display in search results

How To Use Drupal Schema.org Module?

There is a special Schema.org Metatag module available in Drupal. It enables adding Schema.org standards-compliant metadata to a website.

To start using the Schema.org Metatag module, you need to install it first:

1. Open a command prompt and enter: composer require 'drupal/schema_metatag:^3.0'. The module will be downloaded with version 3.0 or higher, compatible with Drupal 9 or later.

Schema.org Composer

Schema.org Metatag installation

2. Activate the module in the administration panel by going to the Extensions tab (at /admin/modules). You can also use the following command in the terminal: drush en schema_metatag.

After module installation, go to /admin/config/search/metatag (Configuration tab -> Search and metadata -> Metatag). Select the Settings tab. You will find metatags configuration options for various content types there, such as articles, pages, products, etc.

Structured data configuration

Metatags configuration options

Search for the right Schema.org metadata fields for the content types you’re interested in within the metatag configuration. You can add and customize these metatags for each content type, using available fields and options.

Metatags options

Once the schema configuration in Drupal is done for each content type, remember to save.

Finally, to ensure crawlers will interpret your website correctly, use Google’s Schema Markup Testing Tool. It allows you to check if your site’s code complies with the standards. We also recommend regular Google Search Console monitoring – microdata implementation issues are reported there. It is crucial to manage schema markups on your Drupal website for it to work properly.

Summary

Structured data implementation not only helps search engines with the site’s content comprehension, but also allows highlighting it in search results in an attractive way. Before implementation, consider which data types suit your site the best and choose the most beneficial ones. Deploying Schema.org Metatag module is worth considering, since it will simplify structured data management. If you encounter any problems while adding schema to your Drupal site, consider hiring Drupal developers who will provide help.

Rate entry
0