为了更好的优化,我们可以借鉴Google给的noindex标签进行编辑,这样告知Google搜索引擎不再去抓取二级类目列表页。 noindex标签的写法如下: <meta name=”robots” content=”noindex, follow” /> 就是在页面开头的部分增加一段这样的代码告知Google搜素引擎,这样Google 1.jpeg 如上图所示,使用了noindex的标签页面,一定不要放到网站站点地图中,否则Google Search Console就会报错。
为了精细化控制被索引的页面,有时也需要通过noindex处理。为让 noindex 生效,网页或资源需要不被 robots.txt 文件的规则屏蔽,并且必须能被访问。 支持的指令指令说明all无限制,为默认值noindex不在搜索结果中显示此网页、媒体或资源nofollow不追踪该网页上的链接none等同于 noindex, nofollownosnippet不在搜索结果中显示该网页的摘要或视频预览 -- 禁止所有爬虫 --><meta name="robots" content="<em>noindex</em>, nofollow"><! -- 仅禁止Google --><meta name="googlebot" content="<em>noindex</em>"><! 原文地址:如何通过 noindex 阻止网页被搜索引擎编入索引?
/css/fonts/Light/OpenSans-Light.woff HTTP/1.1" 404 241 "http://10.0.0.200/noindex/css/open-sans.css" /css/fonts/Bold/OpenSans-Bold.ttf HTTP/1.1" 404 238 "http://10.0.0.200/noindex/css/open-sans.css" "Mozilla /css/fonts/Light/OpenSans-Light.ttf HTTP/1.1" 404 240 "http://10.0.0.200/noindex/css/open-sans.css" " /css/fonts/Light/OpenSans-Light.woff HTTP/1.1" 404 241 "http://10.0.0.200/noindex/css/open-sans.css" /css/fonts/Light/OpenSans-Light.ttf HTTP/1.1" 404 240 "http://10.0.0.200/noindex/css/open-sans.css" "
Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240" 192.168.124.131 - - [23/Oct/2019:22:23:33 +0800] "GET /noindex Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240" 192.168.124.131 - - [23/Oct/2019:22:23:33 +0800] "GET /noindex Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240" 192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240" 192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240" 192.168.124.131 - - [23/Oct/2019:22:23:34 +0800] "GET /noindex
. # <LocationMatch "^/+$"> Options -Indexes ErrorDocument 403 /.noindex.html </LocationMatch> <Directory /usr/share/httpd/noindex> AllowOverride None Require all granted </Directory> 进行注释上述文件 will be restored on upgrades. # #<LocationMatch "^/+$"> # Options -Indexes # ErrorDocument 403 /.noindex.html #</LocationMatch> #<Directory /usr/share/httpd/noindex> # AllowOverride None # Require all granted #</Directory> #Alias /.noindex.html /usr/share/httpd/noindex/index.html httpd 文件配置如下所示: <Directory
# 错误返回代码和网页 </LocationMatch> <Directory /usr/share/httpd/noindex> AllowOverride None Require all granted </Directory> Alias /.noindex.html /usr/share/httpd/noindex/index.html Alias / noindex/css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css Alias /noindex/css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css Alias /images/apache_pb.gif /usr/share/httpd/noindex/images /apache_pb.gif Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png conf.d/ssl.conf
ROBOTS元标签最佳SEO实践操作 ROBOTS元标签是HTML标签,如果查看网页源码,在HEAD部分找到它,看起来像这样: <head> <meta name=”robots” content=”noindex ROBOTS标签“CONTENT”属性有效值为: “INDEX” “NOINDEX” “FOLLOW” “NOFOLLOW” 看起来非常直观清晰,例如: META NAME="ROBOTS" CONTENT ="NOINDEX, FOLLOW" META NAME="ROBOTS" CONTENT="INDEX, NOFOLLOW" META NAME="ROBOTS" CONTENT="NOINDEX, 2017年以来不再支持; NONE - 相当于“NOINDEX,NOFOLLOW”。 我们可以识别以下值(指定多个值时,请使用英文逗号进行分隔): noindex - 告诉Googlebot不要索引该网页; nofollow - 告诉Googlebot不要跟踪该网页上的链接; nosnippet
int* returnSize) { int* ptr = (int*)malloc(sizeof(int) * numsSize); int index = 0; int noindex index + 1)//判断是否与下标+1相等 { index++; } else { noindex = nums[index] - 1; if (nums[noindex] == nums[index])//如果当前下标的数与 //与对应位置的数相等 { index++; continue; } int tmp = nums[noindex ];//不相等就交换 nums[noindex] = nums[index]; nums[index] = tmp; } }
最简单的 meta robots 标签格式为: <meta name=”robots” content=”noindex,nofollow”> 效果是禁止所有搜索引擎索引本页面,禁止跟踪本页面上的链接。 <meta name=”robots” content=”noindex”> 效果是禁止索引本页面,但允许蜘蛛跟踪页面上的链接,也可以传递权重。 Google、必应、雅虎支持的标签如下: Noindex:不要索引本页面 Nofollow:不要跟踪本页面上的链接 Nosnippet:不要在搜索结果中显示摘要文字 Noarchive:不要显示快照 Noodp 使用了 noindex meat robots 标签的页面会被抓取,但不会被索引,页面URL也不会出现在搜索结果中,这一点与 robots 文件不同。
robots 用于告诉网页爬虫如何索引网页 <meta name="robots" content="all"> 它有以下几种参数值: all:对索引编制或内容显示无任何限制, 该指令为默认值 noindex : 告诉搜索引擎不要索引当前页, 等价于noindex,nofollow index: 告诉搜索引擎索引当前页 follow: 即使页面没有被索引,爬虫也应该爬取页面上的所有链接 nofollow : 告诉爬虫不要跟踪页面上的任何链接以及资源 noimageindex: 告诉爬虫不要索引页面上的任何图片 none: 相当于同时使用 noindex 和 nofollow noarchive:
常用 Meta Robots 指令及示例指令作用示例index允许搜索引擎索引该页面noindex禁止搜索引擎索引该页面follow允许爬虫跟踪页面上的链接nofollow禁止爬虫跟踪页面上的链接none 等同于 noindex, nofollownoarchive禁止搜索引擎缓存页面快照nosnippet禁止在搜索结果中显示摘要notranslate禁止自动翻译该页面noimageindex禁止索引页面上的图片 实际应用场景✅ 禁止收录登录页、隐私政策页(noindex)✅ 允许收录但阻止权重传递(index,nofollow)✅ 禁止缓存敏感内容(noarchive)✅ 设置页面过期时间(unavailable_after
sname varchar(64), gender int, dept_id int, primary key(sid) ); 创建一个什么索引都没有的表 create table students_noindex ); Set n=n+1; End while; End; // delimiter ; # 没有索引的 表 delimiter // CREATE PROCEDURE `proc_students_noindex `() Begin Declare n int default 1; while n<=500000 do Insert into students_noindex values(n, concat(' 结构 分别在两个表插入数据看时间消耗 set autocommit=0; call proc_students(); commit; call proc_students_noindex(); commit select count(*) from students a inner join dept b on a.dept_>explain select count(*) from students_noindex
可以通过在WHERE子句或ON子句条件前使用%NOINDEX关键字来防止使用索引。 应该为联接中指定的字段(属性)编制索引。左外部联接从左表开始,然后查看右表;因此,应该为右表中的字段建立索引。 可以通过在范围条件前面加上%noindex来确定是否发生这种情况,然后再次运行查询。 如果使用索引字段执行比较,则比较中指定的字段的排序规则类型应与其在相应索引中的排序规则类型相同。 可以使 %NOINDEX条件级别提示指定对特定条件使用索引的例外情况。 %NOINDEX提示放在每个不应使用索引的条件之前。例如,WHERE %NOINDEX hiredate < ? 对于小于(<)或大于(>)的条件,使用%NOINDEX条件级别提示通常是有益的。对于相等条件,使用%NOINDEX条件级别提示不会带来任何好处。使用联接条件时,ON子句联接支持%NOINDEX。 %NOINDEX关键字可用于覆盖在FROM子句中建立的索引优化。在下面的示例中,%ALLINDEX优化关键字适用于除E.Age条件之外的所有条件测试
还可以使用Robots Meta来向搜索引擎传递信息,先看示例如下: <META NAME="ROBOTS" CONTENT="INDEX,FOLLOW"> content部分有四个选项:index、noindex 共有四种组合: <META NAME="ROBOTS" CONTENT="INDEX,FOLLOW"> <META NAME="ROBOTS" CONTENT="NOINDEX,FOLLOW"> <META NAME="ROBOTS" CONTENT="INDEX,NOFOLLOW"> <META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW"> 其中: <META NAME ROBOTS" CONTENT="INDEX,FOLLOW">可以写成<META NAME="ROBOTS" CONTENT="ALL">; <META NAME="ROBOTS" CONTENT="NOINDEX
不允许网站根下所有内容) User-agent: * Disallow: / 2.在网页代码里添加 meta 标签来实现 拦截所有搜索引擎收录和索引网页 <meta name="robots" content="<em>noindex</em> ,nofollow"> 只拦截百度蜘蛛,而允许其他搜索引擎索引收录 <meta name="baiduspider" content="<em>noindex</em>,nofollow"> 允许搜索引擎收录索引网页,但禁止继续追踪页面链接
另外要说明一点:如果对方网页设置了nofollow或者noindex、或者对方给你的链接中加入了nofollow均可视为没检测到,因为nofollow或者 noindex对你的链接搜索引擎是不会给分的。
content的参数有all,none,index,noindex,follow,nofollow。默认是all。 具体参数如下: 1.none : 搜索引擎将忽略此网页,等价于noindex,nofollow。 2.noindex : 搜索引擎不索引此网页。
robots.txt的补充 如果你没有对网站根目录的写入权限(无法建立robots.txt文件),或你想要某个指定的网页不被搜索引擎收录,可以使用元标签阻止爬虫访问: name="robots" content="noindex "> name="googlerobot" content="noindex"> robots元标记的默认值为”index,follow”,它的取值可以是 (来自Google站长帮助): noindex 防止网页被编入索引。
它是通过添加 noindex,follow 这样的 meta 标签实现的。 <meta name="robots"content="<em>noindex</em>,follow"> 翻译自 Most Desired WordPress Hacks: 11 Common Requests and
如果你没有对网站根目录的写入权限(无法建立robots.txt文件),或你想要某个指定的网页不被搜索引擎收录,可以使用元标签阻止爬虫访问: <meta name="robots" content="<em>noindex</em> -- 阻止所有爬虫 --> <meta name="googlerobot" content="<em>noindex</em>"> <! -- 阻止Google收录 --> robots元标记的默认值为”index,follow”,它的取值可以是(来自Google站长帮助): noindex 防止网页被编入索引。