Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have the following get form on my website for language switching.

<form method="get" action="?">
    <label for="language">Language: </label>
    <select id="language" name="lang">
        <option disabled="disabled" value="es">Espanol</option>
        <option disabled="disabled" value="da">Dansk</option>
        <option value="de">Deutsch</option>
        <option value="en">English</option>
        <option disabled="disabled" value="fr">Francais</option>
        <option disabled="disabled" value="it">Italiano</option>
    </select>
    <input type="submit" value="GO">
</form>

This constructs URLs of the form /?lang=en and note that currently my site only has the following URLs available:

  • /?lang=en
  • /?lang=de

Visiting anything else (e.g. /?lang=fr) returns a 404 so Google does not index them.

What is a problem though is that the Google Webmaster Tools shows all disabled languages as broken links even though I've marked them with disabled="disabled".

I want to stop Google from trying to visit those links but I cannot use rel="nofollow" on those disabled options because I don't think that rel is a valid attribute of <option />. What should I do?

Note that I don't want to remove the disabled options from the form.

share|improve this question

3 Answers 3

up vote 3 down vote accepted

If the option is disabled, then it shouldn't matter what the value is, since real users can't actually choose it. Just remove the value from those options while they are disabled to prevent Googlebot from crawling:

<option disabled="disabled" value="">Francais</option>
share|improve this answer
    
Great idea. Thanks. –  cherouvim Jul 23 '13 at 11:11

Whatever you marked options disabled, Googlebot follows links and finds links to 404 HTTP status. That's why Google reports 404 error pages on Google Webmaster Tools.

If you don't want Googlebot crawls these URLs, you can block them in robots.txt.

And if you want remove 404 error pages on Google Webmaster Tools, you can mark these URL as 410 HTTP status with .htaccess (if your webserver is Apache). It takes time but Google will remove them from 404 error pages.

share|improve this answer
1  
Returning a 410 "Gone" for these URLs would be incorrect IMO. The 404 is the correct response. Presumably the reason for keeping these options visible in the form is that they will be implemented at some future date? –  w3d Jul 23 '13 at 10:54
    
Thanks but I wanted to know how to stop Google from following the links, not how to remove them afterwards. –  cherouvim Jul 23 '13 at 11:11
    
Ok guys, no problem. –  Zistoloen Jul 23 '13 at 12:05

Google will keep reporting the 404 pages in Webmaster Tools whilst the links are found on your site. This is normal. If you changed them to 410 status pages then they will still be reported in Webmaster Tools. You can mark the crawl errors as 'Fixed', but they will probably show up again if the links are still on your site. If you blocked them by robots.txt then you would find mention of URLs blocked by robots.txt in the Index Status section.

The 404 reports in Webmaster Tools are not harming your site, it is just Google reporting what has been found during crawling.

share|improve this answer
    
+1 "not harming your site". @cherouvim: The report in GWT is purely for your information, so I don't see that this is a "problem" at all. –  w3d Jul 23 '13 at 10:07
1  
Actually lots of 404 errors DO affect your site's rankings negatively, because they increase bounce rate, decrease user interaction and decrease time spent on page - all of which are taken into account by Google when ranking pages. So it is definitely a good idea to minimize 404 pages or try to deindex them whenever possible. –  WordPress Developer Jul 23 '13 at 10:21
2  
@wordpress_developer Lots of 404's do NOT affect a site ranking negatively, Google does not 'take these into account' when ranking pages. It is perfectly normal for sites to have 404 reports in webmaster tools and returning a 404 response is an ideal way to 'deindex' pages. See here : googlewebmastercentral.blogspot.co.uk/2011/05/… –  user29671 Jul 23 '13 at 10:30
    
These 404 are not in the Google index. @w3d they are a problem because 1) they heavily clutter the "broken links" page 2) client doesn't want them there –  cherouvim Jul 23 '13 at 11:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.