Schema Org Mapper
Schema.org Mapper turns the fields you already have into valid Schema.org structured data (JSON-LD) in the page <head> — without writing a line of code and without duplicating your content.
Search engines and AI assistants understand a page much better when it carries structured data: invisible markup that states "this is a Product", "this is its price", "this is its image". Producing that markup by hand is tedious and error-prone, and most solutions ask you to re-type information that already lives in your fields.
This module takes the opposite approach. You tell it what kind of thing each bundle is (Product, Article, Event, Place…) and where each value comes from (an entity field, a fixed value, or a token). The module reads your real content at render time and outputs the JSON-LD for you.
Guiding principle: read what is already there and map it — never invent data. A property with no source is simply not emitted, which keeps your markup aligned with the visible page as Google's structured data policies require.
Features
- Point-and-click mapping. A "Schema.org Mapper" tab on each bundle: add the types that apply and map every property from a select list of your fields. No JSON, no code.
- Curated catalog, not the whole vocabulary. 43 Schema.org types and 155 properties, selected from Google's structured data documentation (required + recommended) and ordered by the official Schema.org usage-statistics dataset, so the most-used types come first. The catalog is a single YAML file — adding a type or property needs no PHP.
- Three sources per property: an entity field, a fixed value (e.g.
USD), or a token (e.g.[node:title],[site:name]), including combinations. - Nested objects at any depth —
offers → priceSpecification → referenceQuantity,brand,address,geo,aggregateRating… rendered as collapsible sections. A child object is only emitted when at least one of its sub-properties has a value, so you never get empty{"@type": "Offer"}stubs. - Ordered multi-value lists for
FAQPageandBreadcrumbList: either a repeater field (Paragraphs / entity reference — one item per referenced entity, reading its own fields) or parallel multi-value fields aligned by delta.positionis numbered automatically. - Schema for pages that are not nodes. Custom block types emit their JSON-LD on the pages where the block is placed — the practical way to describe a home page or landing built out of blocks.
- Listing pages (Views). A display extender adds a "Schema.org: JSON-LD" setting next to Meta tags on any view display: page schema (
CollectionPage/WebPage) plus anItemListbuilt from the result rows — the format Google can turn into a carousel. Works with any row style, Fields or rendered entity/teaser. - Automatic normalization. Image/file → absolute URL; media reference → the file URL; entity reference → canonical URL or label; link → URL; date → ISO-8601; rich text → clean plain text; numbers and prices → the exact format Google expects.
- Output control: a single
@graphwith every type (recommended) or one JSON-LD block per type. - Modular by design. The base module is only the engine (it depends on Field alone). Each place you can configure is a thin submodule — enable only what you use. New entity support is a submodule implementing one hook, with no change to the base module.
- Multilingual-ready and safe. All interface strings run through
t(); output is escaped so content can never break out of the script tag; render cache tags invalidate the markup when configuration changes.
When would I use it?
- An online shop that needs
Product+Offer(price, currency, availability, shipping, returns) taken from the fields it already has. - A blog or magazine that wants
Article/BlogPostingwith author, publisher and dates. - A travel, real-estate or directory site describing places with
Place/TouristAttraction/LocalBusiness. - Any site that needs
FAQPage,BreadcrumbList,Event,Recipe,JobPosting,VideoObject… - A home page or landing page assembled from blocks and views, where there is no node to hang the markup on.
Post-Installation
Enable the base module plus the submodule(s) for the entities you want to configure — the base module on its own adds no tabs, it is only the engine:
- Schema.org Mapper — Content types (nodes)
- Schema.org Mapper — Taxonomy (term pages)
- Schema.org Mapper — Block types (pages where the block is placed)
- Schema.org Mapper — Views (listing pages)
Then clear caches and configure:
- Go to the bundle you want to describe and open the Schema.org Mapper tab — for example Structure → Content types → (your type) → Schema.org Mapper (
/admin/structure/types/manage/YOUR_TYPE/schema). The same tab exists on taxonomy vocabularies and custom block types. - The tab starts empty. Under "Add a Schema.org type" pick the type that describes your content (Product, Article, Service…) and press + Add. You can add several types to the same bundle.
- A table of that type's properties appears. For each one choose an entity field or type a fixed value / token (the fixed value wins over the field). Leave "– do not output –" for everything you don't use.
- Nested objects (
offers,brand,aggregateRating…) appear as collapsible sections with their own sub-properties. - Save. Visit a page of that bundle and check the source for
application/ld+json, then validate the URL with Google's Rich Results Test.
For views, edit the view, and on the display you want (Page or Block) open Schema.org: JSON-LD — it sits next to "Meta tags" in the display settings. Choose a page type and optionally enable the ItemList built from the result rows.
Two read-only reference screens ship with the module: a Help page (/admin/help/schema_org_mapper) listing every supported type with its properties and a minimal JSON-LD example, and a status page at Configuration → Search and metadata → Schema.org Mapper.
Access is controlled by the "Administer Schema.org Mapper" permission.
Additional Requirements
None beyond Drupal core. There are no external libraries, no remote requests at runtime and no extra database tables — configuration is stored as plain config.
- Base module: core Field.
- Content types submodule: core Node.
- Taxonomy submodule: core Taxonomy.
- Block types submodule: core Custom Block (block_content).
- Views submodule: core Views.
Similar projects
Several modules cover Schema.org from different angles; the right choice depends on how you prefer to work.
- Schema.org Metatag builds JSON-LD on top of the Metatag module, with one submodule per type and values configured as metatag fields. If your team already lives inside Metatag defaults, it fits naturally there. Schema.org Mapper is standalone: it does not require Metatag, it maps directly to entity fields through a per-bundle mapping table, and it also covers block types and views.
- Schema.org Blueprints works the other way round: it uses Schema.org to model your site, creating entity types and fields from Schema.org types. That is ideal when you are starting a site from scratch. Schema.org Mapper assumes your content model already exists and simply maps it, so it can be added to a mature site without touching its fields.
- Modules that load the entire Schema.org vocabulary at runtime give you every possible type at the cost of weight and a large nested UI. Schema.org Mapper ships a curated, version-controlled catalog instead: fewer types, ordered by real-world usage, with the properties Google actually documents for rich results.
Recommended modules/libraries
- Token — adds the token browser to the mapping form and enables field tokens such as
[node:field_price]. Core tokens (title, url, author, site…) already work without it. - Paragraphs — if your FAQs or lists are built as paragraphs, the repeater mode maps each paragraph to one list item.
- Metatag — complementary, not overlapping: Metatag handles meta tags and Open Graph, this module handles Schema.org structured data.
Commercial Support
This module is developed and maintained by Nelo.
The maintainer is available for professional consulting and architectural guidance related to structured data and technical SEO, Schema.org modelling, production Drupal implementations, and enterprise content architecture.
Supporting this Module
- Check out our sponsor, Dom Host Seo, who made this module possible with their support!
Issue reports, patches, reviews and test coverage are also very welcome in the issue queue.
Community Documentation
The module ships with its own in-site documentation: the Help page (/admin/help/schema_org_mapper) lists every supported type, its properties and a minimal JSON-LD example, and the README covers the full workflow with examples.
Verifying the output
Open any page of a configured bundle and look for application/ld+json in the source, or run this in the browser console:
Array.from(document.querySelectorAll('script[type="application/ld+json"]')) .map(b => JSON.parse(b.textContent));
Then validate the URL with the Rich Results Test. Note that some valid types no longer produce a classic rich result in Google (they are flagged with ⚠ in the interface) but remain useful for AI assistants; this module makes no promise about rankings or specific search features.