Support » Plugin: Relevanssi - A Better Search » How html affects search.

  • Resolved gulliver


    I may have previously asked this (if so, I’ve forgotten and hence I’m sorry)… but is there a way to not have html tags affect what’s searched/returned?

    For example: on my site, the phrase ‘get updates by email or rss’ can’t be found because it contains html tags (the words ’email or rss’ are linked).

    I realise I can reword and/or move the html tags so as to not have this excluded, but there’s other instances (from memory, an ’em’ tag on a single word will similarly exclude stuff).

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari


    HTML tags do not affect the search at all – except for the phrase search. Phrase search looks at database directly and compares the search query to what is in the database, HTML and anything else included, and if there’s HTML code in the phrase, it’s not working.

    In the normal search, HTML tags are stripped off.

    This is a limitation in Relevanssi, and I’m not aware of a method to quickly strip off HTML in a MySQL query, so there’s really no economical solution to this – getting the post content for all possible results, stripping off the HTML and then comparing to it would be possible, but would slow down the search to a crawl, compared to the rather swift MySQL search. Another solution would be to also index the whole post, stripped from HTML, but that would mean a huge increase in the database size – not a good idea, either.


    Thanks for the comprehensive explanation.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How html affects search.’ is closed to new replies.