Title: Plural &#8216;s&#8217;
Last modified: April 23, 2017

---

# Plural ‘s’

 *  Resolved [emyosv](https://wordpress.org/support/users/emyosv/)
 * (@emyosv)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plural-s/)
 * Hi,
    What is the code to truncate the final ‘s’ (or ‘es’) of a search query so
   that the singular form of the word show up even if the user typed a plural form.(
   Vice versa is not a problem because it falls back to fuzzy search.) Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plural-s/#post-9059783)
 *     ```
       add_filter('relevanssi_remove_punctuation', 'relevanssi_remove_s', 9);
       function relevanssi_remove_s($term) {
       	$end2 = substr($term, -2, 2);
       	if ("es" == $end2) {
       		$term = substr($term, 0, -2);
       	}
   
       	$end1 = substr($term, -1, 1);
       	if ("s" == $end1) {
       		$term = substr($term, 0, -1);
       	}
   
       	return $term;
       }
       ```
   
 *  Thread Starter [emyosv](https://wordpress.org/support/users/emyosv/)
 * (@emyosv)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/plural-s/#post-9059854)
 * Thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plural ‘s’’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

## Tags

 * [plural](https://wordpress.org/support/topic-tag/plural/)

 * 2 replies
 * 2 participants
 * Last reply from: [emyosv](https://wordpress.org/support/users/emyosv/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/plural-s/#post-9059854)
 * Status: resolved