Remove hidden elements from the DOM using conditional logic

In concrete terms, I use an accordion system to mimic an FAQ.

In my Shopify back office, I created meta fields (e.g. FAQ #3 — Question + FAQ #3 — Answer).

On the Instant side, I say that if the field "FAQ #X — Question" is empty, then we don't display it. Everything works fine.

Problem: you don't remove it from the DOM. So for Google, this is a very bad signal. There are H3s that are effectively empty when this type of case occurs.

In your logic, it is necessary to remove an element that you want to hide from the DOM.

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
💡

Feature Request

Date

13 days ago

Author

Louis — Topicimes

Subscribe to post

Get notified by email when there are changes.