If i have code like this:

  <option value="path/to/image1.jpg">Image 1</option>
    <option value="path/to/image2.jpg">Image 2</option>
    <option value="path/to/image3.jpg">Image 3</option>
    <option value="path/to/image4.jpg">Image 4</option>

Will Google index images from the select tag?

  • 1
    I don't think so since an option is generally a value and not a path to a resource. So Google won't try to retrieve the image, but just read the value. – j0k May 19 '13 at 14:14
  • Would it be good if i leave 'normal' links to images and then use JavaScript to generate SELECT option from that links? – johnsmith May 19 '13 at 14:29
  • I think it will be better. – j0k May 19 '13 at 14:49

Google scans your source code for items that look like URLs and will try to crawl them and index them, even if they are not in an <a href.

Based on the crawling that Googlebot has done on my site, Google seems to think that strings in the page source are URLs if:

  • They end in a common page extension such as "html", "htm", or "php".
  • They contain a slash such as "foo/bar"
  • They start with "http://" or "https://"

Both the first and second in that list apply to your situtation.

Googlebot seems to look in both javascript variables and option values for items that appear to be URLs. So Google will crawl mypage.html in both of the following senarios:

<option value="mypage.html">My Page</option>

<script>var s = "mypage.html";</script>

I haven't done any specific testing with images, but I would be suprised if Googlebot did not crawl your jpg images given the markup your provided.

You might also do better with SEO with an actual link to your images. Even if Google does crawl and index the images, it is not clear that links found not in <a href= pass pagerank the same way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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