Is there any SEO risk of using Javascript instead of real links? - seo

Essentially I have a client who wants to change some links from something like:
Click me
to something like:
<span style="color:blue;cursor:pointer;" id="faux-link">Click me</span>
<script type="text/javascript">
$("#faux-link").click(function() {
document.location = "http://www.google.com/";
});
</script>
Essentially this would make the "Click me" text in the same way minus a few advanced link features (Mouse3 opens link in new tab, right clicking to see "Open in New Window" and other options, etc) also it would obvously not work for anything with Javascript disabled (or if Javascript on the page had any fatal errors)
Are there any SEO downsides to this that anyone has experienced or any kind of comments from Google or others on this type of behavior?

In the first example (Click me) you use stander <a> tag. But even though it uses rel="nofollow" attribute, some web spiders may still follow the link. A bit more on that on Nofollow in Google, Yahoo and MSN article.
In the second example you use different way of building a link (using JavaScript and different than <a> HTML tags like <span>). Googlebot can execute some JavaScript, but I do not believe it would execute large libraries like jQuery.
Please check interview with Matt Cutts for more details. Quotation from that interview:
Matt Cutts: For a while, we were scanning within JavaScript, and we
were looking for links. Google has gotten smarter about JavaScript and
can execute some JavaScript. I wouldn't say that we execute all
JavaScript, so there are some conditions in which we don't execute
JavaScript. Certainly there are some common, well-known JavaScript
things like Google Analytics, which you wouldn't even want to execute
because you wouldn't want to try to generate phantom visits from
Googlebot into your Google Analytics.
As I understand, in both examples, it was intended to stop web spiders from crawling or indexing those links. I think (no evidence or article supporting that) that using the later approach will not affect SEO significantly.

use normal links (if not the sites will not be indexed in google!) and use prevent default (javascript) for links that you will specify. read preventdefault()

The links that you want to provide in the click event are visible in the source of the page, so anybody that wants to view them can do it really easy. So, as you said, some features of legacy link will be disabled, so you can use normal links instead of jQuery.

Related

External links: when use rel="external" or rel="nofollow"?

