Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2328

[3.3.x] Support Forum • Re: Search excluding BBCodes - possible?

$
0
0
Well, if all else fails I can suggest a simple CSS kludge: just display: none; code tags inside search results. It won't deal with the root of the issue, but it should clean up the screen quite a bit. If you want code for that I can whip it up easily enough.

ETA: I got curious and did some searching. This may be useful: https://webmasters.stackexchange.com/a/133732
You can use the directive nosnippet:

Do not show a text snippet or video preview in the search results for this page. A static image thumbnail (if available) may still be visible, when it results in a better user experience. This applies to all forms of search results (at Google: web search, Google Images, Discover).

If you don't specify this directive, Google may generate a text snippet and video preview based on information found on the page.

Code:

<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 -->
Something like this should work:

Code:

<div class="codebox" data-nosnippet> Etc...<div class="signature" data-nosnippet> Etc...

Statistics: Posted by Gumboots — Thu Apr 17, 2025 8:21 pm



Viewing all articles
Browse latest Browse all 2328

Trending Articles