Code Blocks used in Articles CMS collections not part of API

Hey guys, i’m facing an issue where I’m using some of the CMS Collections data in other site that was not built with Webflow. Re-using mainly the CMS Collection data as articles to render it on the frontend. However when fetching data from https://api.webflow.com/v2/collections/:collection_id/items/:item_id, content is only the HTML structure but without the code blocks used in CMS. Instead of the code blocks and it’s code snippet the only thing I get is empty

 code.

this is what is returned in API:

and this is how it is used in webflow and what’s missing.
image

Anyone faced the same problem and can help? Thanks.

Hi there,

When working with code blocks in API responses from the Webflow CMS API, there are a few common scenarios to consider:

The code blocks should be properly formatted in your API response as part of the rich text field data. If you’re not seeing the expected content, try checking these common solutions:

  1. Verify that your API request includes the correct authentication headers and you’re using the latest API version
  2. Ensure you’re properly parsing the JSON response, as code blocks are typically nested within the rich text field structure
  3. Check the response format in your API documentation to confirm you’re accessing the correct path to the code block content
  4. Use the API playground in your project settings to test the endpoint and examine the raw response structure

You can also reference the CMS API documentation for detailed information about response formats and field structures.

Hopefully this helps! If you still need assistance, please reply here so somebody from the community can help.

Hi @Lukas_Martincek - unfortunately at the moment, code blocks support via the API (inserting and reading) is still on our backlog to implement. If you want to use code blocks in CMS item rich text, you should add/maintain via the Designer CMS UI for now.

Keep an eye on our Changelog for updates!

Webflow’s CMS API strips out code snippets embedded in Rich Text fields, returning empty blocks. This is a known limitation—code blocks aren’t fully serialized via the API. To fix this, store code in separate plain text fields or use markdown-style formatting. You can also parse exported HTML or use shortcodes. For full support, consider contacting Webflow or submitting a feature request. This issue mainly affects headless or external frontends that rely on accurate CMS data rendering.