Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
Alt and Title Attributes in Anchor Tags
-
Does it hurt to use alt and title attributes inside an anchor tag? Example:
-
That was a good catch Alan and Ryan, I just looked at the Alt and Title and did not even notice the example used them in an anchor. Doh! I would only ever use them in images. Since I develop on the Microsoft platfrom using it anywhere other than img flags a syntax error.
-
Everyone's partially correct. Alternate attributes are for images only. Title attributes in anchor tags can be used in links, however if you are performing SEO best practices, using title attributes in anchor tags is a first signal that you are probably spamming the search engines if not used with extreme caution.
Why? Because the anchor text (the text you wrap the anchor tag around) should suffice to communicate what you're linking to. Title text in anchors is best left to only be used when you're using them as a place anchor on a page, not as a link.
-
To clarify: Alt attributes should not be used in anchor tags, but titles can be. For a full list of anchor tag attributes see: http://www.w3schools.com/tags/tag_a.asp
-
Agreed.
-
Quite the opposite, these are very desirable if used for their intended purpose.
The Alt tag is for accessability handling, so it helps people with visual disabilities to understand the content of a picture.
The Title tag is used to provide tooltip information to the user when they hover over the image.
Both these enhance the user experience as thus are looked on favourably by Google.
BUT, it's an important but - seo's in the past would stuff these tags with useless spammy content. e.g. You have a automotive business so the alt tag:
'car gmh fast cars sports cars red cars porsche' that is bad.
'Our new sporty red porsche makes an easy ride through the windy roads of Denmark' - good
The title tag could say 'Porsche 911 2005 touring the roads of Denmark'
It's all about adding value to the site for the user not manipulating the search engines. So, use alt tag to describe the item in detail and the title to provide extra details. Do not have the same text in both as they have different purposes.
Hope that sheads enough light on the subject.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Duplicate titles from hreflang variations
Hi, I am working on a large global site which has around 9 different language variations. We have setup the hreflang tags and referenced the corresponding content as follows: (We have not implemented a version X-default reference, as we felt it was not necessary) Using DeepCrawl and Search Console, we can see that these language variations are causing duplicate title issues. Many of them. My assumption was that the hreflang would have alleviated this issue and informed Google what is going on, however i wanted to see if anyone has any experience with this kind of thing before. It would be good to understand what the best practice approach is to deal with the problem. Is it even an issue at all, or just the tools being over-sensitive? Thank you in advance.
Technical SEO | | NickG-1230 -
Hidden H1 Tag on Image
Hi, In the page I'm working on, I encountered an tag in an image, rather than in a text form. Do you think it's an issue when it comes to SEO?
Technical SEO | | nerdieb
What do you suggest I should do if there is an issue? Keen to hear from you!0 -
Do Canonical Tags Pass Link Juice?
I have an ecommerce website where some pages link to a product page with a different URL. EXAMPLE: 1: /category/product1.html (not indexed by Google) with canonical pointing to product1.html Other page link to the product like below. 2: product1.html (indexed by Google) Now the question is, does 1: pass any link juice to product1.html or not? Is it worth to change everything and link only to one URL? My site is running on Magento!
Technical SEO | | bill3690 -
Hiding h1 tags in Magento
Hi Moz Community, I know that hiding h1 tags isn't a good practice for SEO and google, but we have banners that look much nicer than the stock text Magento uses for its titles. The banners have the same text and the h1 is in the source code, just not visible on front end. The option Magento gives is "hide title on the page." So I'm not sure if this is actually the bad way to hide it or if it's fine for search engines. Thanks,
Technical SEO | | IceIcebaby
-Reed0 -
ALT attribute keyword on the same image but different pages
Hi there, As i'm sure you're probably aware, moz advises to use a keyword within the ALT attribute on pages... On a new website I am launching, I have the ability to add an alt keyword to image headers. On multiple pages we have the exact same image but with different keywords associated them inside the alt attribute. The image itself is a collage of different images and so the keywords used can, quite sneakily, match the image. My question is therefore, will using different keywords on the same image on different pages have a negative effect on SEO? Thanks, Stuart
Technical SEO | | Stuart260 -
Dynamically changing a title with javascript
Hi, I asked our IT team to be able to write custom page titles in our CMS and they came up with a solution that writes the title dynamically with javascript. When I look on the page, I see the title in the browser, but when I look in the source code, I see the original page title. I am thinking that Google won't see the new javascript title, so it will not be indexed and have no impact on SEO. Am I right ?
Technical SEO | | jfmonfette0 -
#hashtag Anchor text within content
Hi, i have a question about anchor text within my sites content. It 'jumps' to content displayed further down the page via a side navigation at the top. These links don't take you away to any other page, instead take you further down the page to the relavent content. My question is this: I've noticed in the URL that the anchor text - #jumpnavlink is placed at the end of the pages URL like so.. www.mywebsite.com/example-page.php#jumpnavlink Is this creating a problem for duplicate content?
Technical SEO | | SeoSheikh
Is it creating a new URL for viewers to use?
Is it ok to have lots of these running throughout my sites content pages? Many thanks for any light that is shed on this one! Cheers
Alex0 -
Duplicate page titles on Ecommerce
Hi, My question is in reference to an E-commerce site- Our SEO MOZ scan is showing many errors for Duplicates- such as Duplicate titles - The majority of these are on the products map- and the page titles are Products Map :: Company Name How do we get correct this or does Google not penalize for it? Thanks.
Technical SEO | | frankrizzo0