undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • SEO Q&A

      Insights & discussions from an SEO community of 500,000+.

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

Browse the forum for helpful insights and fresh discussions about all things SEO.

  1. Home
  2. SEO Tactics
  3. Intermediate & Advanced SEO
  4. Should HTML be included in the structured data (schema) markup for the main body content?

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

Should HTML be included in the structured data (schema) markup for the main body content?

Intermediate & Advanced SEO
3
3
808
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • RosemaryB
    RosemaryB last edited by Apr 4, 2016, 9:10 PM

    Lately we have been applying structured data to the main content body of our client's websites.  Our lead developer had a good question about HTML however.

    In JSON-LD, what is the proper way to embed content from a data field that has html markup (i.e. p, ul, li, br, tags) into mainContentOfPage. Should the HTML be stripped our or escaped somehow?

    I know that apply schema to the main body content is helpful for the Googlebot.  However should we keep the HTML?  Any recommendations or best practices would be appreciated.

    Thanks!

    1 Reply Last reply Reply Quote 0
    • Everett
      Everett last edited by Apr 10, 2016, 7:59 PM Apr 10, 2016, 7:59 PM

      As long as you're using the same Schema in both places I don't think it would hurt to have them both - JSON-LD in the HTML header and as structured data markup in the HTML where that entity exists on the page.

      You can play around with JSON-LD here to see what it would look like:
      http://json-ld.org/playground/

      1 Reply Last reply Reply Quote 0
      • RobertFisher
        RobertFisher last edited by Apr 5, 2016, 3:17 PM Apr 5, 2016, 3:12 PM

        Rosemary,

        People have a hard time with these questions because there can be more than one answer.

        --The answer is rough but I hope it makes sense.--

        I'd say it should be removed, although the best way to use that markup might be to mark up the actual html that is displayed rather than duplicating all of the "main content" inside of a JSON schema tag.

        Does it make sense for the JSON to look like below when you have the content already present on the page and could mark it up in the traditional tag format?

        |

        <scripttype="application ld+json"=""></scripttype="application>

        |
        | |

        {

        |
        | |

        "@context": "http://schema.org",

        |
        | |

        "@type": "WebSite",

        |
        | |

        "url": "https://www.example.com/",

        |
        | |

        "name" : "Example Group",

        |
        | |

        "alternateName" : "Example Enviro Group",

        |
        | |

        "potentialAction": {

        |
        | |

        "@type": "SearchAction",

        |
        | |

        "target": "https://www.example.com/?s={search_term_string}",

        |
        | |

        "query-input": "required name=search_term_string"

        |
        | |

        }

        "mainContentOfPage":"

        Lorem ipsum metus ullamcorper viverra. Aliquam

        Curabitur at lacus et quam scelerisque consequat. Vestibulum semper et ex quis commodo. Vestibulum lacinia ultricies neque et facilisis. Pellentesque feugiat luctus diam, et mollis elit posuere posuere. Nulla mattis libero lectus, at consequat sapien semper non. Duis lacinia mollis eros, in pulvinar enim interdum ac."

        |
        | |

        }

        |
        | | |

        Let me know if that helps... or not! Sorry for the layout issues, I think you will still get it.

        Robert

        1 Reply Last reply Reply Quote 3
        • 1 / 1
        1 out of 3
        • First post
          1/3
          Last post

        Got a burning SEO question?

        Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


        Start my free trial


        Browse Questions

        Explore more categories

        • Moz Tools

          Chat with the community about the Moz tools.

        • SEO Tactics

          Discuss the SEO process with fellow marketers

        • Community

          Discuss industry events, jobs, and news!

        • Digital Marketing

          Chat about tactics outside of SEO

        • Research & Trends

          Dive into research and trends in the search industry.

        • Support

          Connect on product support and feature requests.

        • See all categories

        Related Questions

        • Collegis_Education

          Schema Markup Validator vs. Rich Results Test

          schema structured data

          I am working on a schema markup project. When I test the schema code in the Schema Markup Validator, everything looks fine, no errors detected. However, when I test it in the Rich Results Test, a few errors come back.
          What is the difference between these two tests? Should I trust one over the other?

          Intermediate & Advanced SEO | Feb 4, 2024, 3:02 PM | Collegis_Education
          1
        • Alces

          JSON-LD schema markup for a category landing page

          I'm working on some schema for a client and have a question regarding the use of schema for a high-level category page. This page is merely the main lander for Categories. For example: https://www.examples.com/pages/categories And all it does is list links to the three main categories (Men's, Women's, Kid's) - it's a clothing store. This is the code I have right now. In short, simply using type @Itemlist and an array that uses @ListItem. Structured Data Testing Tool returns no errors with it, but my main question is this: Is this the _correct _way to do a page like this, or are there better options? Thanks.

          Intermediate & Advanced SEO | Mar 5, 2019, 3:14 PM | Alces
          0
        • Adido-105399

          Which Schema type for retirement homes?

          I have a client who sell retirement homes. Their current schema for each property is LocalBusiness - should this in fact be Product schema?

          Intermediate & Advanced SEO | Nov 26, 2018, 3:12 PM | Adido-105399
          0
        • NortonSupportSEO

          Is it possible to have organization markup schema for sub domain ? and how should it look like ?

          Can we have organization markup schema for subdomain ? For example if my main domain is xyz.com and subdomain is sub.xyz.com If i plan to have organization markup schema for subdomain how should it look like ? Should the markup schema must have main domain url or sub domain url in markup schema ? Should it be like this ?

          Intermediate & Advanced SEO | Mar 1, 2017, 4:16 PM | NortonSupportSEO
          0
        • admiral99

          Should I use https schema markup after http-https migration?

          Dear Moz community, Noticed that several groups of websites after HTTP -> HTTPS migration update their schema markup from, example : {
          "@context": "http://schema.org",
          "@type": "WebSite",
          "name": "Your WebSite Name",
          "alternateName": "An alternative name for your WebSite",
          "url": "http://www.your-site.com"
          } becomes {
          "@context": "https://schema.org",
          "@type": "WebSite",
          "name": "Your WebSite Name",
          "alternateName": "An alternative name for your WebSite",
          "url": "https://www.example.com"
          } Interesting to know, because Moz website is on https protocol but uses http version of markup. Looking forward for answers 🙂

          Intermediate & Advanced SEO | Dec 19, 2016, 2:25 PM | admiral99
          0
        • nchlondon

          Directory with Duplicate content? what to do?

          Moz keeps finding loads of pages with duplicate content on my website. The problem is its a directory page to different locations. E.g if we were a clothes shop we would be listing our locations: www.sitename.com/locations/london www.sitename.com/locations/rome www.sitename.com/locations/germany The content on these pages is all the same, except for an embedded google map that shows the location of the place. The problem is that google thinks all these pages are duplicated content. Should i set a canonical link on every single page saying that www.sitename.com/locations/london is the main page? I don't know if i can use canonical links because the page content isn't identical because of the embedded map. Help would be appreciated. Thanks.

          Intermediate & Advanced SEO | Sep 30, 2016, 8:16 AM | nchlondon
          0
        • Sika22

          PDF or HTML Page?

          One of our sales team members has created a 25 page word document as a topical page.  The plan was to make this into an html page with a table of contents.  My thoughts were why not make it a pdf?  Is there any con to using a PDF vs an html page?  If the PDF was properly optimized would it perform just as well?  The goal is to have folks click back to our products and hopefully by after reading about how they work.

          Intermediate & Advanced SEO | Apr 18, 2014, 3:16 PM | Sika22
          0
        • cprodigy29

          Where to link to HTML Sitemap?

          After searching this morning and finding unclear answers I decided to ask my SEOmoz friends a few questions. Should you have an HTML sitemap? If so, where should you link to the HTML sitemap from? Should you use a noindex, follow tag? Thank you

          Intermediate & Advanced SEO | Mar 21, 2012, 5:23 PM | cprodigy29
          0

        Get started with Moz Pro!

        Unlock the power of advanced SEO tools and data-driven insights.

        Start my free trial
        Products
        • Moz Pro
        • Moz Local
        • Moz API
        • Moz Data
        • STAT
        • Product Updates
        Moz Solutions
        • SMB Solutions
        • Agency Solutions
        • Enterprise Solutions
        Free SEO Tools
        • Domain Authority Checker
        • Link Explorer
        • Keyword Explorer
        • Competitive Research
        • Brand Authority Checker
        • Local Citation Checker
        • MozBar Extension
        • MozCast
        Resources
        • Blog
        • SEO Learning Center
        • Help Hub
        • Beginner's Guide to SEO
        • How-to Guides
        • Moz Academy
        • API Docs
        About Moz
        • About
        • Team
        • Careers
        • Contact
        Why Moz
        • Case Studies
        • Testimonials
        Get Involved
        • Become an Affiliate
        • MozCon
        • Webinars
        • Practical Marketer Series
        • MozPod
        Connect with us

        Contact the Help team

        Join our newsletter
        Moz logo
        © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
        • Accessibility
        • Terms of Use
        • Privacy

        Looks like your connection to Moz was lost, please wait while we try to reconnect.