Any item show/hide/conditional that is based on a result from a query will be seen as part of the DOM by search indexing bots and especially Google. The bots have no way of interacting with the query nor do they wait around. They render the entire DOM. Google does offer a solution to this however but what you may need to do is remove all your pages that are affected in the Google Console and after applying the below fix request indexing again.
Using the data-nosnippet
HTML attribute
You can designate textual parts of an HTML page not to be used as a snippet. This can be done on an HTML-element level with the data-nosnippet
HTML attribute on span
, div
, and section
elements. The data-nosnippet
is considered a boolean attribute. As with all boolean attributes, any value specified is ignored. To ensure machine-readability, the HTML section must be valid HTML and all appropriate tags must be closed accordingly.
Examples:
<p>This text can be shown in a snippet <span data-nosnippet>and this part would not be shown</span>.</p> <div data-nosnippet>not in snippet</div> <div data-nosnippet="true">also not in snippet</div> <div data-nosnippet="false">also not in snippet</div> <!-- all values are ignored --> <div data-nosnippet>some text</html> <!-- unclosed "div" will include all content afterwards --> <mytag data-nosnippet>some text</mytag> <!-- NOT VALID: not a span, div, or section --> <p>This text can be shown in a snippet.</p> <div data-nosnippet> <p>However, this is not in snippet.</p> <ul> <li>Stuff not in snippet</li> <li>More stuff not in snippet</li> </ul> </div>
Google typically renders pages in order to index them, however rendering is not guaranteed. Because of this, extraction of data-nosnippet
may happen both before and after rendering. To avoid uncertainty from rendering, do not add or remove the data-nosnippet
attribute of existing nodes through JavaScript. When adding DOM elements through JavaScript, include the data-nosnippet
attribute as necessary when initially adding the element to the page's DOM. If custom elements are used, wrap or render them with div
, span
, or section
elements if you need to use data-nosnippet
.
The above is taken from the Google Developer documentation
We would use no-snippet on items such as breadcrumbs and navigation, infact anything that you do not want displayed in the 'snippet' Google displays in results, just to air on the side of caution no-snippet all the things aside from the text you want displayed in the results.
If the above Google example makes not a lot of sense here is another for you:
<h3 data-nosnippet="true">We DO NOT WANT this displayed in Google results </h3>
<h3>We WANT this displayed in Google results </h3>
Hope that helps @scott. If you have any questions just ask as we have became quite the SEO experts over the past twelve months or so.