javascript給網站帶來豐富的用戶體驗,愈來愈多的網站開始應用angularjs/emberjs這類MVC來開發web應用,能夠說可以使用native方式來見解的手機app基本均可以使用替代的js框架來開發,這給web開發及web用戶帶來了史無前例的便利。可是不幸的是,到目前爲止,主流的搜索引擎對於javascript的動態內容幾乎沒法讀取,所以你的網站自己內容再豐富,對用戶再友好,在google,baidu那裏也是一無所知。這,相信對於網站的owner來說都是一個巨大的問題,誰也不但願本身的網站在搜索引擎那裏得不到檢索。如何解決這個問題呢?javascript
有一個簡單的思路是:googlebot會抓取網頁的<noscript>google要看的內容</noscript>,這樣咱們經過phanmjs這樣的headless browser動態serve googlebot以<noscript>所包含的內容是一個workaround。可是在這裏要注意google的相關政策:css
「html
cloaking refers to the practice of presenting different content of URLs to users and search engines.Serving up different results based on user-agent may cause your site to be perceived as deceptive and removed from googl indexjava
」git
總的來講,你須要給到google和用戶基本相同的內容。好比若是用戶js功能關閉,那麼它也應該看到和googlebot相同的內容。angularjs
一些隱身的具體例子:web
給google一個html靜態文件,而給用戶展現一個image或者flash;app
給google和給用戶以不一樣的內容;框架
當你的網站包含一些沒法被google crawlable的內容(好比除了flash,js,image外的富媒體),你不能給google以隱藏的內容。由於你應該考慮到那些真正訪問你的網站的用戶也是沒法看到這些內容的。less
google的建議是:對那些關閉image功能的用戶提供alt text描述image信息,在noscript tag中提供js的文本替代內容(注意:核心的要求就是你對用戶及google一視同仁,內容基本同樣~!)
「
ensure that you provide the same content in both elements(for instance, provide the same text in js in the noscript tag)
」
若是你的網站持續不斷地執行:noscript和js部份內容不一致,google將會採起行動。
當googlebot檢索一個包含js的網頁時,它會index那個網頁,可是它並不會follow或者index任何在js中所隱含的連接。使用js自己是合法的web實踐。然而,使用js故意欺騙js是不被容許的。例如,placing in different text in js than in a noscript tag violates our webmaster guidelines because it displays different content for users(who see the jsbased text)than for google(which see the noscript-based text)。
Along those lines, it violates the webmaster guidelines to embed a link in js that redirects the user to a different page with the intent to show the user a different page than the search engine sees. When a redirect link is embedded in js, the search engine indexes the original page rather than following the link, whereas users are taken to the redirect target. Like cloaking, this practice is deceptive because it displays different content to users and to googlebot, and can take a visitor somewhere other than where they intended to go.
Note that placement of links within jasvascript is alone not deceptive. When examining js on your site to ensure your site adheres to google guidelines, consider the intent:
Keep in mind that since search engines generally can't access the contents of JavaScript, legitimate links within JavaScript will likely be inaccessible to them (as well as to visitors without Javascript-enabled browsers). You might instead keep links outside of JavaScript or replicate them in a noscript tag. Doorway pages
Doorway pages are typically large sets of poor-quality pages where each page is optimized for a specific keyword or phrase. In many cases, doorway pages are written to rank for a particular phrase and then funnel users to a single destination.
Whether deployed across many domains or established within one domain, doorway pages tend to frustrate users, and are in violation of our Webmaster Guidelines.
Google's aim is to give our users the most valuable and relevant search results. Therefore, we frown on practices that are designed to manipulate search engines and deceive users by directing them to sites other than the ones they selected, and that provide content solely for the benefit of search engines. Google may take action on doorway sites and other sites making use of these deceptive practice, including removing these sites from the Google index.
If your site has been removed from our search results, review our Webmaster Guidelines for more information. Once you've made your changes and are confident that your site no longer violates our guidelines, submit your site for reconsideration.