Is having two separate rel=”” attributes in an a tag OK?
It seems WordPress by default adds a rel=”nofollow” tag to all external links. In the code these are added to the very beginning of the a tag.
In order to add rel=”me” attributes to my social profiles on my About page (where my rel=”author” links point to), I’ve added some tweaks as suggested by Yoast.
The resulting code looks as follows:
<a rel="nofollow" title="XYZ" href="http://link.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://link.com']);" rel="me nofollow">Google Profile</a><br />
Note the rel=”nofollow” at the beginning, and then the rel=”me nofollow” towards the end of the a tag. The attributes at the end are hand-coded, the initial one is the WordPress default.
Is having two instances of rel=”” acceptable? If so, should I get rid of the duplicate nofollow attribute in the second one?
I’m not seeing my blog properly linked to my Google Profile, checked via Google’s SGAPI Recrawl Tool, however the attributes seem to have been picked up by the Rich Snippets testing tool.
You can use the w3c Validator tool to tell whether html is valid. Duplicate attribute names are invalid html. Get rid of the first one and just use your second tag.