The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. Should HTML be included in the structured data (schema) markup for the main body content?

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

    Intermediate & Advanced SEO
    3 3 375
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RosemaryB
      RosemaryB last edited by

      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
      • RobertFisher
        RobertFisher last edited by

        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
        • Everett
          Everett last edited by

          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
          • 1 / 1
          • First post
            Last post
          • Structured data: Product vs auto rental schema?
            effectdigital
            effectdigital
            0
            2
            611

          • Homepage organization schema question: logo lives on amazon server, can I call that out on the structured data?
            0
            1
            42

          • Is it necessary to use Google's Structured Data Markup or alternative for my B2B site?
            jessential
            jessential
            0
            5
            162

          • Need a layman's definition/analogy of the difference between schema and structured data
            BeanstalkIM
            BeanstalkIM
            0
            5
            581

          • Pros or Cons of adding Schema Markup via HTML or through Webmaster Data Highlighter
            Travis_Bailey
            Travis_Bailey
            0
            13
            827

          • Alternative HTML Structure for indexation of JavaScript Single Page Content
            FranktheTank-47497
            FranktheTank-47497
            0
            5
            184

          • Google's Structured Data Testing Tool? No Data
            MichaelC-15022
            MichaelC-15022
            0
            5
            1.7k

          • The system shows duplicate content for the same page (main domain and index.html). Is this an error of SEOMOZ?
            moskowman
            moskowman
            0
            12
            702

          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
          • Digital Marketers
          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 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
          • Accessibility
          • Terms of Use
          • Privacy