Zodiac1978 / wp-search-ignore-block-names

Modifies the native search to ignore block editor comments
https://wordpress.org/plugins/ignore-block-name-in-search/
GNU General Public License v2.0
4 stars 3 forks source link

Not working as expected #5

Closed Zodiac1978 closed 1 year ago

Zodiac1978 commented 1 year ago

Your solution doesn't work when the search term is in both tags and content. ex: this is a paragraph the post with this content doesn't get captured when searching for "paragraph" because of the AND clause in your query

See: https://core.trac.wordpress.org/ticket/56294#comment:5

Unfortunately I did not find a simple way to achieve this with MySQL below 8. Since MySQL 8 there is REPLACE_REGEXP which would solve this: https://stackoverflow.com/questions/986826/how-to-do-a-regular-expression-replace-in-mysql

See: https://core.trac.wordpress.org/ticket/56294#comment:6

I will try to get this working at least with MySQL 8+ (and with the according MariaDB version). If this works, there needs to be some MySQL version checking built in.