Add nofollow to facet links in Drupal 9

Small note about add rel="nofollow" attribute to the facet links.

Go to facet module folder src/Plugin/facets/url_processor/QueryString.php and after line 

$url->setOption('query', $result_get_params->all());

or

$url->setOption('query', $new_url_params);

add

$url->setOption('attributes', ['rel' => 'nofollow']);

 

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
The comment language code.