Title: Exclude keywords
Last modified: April 4, 2020

---

# Exclude keywords

 *  Resolved [tea23hah](https://wordpress.org/support/users/tea23hah/)
 * (@tea23hah)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/exclude-keywords/)
 * Hi there,
 * great plugin!
 * Is there a way to exclude certain words and symbols from the matching algorithm?
 * For example if you have a website covering apples, where every title contains
   the word “apple”, it would be nice if you could exclude the word “apple” from
   the matching algorithm so the output is more relevant. I know that right now 
   it would probably still look for other words matching, so “apple tree” would 
   still show posts with “apple tree” over “apple juice”, but if I could exclude“
   apple”, it would only show posts about “apple tree” instead of filling up the
   remaining spots with any post title containing the word “apple”.
 * Same for websites that include the date in the title of most of their articles.
   The algorithm picks two very relevant posts and then just fills the remaining
   spots with any title containing “2020”.
 * Hope that makes sense, thanks for your help!!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/exclude-keywords/#post-12676826)
 * Hi,
 * Unfortunately not. The mySQL matching algorithm prioritises both words and then
   the single words – which what you saw.
    I’ve not yet found a way to dynamically
   add stop words – I think a boolean mode search might work, but that drastically
   reduces the number of search results.
 * Are you comfortable editing the php files to give it a test?
 * [https://github.com/WebberZone/contextual-related-posts/blob/v2.8.0/includes/main-query.php#L412](https://github.com/WebberZone/contextual-related-posts/blob/v2.8.0/includes/main-query.php#L412)
 * Line to be replaced:
 *     ```
       $match = $wpdb->prepare( ' AND MATCH (' . $match_fields . ') AGAINST (%s) IN BOOLEAN MODE ', $stuff );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Exclude keywords’ is closed to new replies.

 * ![](https://ps.w.org/contextual-related-posts/assets/icon-256x256.png?rev=2985705)
 * [Contextual Related Posts](https://wordpress.org/plugins/contextual-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contextual-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contextual-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/contextual-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contextual-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contextual-related-posts/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/exclude-keywords/#post-12676826)
 * Status: resolved