宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

在默认的模板中,头部信息的输出的HTML是这样的

<meta name="description" content="Just So So ..." />
<meta name="keywords" content="typecho,php,blog" />
<meta name="generator" content="Typecho 0.8/10.8.15" />
<meta name="template" content="default" />
<link rel="pingback" href=".../action/xmlrpc" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href=".../action/xmlrpc?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href=".../action/xmlrpc?wlw" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href=".../feed/" />
<link rel="alternate" type="application/rdf+xml" title="RSS 1.0" href=".../feed/rss/" />
<link rel="alternate" type="application/atom+xml" title="ATOM 1.0" href=".../feed/atom/" />

 

其实更改里面的输出内容即可,具体操作 header.php 中的这个函数

打开模板中的 header.php 文件,找到下面这句

<?php $this->header(); ?>

加上你要设置的参数即可,比如:例如把该函数修改如下:

<?php $this->header('keywords=&generator=&template=&pingback=&xmlrpc=&wlw='); ?>

以上代码即可过滤关键词、程序、模板名称、文章引用、离线写作等信息的输出,具体效果如下。

<meta name="description" content="..." />
<link rel="alternate" type="applicationrss+xml" title="RSS 2.0" href=".../feed/" />
<link rel="alternate" type="application/rdf+xml" title="RSS 1.0" href=".../feed/rss/" />
<link rel="alternate" type="application/atom+xml" title="ATOM 1.0" href=".../feed/atom/" />

操作参数及方法说明

keywords:关键词
description:描述、摘要
rss1:feed rss1.0
rss2:feed rss2.0
atom:feed atom
generator:程序版本等
template:模板名称
pingback:文章引用
xmlrpc:离线写作
wlw:好像也是离线写作的,请高手指正

注:等号(=)为空则不输出该项目,各个参数之间使用 “&” 连接。 如果需要自定义rss地址,只填上 rss2=feed订阅地址 即可。

commentReply:deef 补充了个不输出评论回复JS的,不过这个要慎用,不然回复框跟随效果会失效。

 

转自:https://www.nhstu.com/12866.html