大家都知道,DT官方是封禁搜索页的,是不让百度蜘蛛抓取的,但是搜索页又是大型网站优化的重点,今天来说说关于DT6.0搜索页熊掌号的改造方法,如果您要改造内容页面可以查看我前几期的分享!
首先要开启百度蜘蛛抓取,我之前发布过,请看这个:http://blog.51cto.com/11024720/2071313
附上以下代码,供给大家参考,本方法是自己想的,如有更好方法,可以一起分享交流。
<link rel="canonical" href="<?php
echo $MOD[linkurl].'search-htm-'.$_SERVER['QUERY_STRING'];
?>
"/>
<script src="//msite.baidu.com/sdk/c.js?appid=1594888518697810"></script>
<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "<?php
echo $MOD[linkurl].'search-htm-'.$_SERVER['QUERY_STRING'];
?>",
"appid": "熊掌号ID",
"title": "{if $seo_title}{$seo_title}{else}{if $head_title}{$seo_title}{$head_title}{$DT[seo_delimiter]}{/if}{if $city_sitename}{$city_sitename}{else}{$DT[sitename]}{/if}{/if}",
"description": "{$seo_title}",
"images": [
"{$thumb}"
],
"pubDate":"<?php
$dateTime2= date("H:i:s",$editdate);
echo date("Y-m-d")."T"."$dateTime2"
?>", "upDate": "<?php
$dateTime2= date("H:i:s",$editdate);
echo date("Y-m-d")."T"."$dateTime2"
?>", "lrDate": "<?php
$dateTime2= date("H:i:s",$editdate);
echo date("Y-m-d")."T"."$dateTime2"
?>"
}
</script>
<!--百度出图!-->
<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "<?php
echo $MOD[linkurl].'search-htm-'.$_SERVER['QUERY_STRING'];
?>;",
"appid": "熊掌号ID",
"title": "{if $seo_title}{$seo_title}{else}{if $head_title}{$seo_title}{$head_title}{$DT[seo_delimiter]}{/if}{if $city_sitename}{$city_sitename}{else}{$DT[sitename]}{/if}{/if}",
"images": [
"{$thumb}",
],
"pubDate": "<?php
$dateTime2= date("H:i:s",$editdate);
echo date("Y-m-d")."T"."$dateTime2"
?>"
}
</script>
以上就是我的搜索页熊掌号改造,测试地址:http://zhimo.yuanzhumuban.cc/sell/search-htm-kw-%E5%9C%86%E6%9F%B1%E6%A8%A1%E6%9D%BF.html