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
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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
-
Why do sites w/o structured data beat me for rich snippets?
I can't figure this out. For a number of search terms that I compete for, there are competitors that rank below me, but their pages are featured in a rich snippet. I wanted to see what kind of structured data these sites are providing, thinking maybe there's something I can learn. But when I run these URLs through Google's Structured Data Testing Tool, it tells me these pages contain no structured data! So how is it that Google think's my page is more relevant (I rank higher) and I have structured data, but Google chooses to feature a different page? Does anyone have ideas on how I can snag these rich snippets for myself?
Intermediate & Advanced SEO | | AlexLenhoff0 -
Where is sitelinks getting its data from?
Hi, This is an issue that is really upsetting my client. There are sitelinks that are coming up when you search for his business that aren't relevant as the other pages are! I assured him that there is nothing for me to do about it besides for demoting a sitelink, which is simply a suggestion in Google's eyes. 1. I would love to know why they are choosing the titles they are publishing, which is the shortened version of states? Where are they getting it from? I don't have any linking pages with such anchor text. The only thing I can think of is that there is a clickable map that has abbreviated words of that state. Would that do it? How could I change it? 2. Also, why are they choosing pages that are really not the top visited pages on my website instead of the pages that visitors are really interested in? Here is a snapshot of the issue: http://screencast.com/t/9w9C3DPAHvYb Thanks!
Intermediate & Advanced SEO | | Rachel_J0 -
How to avoid duplicate content
Hi there, Our client has an ecommerce website, their products are also showing on an aggregator website (aka on a comparison website where multiple vendors are showing their products). On the aggregator website the same photos, titles and product descriptions are showing. Now with building their new website, how can we avoid such duplicate content? Or does Google even care in this case? I have read that we could show more product information on their ecommerce website and less details on the aggregator's website. But is there another or better solution? Many thanks in advance for any input!
Intermediate & Advanced SEO | | Gabriele_Layoutweb0 -
Need help with duplicate content. Same content; different locations.
We have 2 sites that will have duplicate content (e.g., one company that sells the same products under two different brand names for legal reasons). The two companies are in different geographical areas, but the client will put the same content on each page because they're the same product. What is the best way to handle this? Thanks a lot.
Intermediate & Advanced SEO | | Rocket.Fuel0 -
What is Structured Data and how to add it WordPress Blog Via Meta tags ?
Hi Friends, Can anyone please tell me what is Structured Data and how to add it to WordPress blog via meta tags because I don't want to show on my blog but show in Google Search. Is there any helpful plugin or some codes? Then please help me to sort it out this problem. Thanks, OM1YI
Intermediate & Advanced SEO | | KLLC0 -
HTTPS Duplicate Content?
I just recieved a error notification because our website is both http and https. http://www.quicklearn.com & https://www.quicklearn.com. My tech tells me that this isn't actually a problem? Is that true? If not, how can I address the duplicate content issue?
Intermediate & Advanced SEO | | QuickLearnTraining0 -
Duplicate Content Help
seomoz tool gives me back duplicate content on both these URL's http://www.mydomain.com/football-teams/ http://www.mydomain.com/football-teams/index.php I want to use http://www.mydomain.com/football-teams/ as this just look nice & clean. What would be best practice to fix this issue? Kind Regards Eddie
Intermediate & Advanced SEO | | Paul780 -
Geo-Targeting Content
I'm to get some ideas on restructuring existing content for geo-targeting. Example: Botox Page Tis is a hypothetical situation -- laser cosmetics clinic in Atlanta trying to rank for Atlanta Botox. The existing content is general information about botox procedures. The problem is editing the content to add Atlanta to the H1 tag and page copy. I'm wondering if there are some techniques to make the edits flow better? My idea is to add a geo-page for each procedure, but I'm wondering if this might interrupt or confuse users in the navigation funnel. Your thoughts? Thanks!
Intermediate & Advanced SEO | | 190west0