用js写的网站会收录吗,好做SEO优化吗?

发布于 2023-06-21  538 次阅读


会有收录,但是不好做优化,会影响百度收录和百度关键词排名。

不信可以看下百度搜索的结果:

实际案例:

<!DOCTYPE html><html lang=""><head><meta content=noarchive name=Baiduspider><meta name=robots content=noarchive><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><meta http-equiv=X-UA-Compatible content="IE=EDGE,chrome=1"><meta http-equiv=pragma content=no-cache><meta http-equiv=cache-control content="no-cache, no-store, must-revalidate"><meta http-equiv=expires content=0><title>塑购商城</title><script type=text/javascript>document.write(unescape("%3Cspan style='display:none' id='cnzz_stat_icon_1281235203'%3E%3C/span%3E%3Cscript src='https://s9.cnzz.com/z_stat.php%3Fid%3D1281235203%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script><script src=https://sugoufile.sugou.cc/release-package/redirect-pc.js></script><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><script src=https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js></script><script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script><script>var _czc = _czc || []</script><script>var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?3ea8d3baa5842da8f3f17e26af8b6933";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();</script></head><body><div id=app></div></body></html>

他的网站内容其实也很丰富,产品sku很多,但过了这么久,百度只收录了首页,流量是0。

哪怕是我们自己做博客,经过一年的时间,网站每天也该有十几个IP了。

做SEO的都知道,要有搜索流量,搜索引擎蜘蛛需要顺利爬行链接,抓取页面,解析并索引页面html代码中的内容,然后才有上排名和获取流量这些后续。在爬行、抓取、索引的过程中,如果JS造成障碍,就会导致问题。浏览器执行JS、渲染页面是肯定的,使用用户访问一切正常。但是搜索引擎蜘蛛抓取页面html代码时,遇到JS不一定会去执行JS脚本,那么需要执行JS才能看到的内容,搜索引擎就不一定看得到。Google遇到页面JS时,会在有计算资源、且页面有比较高价值时,尝试执行脚本、渲染页面。百度则基本上不执行JS脚本。所以做中文网站,使用JS上就更要谨慎。