- Structured data in webflow

No way. Google scan the source code (cms if --hidden not remove the element node). It’s ok to put under reviews count the value 0 (of course u won’t get stars under search results).

1 Like

Hey @Siton_Systems really useful post thanks!

I’ve been trying to build custom FAQ schema using dynamic fields, and wanted to only run the schema for pages where I’ve added the CMS content (FAQ).

I have been trying to get this code working, but something is wrong - i don’t suppose you know any JS?!

For a list of items (list of articles, reviews, FAQ, and so on) easier to use microdata (Not JSON-LD) and custom data attributes (Not very complex because you add data-attributes only one time (one item) for the entire list).

** For now, no way to generate JSON list from CMS items (under custom code).

1 Like

Hi all, has anyone been able to successfully setup up Product Schema with product variants in webflow?

I have a problem adding structured data to my Webflow website.
I have a website with recipes and I have to add the ingredients to the structured data.
They need to be all separate and between “”.
So when fill in the ingredients in the text field I created for this the rendered code changes the " for "
Now I could replace this field and make a separate field for each ingredient but there are only 30 fields and the instuctions of the recipe has to be structured the same.
So I don’t have enough fields!
Does anyone have a solution for this problem?



I know I’m reviving an old thread here, but I thought I’d give some info on how to solve the issue @John_Wright posted about above.

Here’s how to add dynamically-generated structured data from within Webflow. Navigate to your template’s custom code, inside < head > tag field. This example adds structured data to my Post CMS model only if it has a Category of Recipe.

{{Category}} = my CMS field called Category

<script type="text/javascript">
if ("{{Category}}" == "Recipes") {
  var s = document.createElement("script");
  s.type = "application/ld+json";
  // escape double-quotes with backslash
  s.innerHTML = "{\"@type\": \"Recipe\", \"name\": \"{{Name}}\"}";
  var head = document.getElementsByTagName("head")[0];

If you want to add certain structured data fields conditionally, simply change how s.innerHTML is constructed.


Thanks for the solution Michael, i’m using a different one: Change JSON schema from CMS (content + type of schema) - #2 by Evan1

And here is how I expand a FAQ schema depending on the number of questions on the page (when you have a FAQ page and keep adding questions to your CMS):


(For some reason my code only shows in edit mode)

1 Like

Hi all!

Quick question, if I update a blog template with structured data, it will update the previously written blogs?

Or do I need to add the data manually one by one?

It’s for a client website, and I need to figure out the time it will take me to add a structured date.

Many thanks!

@Laura_Moreno, yes it should update all pages using the template.

Hello @Siton_Systems ,

In your Update of 2019, it seems you manage to pull Author and Categories from another collection (that is referenced in your post collection).

How do you do that? I have the Author & Category collections that are used in my BLog Post Collection, but I can’t access them in the Custom Code Editor.

Thanks for the help