我们在使用typecho的时候header会生成这样一个meta
<meta name="generator" content="Typecho 版本号" />
那么怎么将这个meta去掉呢
文件路径:var/Widget/Archive.php,查找<meta name="generator"
查找到之后将代码删除就可以了
第二种方法
银狐觉得这个方法比较繁琐,是修改模板的,而上面的方法较为简单直接修改系统文件就完成了。
删除Typecho模版中程序版本号、模版名称等多余Meta标签,只保留关键字标签(description)与描述标签 (keywords)
先献上代码:header('generator=&template=&pingback=&xmlrpc=&wlw=&atom=&rss1=&rss2='); ?>
请替换模版中<?php $this->header(); ?>,考虑SEO友好所以保留description及keywords如果其它有需求可以自行保留比如rss,一般都会在界面增加rss按钮一般可以为浏览器等工具提供探测。
基本用法:
keywords= (表示替换keywords标签内容,当"="后面没有内容则表示屏蔽调用,也就是删除)
& (处理多个时用到,如果有下一个需要屏蔽放下一个前面区隔开就可以了)
值解释:
内容描述/description:<meta name="description" content="银狐笔记_www.ityinhu.com" />
关键字/keywords:<meta name="keywords" content="银狐笔记_www.ityinhu.com" />
程序信息/generator:<meta name="generator" content="Typecho 版本号" />
模版名/template:<meta name="template" content="yinhu" />
文章引用/pingback:<link rel="pingback" href="https://www.ityinhu.com/action/xmlrpc" />
离线写作接口/xmlrpc:<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.ityinhu.com/action/xmlrpc?rsd" />
离线写作接口/wlw:<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://www.ityinhu.com/action/xmlrpc?wlw" />
Feed地址/rss2:<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="https://www.ityinhu.com/feed/" />
上面有提到当“=”后面没有内容就将值屏蔽了,如果“=”后面有内容就代替默认的
如:generator=Wordpress,那么前端调用后就是<meta name="generator" content="Wordpress" />