Should HTML be included in the structured data (schema) markup for the main body content?
-
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!
-
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/ -
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
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.
Related Questions
-
Content From API - Remove or to Redirect ?
Hi Guys,
Intermediate & Advanced SEO | | PaddyM556
I am working on a site at the moment,
Previous developer used a API to pull in HealthCare content (HSE) .
So the API basically generates landing pages within the site, and generates the content.
To date it has over 2k in pages being generated.
Some actually rank organically and some don't. New site being launch: So a new site is being launched & the "health advice" where this content used to live be not included in the new site. So this content will not have a place to be displayed. My Query: Would you allow the old content die off in the migration process & just become 404's
Or
Would you 301 redirect the all or only ranking pages to the homepage ? Other considerations, site will be moved to https:// so site will be submitted to search console & re-indexed by Google. Would love to hear if anyone had similar situation or suggestions.
Best Regards
Pat0 -
Content update on 24hr schedule
Hello! I have a website with over 1300 landings pages for specific products. These individual pages update on a 24hr cycle through out API. Our API pulls reviews/ratings from other sources and then writes/updates that content onto the page. Is that 'bad"? Can that be viewed as spammy or dangerous in the eyes of google? (My first thought is no, its fine) Is there such a thing as "too much content". For example if we are adding roughly 20 articles to our site a week, is that ok? (I know news websites add much more than that on a daily basis but I just figured I would ask) On that note, would it be better to stagger our posting? For example 20 articles each week for a total of 80 articles, or 80 articles once a month? (I feel like trickle posting is probably preferable but I figured I would ask.) Is there any negatives to the process of an API writing/updating content? Should we have 800+ words of static content on each page? Thank you all mozzers!
Intermediate & Advanced SEO | | HashtagHustler0 -
Schema markup concerning category pages on an ecommerce site
We are adding json+ld data to an ecommerce site and myself and one of the other people working on the site are having a minor disagreement on things. What it comes down to is how to mark up the category page. One of us says it needs to be marked up with as an Itempage, https://schema.org/ItemPage The other says it needs to be marked up as products, with multiple product instances in the schema, https://schema.org/Product The main sticking point on the Itemlist is that Itemlist is a child of intangible, so there is a feeling that should be used for things like track listings or other arbitrary data.
Intermediate & Advanced SEO | | LesleyPaone2 -
What is the best URL structure for categories?
A client's site currently uses the URL structure: www.website.com/�tegory%/%postname% Which I think is optimised fairly well, as the categories are keywords being targeted. However, as they are using a category hierarchy, often times the URL looks like this: www.website.com/parent-category/child-category/some-post-titles-are-quite-long-as-they-are-long-tail-terms Best practise often dictates (such as point 3 in this Moz article) that shorter URLs are better for several reasons. So I'm left with a few options: Remove the category from the URL Flatten the category hierarchy Shorten post titles two a word or two - which would hurt my long tail search term traffic. Leave it as it is What do we think is the best route to take? Thanks in advance!
Intermediate & Advanced SEO | | underscorelive0 -
What keywords should my main page contain ?
Hello. I have a domain with scripts and components for websites, each product page is somehow different and contains different phrases and keywords, for example: a) Flash Photo Gallery
Intermediate & Advanced SEO | | adrianTNT
b) JavaScript Menu
c) Flash Menu
d) PHP Rating Script
e) PHP Poll script It's kind of clear for me how to optimize keywords on these pages individually, but what would be best content / terms / keywords to use on my main page and main page title and anchor text to my root domain? Should it be a mix of all these keywords mentioned above ? Or is it better to be a general term like "website scripts" ?0 -
Local Business schema / markup
What markup should local businesses employ on their website? I'm aware of the newer schema.org markup but does Google still use rich snippets, geotags, etc.?
Intermediate & Advanced SEO | | BryanPhelps-BigLeapWeb0 -
Schema.org helps ranking?
Hello everybody! I want to know if Schema.org has any impact on ranking? Thanks!
Intermediate & Advanced SEO | | seomasterbrasil0 -
Duplicate Content On A Subdomain
Hi, We have a client who is currently close to completing a site specifically aimed at the UK market (they're doing this in-house so we've had no say in how it will work). The site will almost be a duplicate (in terms of content, targeted keywords etc.) of a section of the main site (that sits on the root domain) - the main site is targeted toward the US. The only difference will be certain spellings and currency type. If this new UK site were to sit on a sub domain of the main site, which is a .com, will this cause duplicate content issues? I know that there wouldn't be an issue if the new site were to be on a separate .co.uk domain (according to Matt Cutts), but it looks like the client wants it to be on a sub domain. Any help/advice would be greatly appreciated.
Intermediate & Advanced SEO | | jasarrow0