HTML converted to rich text / Schema Markup

I would like to add different FAQ schema markup to a CMS-pages.

Unfortunately, answers aren’t simply plain text as they contain ordered and unordered lists.

This is how I add them for non-cms based pages:

Now, to add them to CMS page I need to add FAQ answers as HTML text - but I’d like to use the same field as the answer displayed on the page.

How can I convert HTML from the Plain Text field to display properly on the page?

Unless there is a simpler way to get Schema Markup added to the page?

Thanks!

Hi Patryk, you really have 3 options-

  1. Store the entire schema as static text inside of a rich text CMS field inside of an HTML embed node. You get 100% control, and 100% variation between CMS items but it’s all static. Also not ideal if clients are editing this.
  2. Store the content you want in the schema in plaintext fields, so that you can use a page-level HTML embed and selectively insert those fields into the schema. More automated, but may involve content duplication. For Q&A schema this is often easier though.
  3. Build a script solution to compose the schema for you. This automates it but involves coding. In some cases, Google might not run & index these reliably. But it seems pretty reliable if the script is inline.

Thanks @memetican

  1. Store the content you want in the schema in plaintext fields, so that you can use a page-level HTML embed and selectively insert those fields into the schema. More automated, but may involve content duplication. For Q&A schema this is often easier though.

Do you know how can I turn HTML elements from plaintext fields to display correctly (i.e. ordered and unordered lists) on the page? I guess I need to add some piece of code here

If you really want list in you schema content I’d probably stick with HTML, which means option 1 or 3. Check Google specs on the schema you’re using, it ignores a lot of large HTML text fields in schemas.

I don’t think option 2 would work here because even if you manually format your plain text lists, it will likely be interpreted as a single line of text.

I’m not sure I understand the 1st option. If I store entire schema as static text inside of a rich text CMS field, I won’t be able to add it to the page body.

Rich text fields support an HTML Embed subfield. It’s on the same menu as inserting images, video, etc in your rich text content. You can store your schema inside of that HTML Embed sub-element.

To add it to your page, you just drop a rich text element and bind it to that rich text CMS field. That part of the content is delivered unedited, in raw form.

What I meant was that I won’t be able to add Rich Text field to body text here for the Schema to work.

You don’t add it there. Your CMS bound rich text field is already in the body.

Okay, I’m a bit confused how this would actually look like

In the CMS collection-

  • Rich text field

In the page-

  • Rich text element, bound to that Rich text field
  • You can mark it as display: none if you want ( but do not use visibility: hidden here )

In your CMS items

  • Edit that rich text field and add an HTML Embed. In that HTML embed, drop any JSON-LD script element and content you want.

I’ve made a fully attribute based solution for having your FAQs add as rich snippets without any additional coding. Here’s the code and the tutorial :slight_smile: #35 - Easily Add FAQ Schema/Rich Snippets | Webflow Powerups

1 Like

Hi Julian,

This looks great, but it’s not working for me: gotab can you take a look please?

Does it work with rich text field or only paragraph?

At it stands, it only works with plain text - however it can be adapted to work with rich text too. It would be a bit harder since rich text is actually a collection of HTML elements instead of just one.

Right, so it’s not really helpful tbh as I was asking about solution for the Rich Text field. How can this be adapted?

In my experience, the text field is always plaintext, not Rich Text/HTML… In this instance, I’d have the Ordered List in plain text just as 1) Item 1, 2) Item 2, ... I don’t think that having HTML in the text field in JSON-LD Schema.org is technically correct. But if you run it through https://validator.schema.org/ Snippet checker and it comes back good, then it’s good.