Why isn’t my website’s accordion content getting indexed?
If Google isn’t indexing content revealed through user interactions like hover or click, it could negatively affect your SEO.
To address this and ensure Google indexes your accordion content, follow these steps to make it accessible to search engines and crawlers:
For the collapsed variant, set the height of the “Answer” layer to 0 and its opacity to 0. This makes the content visible to the browser but hidden from users.
For the expanded variant (when the content is visible to users), set the height to “Fit content” and the opacity to 1.
For a practical example and detailed guidance, you can remix the project here.