Here's a couple of example links; the first is a link to the White House's website, the other is to Distilled's new US website.
Both links follow the same structure: an opening <a> tag which can include a variety of attributes, the content of the link (the 'clickable' part or 'anchor text'), and the closing part of the anchor tag, </a>.
For each part of an HTML link mentioned below, I've indicated which are of interest from Search Engine Optimisation (SEO), User Interface (UI) and User Experience (UX) perspectives.
Attributes
There's a variety of parameters that appear in anchor tags - some are required, some are optional and some are almost never used. They're each of interest to different people, and they are:href - the 'destination' of the link (SEO UX)
eg: href="https://moz.com/seminar/series"
As seen in both examples above, the href (which probably stands for 'hypertext reference') is the destination URL if the user clicks on the link. For links to pages in the same site, SEOmoz recommends giving the full URL including https:// and domain name here (the 'absolute' URL.) For a breakdown of the individual parts of a URL, I'd recommend the Anatomy of a URL cheat sheet.
The href can also be set to 'mailto:[email protected]', providing a link which usually launches the visitor's email client. I have mixed feelings about the use of this feature, and recommend that if you do use it, then it's made clear to the user what the link will do (There are examples below of how this can be done.)
rel - the relationship of the linked page, to the linked-to page (SEO UI UX)
eg: rel="nofollow"
As SEOs, we most often see this when it is set to 'nofollow' (required by Google to identify paid links) but it has a variety of other potential uses. The list of values that can be used here will be expanded in HTML5, and currently includes 'alternate' (intended for pointing to page mirrors, print versions, etc) and 'previous' / 'next' (for navigating paginated lists; some browsers may always display 'next' links in the same way to make browsing easier, or preload the next page to make browsing faster.)
target - the window in which the link should open (UX)
eg: target="_blank"
This attribute was particularly useful when sites were built using frames; it's now most often see when set to '_blank', which instructs the web-browser to open the link in a new window (or more often now: a new tab). I'd recommend not using this feature, and letting the user decide which links they'd like to open in a new tab.
class / id - most often used for applying CSS styles (UI UX)
eg: class="menu decorated"
Like most HTML elements, links can be given class or id attributes - these are typically used to apply styles to the link using CSS. One particular use case here may be to add a small icon to mailto: links, indicating that they'll open a blank email rather than a webpage.
Links benefit in particular from the :hover and :visited pseudo-classes in CSS. Allowing links to have a different style when they've already been visited or when the cursor is hovering over them gives opportunity to improve the user interface and the user experience.
title - the 'tooltip' of the link (UI UX)
eg: title="Find out more about the next SEOmoz seminar"
The text given in the title attribute of a link usually appears in a floating box, when the cursor is held over the link. This can be used to give the user more information about the destination page. Again: it could also be used to highlight if a link is going to launch an email client.
Anchor Text
(SEO UI) A critical part of the link for SEOs - most search engines use the anchor text as a key way of passing relevance for a particular term to a destination page.
If a link has an image rather than anchor text, it doesn't mean you have to miss out on passing term relevancy to your destination page. Image tags can have an 'alt' attribute - this is the text which will show up if the image cannot be displayed. In most cases, search engines will look at this text, and use it as a substitute for other anchor text.
eg: alt="SEOmoz Homepage Logo"
If you aim for the alt text to match any text in the image and avoid the temptation to stuff keywords here, then you should see very similar benefits to using a straight text link.
Example & Obvious Hint
Put all this together, and what have you got? Something that looks like this:HTML:
<a href="https://twitter.com/RobOusbey" rel="author" title="Follow Rob on Twitter">Rob Ousbey</a>
Rendered as:
Please feel free to follow me, Rob Ousbey, on Twitter.
I always find it so hard to understand how people give such summary thumb downs to articles that are written. I realize I put myself at risk for being thumbed down for saying that but for cryin' out loud people, writing is NOT easy work!
While this post is on the basics, I always love having the basics spelled out. Even if I don't need the info at this moment, there will come a time that I need to teach someone I work with about them and it's so convenient to point them here. So I give it a thumbs up Rob.
That said, perhaps it might have fit in better over at Danny's Peer Review Wiki?
Nice post, very useful information.
A basic post but it's helpful to beginners :) Thanks
Rob
For the href attribute you state that -
Before I get too carried away revisiting internal links on our site can I just confirm that this really is current 'best practice' thinking? Other than an example within your post I cannot find evidence of this practice at work on this SEOmoz page. Take for example the previous/next blog links at the base of the page. They read:
a href="/blog/testing-how-crawl-priority-works">Testing How Crawl Priority Works
a href="/blog/personalization-of-google-results-creates-a-huge-advertising-opportunity">Personalization of Google Results Creates a Huge Advertising Opportunity
Is there another resource on the site that addresses this aspect of link structure?
Whistles in the wind... :-)
Hi Dave,
Not sure how I missed this comment first time around, sorry.
To be more specific: I'd recommend absolute links in post/page/feed content in particular (so that any scraped content maintains the links back to you). For 'navigational' links, there's a variety of reasons why absolute links are still useful, such as making sure link juice flows to the canonical domain (eg: if you have a number of (sub/)domains that resolve to the same content).
I don't want to second guess why the SEOmoz devs didn't use absolute links in their navigation, but I know that they have avoided any duplication/canonicalisation issues, so the reason above doesn't provide as much benefit.
It's worth mentioning the big reason for using relative links: it makes the site 'portable' and easy to test on development servers, etc. If you're anticipate needing to test/run the site at a variety of domains, and there's no way to simply configure the base URL, then relative URLs may be your only option.
Upshot is: there's no harm in absolute links, and if you can get in the habit of using them in post content, you have nothing to lose.
Thanks for the clarification Rob, this is something for me to think on further.
Hey Rob - from our experiences, the "title" attribute of a link carries no weight/importance in search engines, but I wonder if others have different thoughts/data?
It's a question that comes up repeatedly in the SEO world for some reason.
Mine it's simply an empirical consideration based on an experiment once I did in a large website.
Once adjusted the most important on page factors (no the link title), I stopped to see what metrics where going to tell me. And obviously there were big advancements.
Then, as far as I wanted to correct some W3C issues, I put to all the Links the Title attribute. After the same period of weeks waiting, the metrics were not pointing to any real and substantial SEO plus.
Therefore, I do not think that the TITLEs carry any weight/importance on the SEO side.
It could be somehow interesting if used as a place where to put a subtle call to action. For instance, in a link which anchor text is "Ford Fiesta on sale" the title could be "Change your old car for a new Ford Fiesta".
But, as said before, mine are mostly empirical and absolutely not scientifically conducted experiments.
I also think, that for ranking the title attribute doesn't have much weight if any.However I do believe, that it adds to a good user experience, and therefore adds to site quality. So I wouldn't be surprised, that in some way it will be a factor in the future, given the current devellopments like site speed and more.That said, I think that it is good practice to use title attribute for the sheer purpose of increasing user experience and thus conversion rates. I realize the increase will be only marginally, but I feel it's worth the effort.
Agreed,
I don't think "title" attribute of a link carries any weight in SEO, many experts tested it and confirmed it too.
But, having "title" attribute won't do any harm too.
"It's a question that comes up repeatedly in the SEO world for some reason."
I imagine that the sight of text so closely associated with a link might make people feel that it had some impact.
I've neither seen nor collected any data that says it has an effect on rankings, and can't see any particular reason that search engines might want to give it weight in their calculations.
With Yahoo fading out in the near future, I feel Bing is going to be worth giving more consideration to. Because of this I have spent more time recently at the Bing Community.
More specific to this topic, check out the post “Making links work for you (SEM 101)”, and in particular this section:
This is not to say that Google or Ask feel the same way, but after the bing-hoo merger this may affect around 25% of a websites potential search traffic.
FYI - I also just noticed that the SEOmoz comment box allows for Title attributes for links in comments...
Though I have no evidence to back up my claim, I have to disagree with the idea that the title attribute carries no importance. To me, it just makes good common sense to utilize it in order to have better on-page keyword ratios. You can call me crazy if you want to! :P
I don't see a problem with an article discussing the fundementals of a link. After all, links are at the heart of SEO. Made me look up a couple of things and I discovered a couple of tasty new titbits. For instance target is back in HTML 5 after being deprecated in xhtml.
Also, seeing rel up there inspired me to implement some microformat stuff on a new website.
https://microformats.org/wiki/reltag
URL vs. URI....
Agree, I think the title attribute - related to pictures - is of no importance for SEO.
I think It's no harm using title attribute for SEO
but it have positive impress for UX.
Thanks for this post. It's a good idea to remember each part of a href's structure.
I have tested title attribute on some of links (external, internal) but Google has never found my pages thanks content of this attribute... I think it is as useful as meta keywords...
Interesting post and a nice change from posts on how to get links and others like that, this is more 'technical'.
However, I do have a question about the rel="nofollow" attribute. You said it is required by Google to identify paid link. Isn't it just an attribute to prevent link juice flow? After all there are websites which link to their own content, SEOmoz included, and still put nofollow attributes and obviously, thats not a paid link. Just wanted to find out if I'm getting this wrong or there was more to your statement.
Thanks.
Hi Tola,
Yes, 'nofollow' has a murky history. The implied instruction to search engines (don't flow juice through the link) was touted as being a way of preventing spam in blog comments, etc. Google later co-opted it as their tag of choice for paid link exposition.
There's been various other reasons to use it over the past few years - page rank sculpting in particular (the practice of not passing link juice internally to pages of less consequence; it might be done so that a 'T&C' or 'login' page isn't given significant authority and helps search engines use the site's crawl allowance more effectively.)
The 'paid links' purpose it just one reason to see a link using nofollow, and you're quite right that there's a variety of other reasons.
Right, that make sense.
Thanks for explaining that!
I'd probably add that nofollows aren't effective for page rank sculpting anymore.
https://www.seomoz.org/blog/google-says-yes-you-can-still-sculpt-pagerank-no-you-cant-do-it-with-nofollow
Reading the comments, I realize that there may be a debate about using the title tag for SEO, but I do use it for web accessibility; however I thought to accomplish this, having the title tag match the target phrase is a better option. What are your thoughts on ensuring web accessibility and using the title tag for that reason?
Just to add to the experience of others here. I've personally tested using the title attribute (in a sample that is too small to be statistically significant) but from what I could see nothing lead me to believe Google uses it as a ranking factor.
I've also debated this with designers and unless your careful it is possible to take away from the site's accessability by using SEO friendly titles in anchors.
Interesting info about title links, even if they don't have a direct impact on a sites' optimisation, are they completely irrelevant? Can they have a negative impact on the seo of a site?
Once upon a time 1997 I have learned A tag at w3schools and I had no idea that in 12 years it will be science that will be cut on peaces and analyzed by elite SEO community on the most advances SEO website in industry.
the scary thing is, that if this post is useful to you, you probably want to start reading less advanced SEO resources - and come back to seoMoz in a few months.
sorry - but I dont feel that this post really ads anything for 99.99% of seoMoz readers.
MOGmartin
you did not feel irony in my tone?
Hello Rob,congrats on your company hooking up with SEOmoz. This was a good post; full of detail. I always enjoy back to basics. There seems to be something in there that someone like you and Distilled point out that iof benefit to us all.
My personal experience is that I Believe that the titles of Alt tags and links may be helpful in SEO, giving weight to a particular image or link. I have no scientific data to document this. My own on-page SEO efforts have been fairly successful using this and other techniques that we all try to divine from the Google 200+ formula that remains secret but that we all must use trial and error to figure out each day as a moving target. www.HomeArchitects.com thanks for your insights.