Can Google index Jquery content?

i need to update headings and alt tags on a website.

The website is made in drupal and i cant for the life of me figure out how to add alt tags to images. (there is no alt tag fileld on image sliders)

and i dont know where the code is to update the headings in the back end.

i normally use concrete5 as my main CMS so going to drupal is very backwards to me.

i figured i might be able to put some jquery together to update the headings and add alt tags as this will be very quick to do. but will this be ok for google to index?

Example of how i might change the headings.
<h1>this needs to be a heading 2</h1>


Open in new window

Example of how i might add alt tags:

// add an alt to this image with the url:


// if we have any other images without alts we can add alts like this:
$('#map_canvas > img:not([alt])').attr('alt', 'Alternative text');

Open in new window

i found an article saying google uses chrome as its spider and can now interpret ajax calls but am still hesitant.

what do you think?
Who is Participating?
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.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
In this case, have an alt tag or not on a few images is not going to make or break your rankings.  While I agree seo is about many small parts, I would do this for the users or those that have screen readers.  

To answer your question, if I look at how google has cached some pages I have worked on that use jquery it appears that may be true.  You can test by viewing your own content
Google will index ajax content but it is not guaranteed to be indexed or even used but you should not use it for items like Meta or Title. Google expects it for your content in the way sites are becoming more dynamic, it doesn't expect it for things that should be there to start with.
helpchrisplzAuthor Commented:
Meta or Title is not what i was asking about.
headings and alt tags are the focus of this question.

Unless your on about the same thing? just different terminology.
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Misread it slightly (still waking up) but still the same applies - if it is important to your page it should be there to start with.  Remember Google isn't the only search engine so always work for the lowest common denominator which means no reliance on ajax content.
helpchrisplzAuthor Commented:
jquery .replaceWith isn't the same as ajax but i see what you mean.

i might just have to do a test page to see if it gets indexed or not
Yeah still dynamic content tho ;o)
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I agree with Cathal about the lowest common denominator although for any of the sites I work with, Google supplies the lions share of organic  referrals.   It is always good to constantly test everything.    

I think if you don't try and "game" or outsmart the system, you will do good in the long run.  In the end, it is not about an alt tag or meta stuff, it is about your site's content having the ability to naturally attract others to use and reference your site.  When they do come to your site, they stay and share.   The only way for that to happen is to have great content.  There are no short cuts and those that do spend a lot of time generating content will have an easy win in the long run because most people don't have what it takes to generate truly great content and on regular basis.  Those that do, may be start, but quickly loose interest  probably because it is difficult and you don't get instant gratification.  

Best of luck!
Aaron FeledyDrupal Developer and ConsultantCommented:
To add alt tags to images added via Drupal 7's image field, do the following:

Depending on how your site is set up. Many developers will make their sliders using views to display images from a certain content type. If that is the case, then try this:

Via the admin interface, Navigate to Structure >> Content types. Select the content type being used for your slider. You will now be presented with a list of fields used in this content type. Find the image field and click the associated edit button. On the settings page, scroll down until you see the Enable Alt field checkbox and tick it. Save the settings. You should now be able to edit your page and you will see a box for adding an alt tag to your image.
helpchrisplzAuthor Commented:
I've tried that but couldn't see the alt field check box to enable it.

might have to have another look.

not sure why this wouldn't be enabled by default...
helpchrisplzAuthor Commented:
Scott Fell (padas)

i know the drill with content being king but sometimes you end up working on a site that has super boring services! lol.  

for example the last site i was doing was drain cleaning.  i guess writing content works when you have a website that is easy to write for.

i like the get all the onsite changes perfect as i think it drags down the other seo work if its not done to its upmost.
Bernard S.CTOCommented:
Hmmm... something important to be aware of is that spiders do NOT run javascript (nor, consequently, ajax) nor Flash, which are usually executed on client-side
They might READ the files and grab there contents such as urls or words... but it would be wise to avoid that.

Sidenote: this implies that if you want your content indexed:
- do not rely on javascript-only or flash-only navigation, since most of the links will NOT be discovered and corresponding pages will NOT be "found" since they will not be sought for
- same applies to your content: consider that javasript-only or flash-only content will be badly indexed, if any!

Coming back to your problem:
- you cannot rely on jquery generated content, they will be readable only on visitors browsers, not in spiders exploration
- BUT you should consider to generate your content with drupal php modules: php is run on the server and generates the html (and/or the javascript) which will be sent to the browser or the spider; since it is "hard-coded html" as far as browsers and spiders are concerned, spiders will be able toi read en index it
- as a stop gap measure if your pictures are not indexd you might consider workarounds such as having a map of all your pictures etc
helpchrisplzAuthor Commented:
"do NOT run javascript "

do you contest the link that i put at the end of my first post?

i know every one has an opinion but please backup you reasoning.  

i think the only way of getting to the bottom of this is to do a test.  by doing the code i suggest on my first post and seeing if it gets indexed.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
> i guess writing content works when you have a website that is easy to write for.

That is your opportunity.  Everybody else is thinking the same thing.   Razors are pretty boring.  This guy made them not so boring and the videos were semi viral for a short time.

