Since you want to add this attribute only to custom URLs (those matching /user/*) within your content, you might have to write custom code, as I'm not aware of any module which does this.
You could use hook_preprocess_field() and then execute a regular expression to match your pattern and add the rel="nofollow"
attribute. However, this could be highly inefficient, as you have to do it every time you render a node, besides the fact that parsing HTML with regular expressions is not a bullet-proof solution.
There'sHere it's a module, however, that does something similarvery: Path Nofollow
Specify paths on which a metatag is added to prevent search engines from indexing the page.
So you could specify the path /user/* and it will add a metatag simple example that just adds rel="nofollow" to all links in the head of your htmlbody field <meta name="robots" content="noindex">
. As I said, not exactly the same, but(you will have to adapt it might help or complementto use your goal.
EDIT: Here's a code exampleown regular expression).
/**
* Implements template_preprocess_field().
*/
function MYTHEME_preprocess_field(&$variables) {
if ($variables['element']['#field_name'] == 'body') {
$markup = $variables['items']['0']['#markup'];
$variables['items']['0']['#markup'] = preg_replace('/href=/', 'rel="nofollow" href=', $markup);
}
}
Notice thatAnother alternative would be using the code above is a Path Nofollow module, that does something verysimilar simple example that just adds rel="nofollow" to all links in the body field;:
Specify paths on which a metatag is added to prevent search engines from indexing the page.
So you could specify the path /user/* and it will have to applyadd a metatag in the head of your own regular expressionhtml <meta name="robots" content="noindex">
. As I said, not exactly the same, but it might help or complement your goal.