I want to add or remove a regex for comment URL filtering

Create a filter for the array with regexes:

spartashield_is_spam_website_regexes

This will sent the array $regexes, where you can modify it and return it ( don't forget to add "return $regexes;" in your function ).

Adding a new regex filter

Just add a new item:

$regexes[] = 'my_regex_to_add_here';

Deleting an existing regex filter

$del_val = 'my_regex_to_delete_here';
if ( ( $key = array_search( $del_val, $regexes ) ) !== false) {
	unset( $regexes[$key] );
}

Leave a Comment