In any case, you need to test.  I found by looking at my google cached content that jquery was being taken into consideration.   Just don't game the system.  

I don't know drupal but if there is a way you can fix this in the modules, that sounds like the way to go.
Bernard S.CTOCommented:
It seems that you ask the question "does Google index Jquery content" and that you have already answered "yes".

For my part, I would play it safe and make the changes not in javascript, but in the modules OR in the content itself (since when you insert pictures you can write additional info that will improve SEO)
Hmmm... something important to be aware of is that spiders do NOT run javascript (nor, consequently, ajax
I'm afraid you are wrong, Googlebot will 'execute' javascript and try and follow any resulting URL's.  This is a PITA as you would sometimes use this to prevent Google indexing content you didn't want indexing.
I've been trying several ways to prevent this happening as it keeps indexing sorting options on a shopping site, options which reload the url based on what was selected and guess what it is js that is reloading the page.
helpchrisplzAuthor Commented:
My opinion is the same: always use server side and not client side for SEO.
i already knew this before asking. :)

i guess i was asking this question to see if there was any proof that can be backed up that google does do what the article mentions as it would make my life easier (when doing onsite changes).

Particularly the .replaceWith and alt jquery code i put in my first post.

I have seen an article saying google does index inline document.write
but thats not much help for my task i would need .replaceWith to accomplish my tasks.

What i think i should do is actually test my theories and make my own article on my findings.
Bernard S.CTOCommented:
Cathal: if you browse thru the code of the html page or of the js files, do your sorting options appear as text, eg in the javascript code?
If yes maybe GG is guessing that they are links and follows/indexes the link targets

To draw a conclusion it would probably need to create a single unlinked page A (but which links to another page B on an existing site, otherwise it surely will not be kept by GG as worth indexing) and create another page C where the link to this page A will be totally "synthetic", ie no visible url appears and it needs running js to generate the link-text
Then create as well a page D with a link to it from C.
Assuming that previously neither A nor D exist, and that no link to either A or D exist in any page... watch when D is indexed. If javascript-only links are understood by GG, then A should be indexed within some days of D...

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
helpchrisplzAuthor Commented:
Every one has there opinion and SEO doesn't have a definitive rule book....
No one knows how the Google spider really works as Google don't tell us the technical info... its all hush hush...

They do, do webmaster vids at 
but i don't know how to put this question to them.

I haven't had time to do a test but i put fibo as best answer because he has the best info on how to do such a test.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If you watch those videos, from 2 years ago march 2012... they are saying they are and getting better.... 2years ago.  If you want to be safe, but that too was last updated from 2012.

As said few times, you should continue to test.  But also understand what you are testing.  If your getting 500 monthly unique visitors vs 50,000.  When getting a small number of visitors, your results may not be statistically accurate depending on what you are testing.

Anything I am using ajax for on my own sites is not something I am worried about for seo.  I think that is a good plan to stick with.
helpchrisplzAuthor Commented:
jquery .replaceWith(); isn't ajax is it?
helpchrisplzAuthor Commented:
are you saying its the same as using ajax because it happens after the dom is loaded.
From what i've read google can interpret inline jquery.

So in my tests i will try with and without document ready...
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If you have a page that generates the below html and js via your favorite server side code
<!DOCTYPE html><html><head>
<script src=""></script><script>$(function() {$('h2').replaceWith('div'); });</script>
<meta charset="utf-8"><title>hi</title></head><body><h2>Hello World</h2></body></html>

Open in new window

Before the page loads any server side functions are run, then the rendered html is sent to the browser just as if it where hard coded.  Next the javascript is run after the page loads.  The only difference I can think of between doing this and an ajax call to a complex sql is perhaps some lag time before it loads.  

For SEO, I would assume what is sent to the browser is crawled.  In the case of an image slider for instance. Some load all images to the browser at once and others one at a time.  The first way can be slower to load, but all images will probably be indexed.  The 2nd way could be faster to load, but the images may not be indexed together.  

Having a lot of great content is going to be the most important thing you can do out of anything.  So changing an h1 tag to a p tag for whatever reason is not going to make or break your site.

If there are 1000 sites selling the same widgets as you in your area and 750 of them have the similar minimal content, 100 of them have some type of blog they add to because that is what they are told, 100 more also have some social media with their blog because that is what they are told and 50 more have a lot of great content on their site, passionately blog about their subject, and actively engage their users  on social media.... Which group do you think will show up 1st, 2nd, 3rd, 4th in search results?  If you are one of 750 and you are only concerned with alt tags and some ajax, you are already beat by the 50 creating great content and engaging their users (probably went as hiring a professional writer-very few can write).  

While everything together makes a difference, content is what you should be worrying about.
helpchrisplzAuthor Commented:
ye i agree... but every little thing adds up.

h1 h2 and h3 tags are a very good way of telling google what the summary of the pages paragraphs are about.

So i would say its very important.

I want to focus on every little aspect of the SEO to get the best possible outcome.

I was merely wanting to find out more about a question that was bugging me,
I know this question only focuses on one little thing but that was the point. :)
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
Search Engine Optimization (SEO)

From novice to tech pro — start learning today.