• Resolved mikeywil

    (@mikeywil)


    Your plugin works a treat – one query…

    I think that it is highlighting words (i.e. stopwords) that the WordPress search functions are purposely ignoring. See get_search_stopwords (see also parse_search_terms).

    Is there a way to make the plugin match the core behaviour? i.e. not highlight words like ‘this and ‘that’. (I also think that ‘and’ is worth considering for exclusion.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mikeywil

    (@mikeywil)

    Scratch that! I think the plugin is doing this as I expected it should.

    It seems that it is just the word ‘and’ that is not a default stopword and so was confusing me.

    (TBH, I can’t see why ‘and’ isn’t a default stopword – but of course that’s not down to your plugin)

    • This reply was modified 3 years, 2 months ago by mikeywil.

    Hi Mikey, the plugin does not alter the search terms, it only (re)uses the terms after they are treated by the WordPress internal search function.

    It does indeed look like the words “this” and “that” are actively stripped from the search if other terms are present (not when it’s the only term) so this plugin also should not highlight them… As far as I can see, the word “and” is always included in the search.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can we stop highlighting Stopwords’ is closed to new replies.