百度推出了熊掌號,想提交的內(nèi)容在搜索結(jié)果中以結(jié)構(gòu)化樣式展現(xiàn),需要做好頁面改造。這個功能秀站網(wǎng)在360搜索中有了解過,如果你想讓百度更喜歡你的網(wǎng)站,也想點擊率更高就趕緊動手把!
添加canonical標(biāo)簽
要求href的內(nèi)容為MIP頁或H5頁對應(yīng)的PC頁地址;如果沒有PC頁,則填寫當(dāng)前頁面地址,支持http和https
<link rel="canonical" href="http(s)://xxx"/>
本博客就是自適應(yīng)網(wǎng)站,可以填寫如下,
首頁模板 <link rel="canonical" href="{dede:global.cfg_basehost/}"/> 列表模板 <link rel="canonical" href="{dede:type}[field:typeurl/]{/dede:type}"/> 文章模板 <link rel="canonical" href="{dede:field.arcurl/}"/> 標(biāo)簽首頁模板和標(biāo)簽列表都可以用 <link rel="canonical" href="{dede:php}echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];{/dede:php}"/> 有些tag標(biāo)簽使用的是中文,這個獲取的是當(dāng)前頁面的URL
添加JSON_LD數(shù)據(jù)
↑以上紅色框出來的需要根據(jù)實際情況調(diào)整
把以下代碼放在頁面的最底部就行了,沒必要放在</head>頭部,下面xxxxx是你的秘鑰,每個人的都不同。
<script type="application/ld+json"> { "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld", "@id": "https://ziyuan.baidu.com/college/articleinfo?id=1464", "appid": "xxxxx", "title": "{dede:field.title/}", "images": [ "{dede:field.litpic/}", "https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_ca79a146.png", "https://m.baidu.com/static/index/plus/plus_logo.png" ], "description": "{dede:field.description/}", "pubDate": "{dede:field.pubdate function="MyDate('Y-m-d\TH:i:s',@me)"/}", "upDate": "{dede:field.pubdate function="MyDate('Y-m-d\TH:i:s',@me)"/}", "lrDate": "{dede:field.pubdate function="MyDate('Y-m-d\TH:i:s',@me)"/}" } </script>
縮略圖只支持無縮略圖、1個或3個。
在線校驗工具
第一項選擇需要校驗的URL地址;
第二項選擇否,本博客沒必要采用MIP改造,根據(jù)自己實際情況選擇;
第三項是頁面的所有代碼,在所在的頁面右鍵->查看源代碼->復(fù)制粘貼進(jìn)去。
點擊下面的“校驗”按鈕即可,如果出錯會彈出提示如下
自己查看對比,直至校驗通過為止。