In most of my web site I have a lot of external links to my other sites and other external sites.
I need to know when is better to use rel="nofollow" or rel="external" in a website?
You may use external for every link to a different website, no matter if it’s yours or not, if it’s on the same host or not.
You may use nofollow for every link that you don’t endorse (for example: search engines shouldn’t assume that it’s a relevant link and should not give any ranking credit to this link).
You may use both values for the same link:
Foobar
Note that external doesn’t convey that the link should be opened in a new window.
Note that search engine bots (that support nofollow) might still follow a nofollow link (it doesn’t forbid to follow it). FWIW, there is also the nofollow value for the meta-robots keyword (which may mean the same … or not, depending on which definition you follow).
nofollow links attributes do not allow search engine bots to follow link.
If you have rel="nofollow" then the juice stops.
rel="external" dosent act like nofollow. its DoFollow link.
For rel="external" it means the file is on a different site to the current one.
rel="external" is the XHTML valid version that informs search engine spiders that the link is external.
However, using this does not open the link in a new window. target="_blank" and target="_new" does this, but is not XHTML valid. I hope that helps.
I advise you to use Nofollow Links for the following content:
Links in Comments or on Forums - Anything that has user-generated content is likely to be a source of spam. Even if you carefully moderate, things will slip through
Advertisements & Sponsored Links - Any links that are meant to be advertisements or are part of a sponsorship arrangement must be nofollowed.
Paid Links - If you charge in any way for a link (directory submission, quality assessment, reviews, etc.), nofollow the outbound links
**
If you have an external link to your own site then use
Your Link
If you have external link to someone else's site you don't trust then you can combine both and use
Other Domain Link
If you have an external link to someone else's site and you consider it's trustworthy then use
External Useful Link
It depends what you mean by "better". Those are two comopletely different attribute.
rel = nofollow tells the Search engine crawlers not to look at this link (probably you don't want this to happen for your other websites, but you will use it for other's web sites). Documentation: rel=nofollow - https://support.google.com/webmasters/answer/96569?hl=en
rel = external tells that the link is not part of the web site and open the link in a new window (it's not working for older IE). It is used as a valid XHTML attribute instead of target="_blank". Here you can learn how to use it: http://www.copterlabs.com/blog/easily-create-external-links-without-the-target-attribute/

Does google index script tags as content when using handlebars.js

If you use the standard handlesbar.js implementation, does Google view the content within the custom script tags as content, script or unknown content?
If you're in doubt, do in pure HTML. Unfortunately, Google should ignore this. I looked about, and all I heard is that this application was not made ​​to be searchfriendly.
In fact, Google undestand and even follow links created via Javascript, but handlebarsjs is very more complex.
Possible solution
A strong suggestion that I make to you is load a simplified version with some content in plain simplified and after use handlebarsjs, so at then at least do not let google completely blind. But thsi version should be used also to end user, because google Will know if you show a diferent content just for Googlebot.
Possible solution 2
Exist a way to make websites that rely heavily on AJAX still work in Making AJAX Applications Crawlable

How might I provided a URL use the FireShot API to take a screenshot, upload to Imgur, and return some output (eg. markdown)

I am looking for a way to utilize the FireShot API with JS to given a URL (or perhaps a list) use the FireShot API to take screenshot, upload to Imgur, then return the user the URLs or perhaps something like markdown to use quickly in forums.
Method 1: Open new window
I tried opening the URL in a new window, but found that I cant control that page with JS dues to cross domain problems. The same with iFrames.
Method 2: simple $.get()
A simple $.get() wont work because of the same cross domain issues I guess?
http://jsfiddle.net/t6aeq/
$.get($url.val(), function(data) {
console.log(data);
});
Via PHP "Proxy"
So I tried creating a simple PHP script that gets the HTML of the URL and returns it to my JS (using file_get_contents($url)). But some sites like Microsoft will detect that I am using some automated methods and give an error page of sorts. I also cant seem to find a way to use jQuery to query that returned HTML for link[rel=stylesheet], script, style and body to append to the head and a div respectively. I posted abt that on another question
A new Idea: Embed scripts on browser level
So I thought away of getting around these is using iMacros or GreeseMonkey or something to insert scripts into pages on the browser level instead? But any guidance or tips on how can I do that? Also, I'd prefer a pure JS/PHP method if available so users are not limited to using Browser plugin/scripts (tho I will be the only user for now)
It suddenly came to my mind that this may not work because the FireShot API key and Imgur is limited to the domain? Any solutions?
You might be able to inject the FireShot script using Greasemonkey. But, first use GM_xmlhttpRequest() to fetch an API key, for that page's domain, from the "Create FireShot API Key" page.
Note that GM_xmlhttpRequest() does not have the same cross-domain issues that $.get() has.
However, at this point you might be better off just writing your own Firefox add-on. Maybe start with FireShot's code for ideas. Also see the Screengrab add-on.

Is there a way to prevent Googlebot from indexing certain parts of a page?

Is it possible to fine-tune directives to Google to such an extent that it will ignore part of a page, yet still index the rest?
There are a couple of different issues we've come across which would be helped by this, such as:
RSS feed/news ticker-type text on a page displaying content from an external source
users entering contact phone etc. details who want them visible on the site but would rather they not be google-able
I'm aware that both of the above can be addressed via other techniques (such as writing the content with JavaScript), but am wondering if anyone knows if there's a cleaner option already available from Google?
I've been doing some digging on this and came across mentions of googleon and googleoff tags, but these seem to be exclusive to Google Search Appliances.
Does anyone know if there's a similar set of tags to which Googlebot will adhere?
Edit: Just to clarify, I don't want to go down the dangerous route of cloaking/serving up different content to Google, which is why I'm looking to see if there's a "legit" way of achieving what I'd like to do here.
What you're asking for, can't really be done, Google either takes the entire page, or none of it.
You could do some sneaky tricks though like insert the part of the page you don't want indexed in an iFrame and use robots.txt to ask Google not to index that iFrame.
In short NO - unless you use cloaking with is discouraged by Google.
Please check out the official documentation from here
http://code.google.com/apis/searchappliance/documentation/46/admin_crawl/Preparing.html
Go to section "Excluding Unwanted Text from the Index"
<!--googleoff: index-->
here will be skipped
<!--googleon: index-->
Found useful resource for using certain duplicate content and not to allow index by search engine for such content.
<p>This is normal (X)HTML content that will be indexed by Google.</p>
<!--googleoff: index-->
<p>This (X)HTML content will NOT be indexed by Google.</p>
<!--googleon: index>
At your server detect the search bot by IP using PHP or ASP. Then feed the IP addresses that fall into that list a version of the page you wish to be indexed. In that search engine friendly version of your page use the canonical link tag to specify to the search engine the page version that you do not want to be indexed.
This way the page with the content that do want to be index will be indexed by address only while the only the content you wish to be indexed will be indexed. This method will not get you blocked by the search engines and is completely safe.
Yes definitely you can stop Google from indexing some parts of your website by creating custom robots.txt and write which portions you don't want to index like wpadmins, or a particular post or page so you can do that easily by creating this robots.txt file .before creating check your site robots.txt for example www.yoursite.com/robots.txt.
All search engines either index or ignore the entire page. The only possible way to implement what you want is to:
(a) have two different versions of the same page
(b) detect the browser used
(c) If it's a search engine, serve the second version of your page.
This link might prove helpful.
There are meta-tags for bots, and there's also the robots.txt, with which you can restrict access to certain directories.

How to setup a simple site search for a simple website?

I'm maintaining an existing website that wants a site search. I implemented the search using the YAHOO API. The problem is that the API is returning irrelevant results. For example, there is a sidebar with a list of places and if a user searches for "New York" the top results will be for pages that do not have "New York" in the main content section. I have tried adding Yahoo's class="robots-nocontent" to the sidebar however that was two weeks ago and there has been no update.
I also tried out Google's Search API but am having the same problem.
This site has mostly static content and about 50 pages total so it is very small.
How can I implement a simple search that only searches the main content portions of the page?
At the risk of sounding completely self-promoting as well as pushing yet another API on you, I wrote a blog post about implementing Bing for your site using jQuery.
The advantage in using the jQuery approach is that you can tune the results quite specifically based on filters passed to the API and playing around with the JSON (or XML / SOAP if you prefer) result Bing returns, as well as having the ability to be more selective about what data you actually have jQuery display.
The other thing you should probably be aware of is how to effectively use #rel attributes on your content (esp. links) so that search engines are aware of what the relationship is between the actual content they're crawling and the destination content it links to.
First, post a link to your website... we can probably help you more if we can see the problem.
It sound like you're doing it wrong. Google Search should work on your website, unless your content is hidden behind javascript or forms or something, or your site isn't properly interlinked. Google solved crawling static pages, so if that's what you have, it will work.
So, tell me... does your site say New York anywhere? If it does, have a look at the page and see how the word is used... maybe your site isn't as static as you think. Also, are people really going to search your site for New York? Why don't you input some search terms that are likely on your site.
Another thing to consider is if your site is really just 50 pages, is it really realistic that people will want to search it? Maybe you don't need search... maybe you just need like a commonly used link section.
The BOSS Site Search Widget is pretty slick.
I use the bookmarklet thing but set as my "home" page in my browser. So whatever site I'm on I can hit my "home" button (which I never used anyway) and it pops up that handy site search thing.