Is There Any Way To Get Dynamic Alt Tags To Show Up In Search Engines?

Hello Experts:

I have a problem which I believe should be pretty common.  I hope there are some experts out there that have come up with an ideal solution.

I have a website at  It uses dynamic loading of images using jQuery and javascript.  The problem I have is, is there a way to get the alt tags for these images to show up in the search engines?

The pages themselves are dynamically created in PHP (it is a WordPress site) so I don't know if by chance there might be an AJAX solution, or what, but I pretty much get the feeling that if you can't see it when you click on "View Source" in your browser, neither can the search engine.
LVL 17
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi Omni,
The alt tags has diminished from being read by the search engine as many other tags that were mis-used for affecting search engine ranking such as the keywords meta tag

it's been a trend to index only the readable text by the visitor or actual content as the visitor sees them to guarantee that it's not just a trick to enhance SEO rankings

You can read more here

You can also check this simulator to check how search engine sees your page contents and the words it would index

You can use many other techniques to include text that would be indexed without displaying it like adding the image in a tag with text-indent:-9999px; in style sheet, etc..

Hope this helps
Bernard S.CTOCommented:
Short answer: no if you are relying on javascript

Complete answer:
- any code generated by php is generated ON THE SERVER and so, as far as the browsers are concerned, they are "hard-code html".
- any code generated by running javascript or Flash is generated ON THE CLIENT and so, as far as the browsers are concerned, they show ONLY in the browsers which enable them.

- spiders explore the code delivered by the server
- spiders from search engins DO NOT run javascript or flash, so they are unable to "read" the html code they might generate (although spiders do try to read them... they do it badly since tyhey do NOT run this code, so do NOT rely on that)

So, if your alt and others are generated by running javascript, they will never be seen by spiders.
You should consider generating them with php, eg, from a sql database in which you will have image name and alt information

Note: if you are looking at IE and Firefox, you will notice that one uses alt text for the snuppet that displays when the cursor is over the image, and the other uses title text. For my sites, I usually place both alt and title, usually with the same text
Google can crawl some kinds of javascript and ajax, and tends to find stuff on WordPress installations even if you don't want it to.

That being said, there is no way they will show your pictures if they are blocked with robots.txt

Disallow: /wp-content/

If the images are loaded with ajax due to load time, it is possble to code them normally, then use a plugin such as lazy load.

If it is due to SEO and first link priority, a text link that appears after an image takes priority for anchor text.

I would go for a static implementation with deferred loading over what you currently have if image search is important, plus images tend to help search results in general especially Yahoo.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

OmniUnlimitedAuthor Commented:
Thank you experts.  Your comments are very helpful.

You have all presented viable solutions to my problem, however it was AndyBeard who correctly identified the reason of my use of AJAX, jQuery and javascript to load images on my site as being to decrease page load time.

Because you all provided unique solutions (howbeit I will only be using one), I feel it only proper to split up the points.

AndyBeard:  You provided me with what is, in my opinion, the most elegant solution to my problem.  I will be hard coding my images and testing out the lazy load plugin to see how it works on my site.  As a result, I am awarding you the most points.

remorina: Your solution as well involved hard coding of my images, however you did not address the page load time issue.

fibo:  Thank you for your comments but as you can see from the way that I asked my question, and specifically my statements in the last paragraph of my question, I am well aware of the differences between server side and client side scripting.  Additionally, your comments regarding the use of Alt vs. Title tags in browsers had nothing to do with the search engine question.  Your solution to generating the image tags via PHP and database info is viable, but would require more time and additional modifications to WordPress that would AndyBeard's.  AndyBeard's solution in comparison will require minimal changes and can be implemented within the current structure I have.  Additionally, coding image tags via PHP still does not resolve the page load time issue.

Once again, thank you all for your help and assistance.  It is truly appreciated.

OmniUnlimitedAuthor Commented:
Great solution. Great Experts.
Bernard S.CTOCommented:
Thx Omni for taking the time to detail your analysis and points allocations.
If the primary factor for you is speed I would also do the following

1. Keep blocking wp-content
2. Get a CDN - the Akamai deal through is good, or maybe MaxCDN... even Amazon Cloudfront
3. Assign a cname, or better still have a dedicated domain with A record just for media to avoid shared cookies
4. Use a plugin or upload images manually to CDN - lots of people use WP Total Cache for this, though there are other alternatives.

The people taking this to extreme serve everything other than dynamic pages from CDN, dynamic pages are cached and served as static pages, etc.
OmniUnlimitedAuthor Commented:
Outstanding gentlemen.

AndyBeard thank you very much for some outstanding tips.  I sincerely appreciate all your help.  I will be attempting to implement your suggestions on my site.  You are a great expert.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.