Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript isn't good for SEO, is it?

Tags:

javascript

seo

If I decided to use some javascipt in my website like

$('#body').load(URL);

or

$.get(URL, {param:value}, function(){ ... });

or

window.title = 'TEXT';

Is it good for SEO? Or am I recommended to use pure PHP for data on the page for SEO purposes?

like image 890
Giffary Avatar asked Dec 29 '22 03:12

Giffary


2 Answers

The question of if javascript is good for SEO or not is missing the point. We should pretty much assume that any content which is only available by javascript will not be crawled by the search engines. Google at least claims to be able to crawl some javascript only content but is fairly tight lipped about what exactly they can crawl. Other search engines probably don't crawl it and it's certainly the case that not all do. So assume it doesn't get crawled.

That doesn't mean it's bad for SEO.

If the content will contribute to your SEO, then it's bad for SEO. If the content is neutral to SEO, then it's neutral for SEO. So the answer to your question really depends on the nature of your content. If the content is part of your SEO campaign, then stick with server-side HTML generation be it PHP or some other method. Otherwise the question of SEO has no bearing on the decision to to use javascript or not. Accessibility would be another thing to take into account. Javascript only content is terrible for that.

like image 88
aaronasterling Avatar answered Jan 10 '23 14:01

aaronasterling


The larger search engines can/do render limited amounts of javascript. However, for SEO purposes your best bet is rendering the content via HTML rather than javascript. A good rule of thumb is to utilize HTML for content/expressing limited content structure (e.g. paragraph type text = p, lists = ul/ol, headings = h1/h2/h3, etc...), CSS for presentation, and JS for client side programming. With that being said, always ensure a good user experience first. If you can do the above while providing a great user experience, great! If you can't, users first. Its likely you can keep both users and bots happy 95% of the time if you take the time to do so.

Further reading (sorry, I can only post one link as a new user):

Matt Cutts Interview (Check out #26 on Google Javascript Rendering)
A spider's view of Web 2.0


EDIT Added that for "a new user" ;) ~ drachenstern

like image 24
Rocky Madden Avatar answered Jan 10 '23 13:01

Rocky Madden