This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Exclude numbers from index

#55299
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Sebastian,

Special characters are automatically trimmed during indexing.

Excluding numerical strings from the index is only possible via a custom code:

add_filter( 'asp_indexing_keywords', function( array $keywords ) {
	foreach ( $keywords as $keyword => $data ) {
		if ( is_numeric($keyword) ) {
			unset($keywords[$keyword]);
		}
	}
	return $keywords;
});

Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

After adding the custom code a new index needs to be generated so the numerical values are excluded.