Rich text tag doesn't get updated in api results

Hello guys,

Here is my problem. I have a field which was a rich text field with no restrictions on it (the author could add a paragraph, a title from h1 to h6, a list, ...)

Now we need to accept only h1 and bold or italic for that field so I restricted the field to these tags in the custom type. So now whenever I check my documents, it shows in the editor that my field is a heading 1 so it is exactly what I need.

However, I still receive this field as a paragraph from the api results. It seems like the result was cached and changing the restrictions doesn't update the api results.
What I need to do to make the changes appear on my website / api results, is changing something on the field, publishing it and then remove those changes and re-publish. But I don't really want to do this to all my documents.

Is there something else I can do?

Hi @romain,

Thanks for posting this question!

I understand that you have a Rich Text field, which previously allowed all elements. You've changed the settings on that field so that it only allows h1, bold, italics. However, some documents still have the disallowed elements in them.

As you said, "changing the restrictions doesn't update the API results." This is correct and it is in fact expected behavior. The Custom Types only affect documents that you create and edit. Changing a Custom Type does not change its documents. This is to protect documents from getting changed inadvertently.

You are also correct that you can push the update by editing each document. If you want a faster way to do this, you can also use the Import/Export feature for bulk updates.

I hope that helps! Let me know if you have any questions.


1 Like

Ok thank you so much I will do that :slightly_smiling_face:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.