Home > CMS Tutorial > DEDECMS > How does the dedecms Dreamweaver system connect to Baidu Xiongzhao and add JSON_LD data?

How does the dedecms Dreamweaver system connect to Baidu Xiongzhao and add JSON_LD data?

藏色散人
Release: 2019-12-10 09:46:34
Original
2606 people have browsed it

How does the dedecms Dreamweaver system connect to Baidu Xiongzhao and add JSON_LD data?

dedecmsHow does the DreamWeaver system connect to Baidu Xiongzhang Account and add JSON_LD data?

The Baidu Xiongzhao launched by Baidu is very good. My dedecms dream weaving system has been connected early. It can provide original protection for your original articles and evaluate the Xiongzhao search. Index, Xiongzhao search index is obtained by calculating and evaluating the five dimensions of your article's content quality, user preference, originality, active performance, and field focus.

Recommended learning: 梦Weavingcms

After your dedecms dreamweaving website opens the Xiongzhao account, you need to add JSON_LD data docking, otherwise the Baidu Xiongzhao account is If it is unable to detect your website and evaluate your website’s Xiongzhao search index, let’s learn about it below.

Note: All the following content is added to the article_article.htm article template page of the dedecms dream weaving system. There is no need to add it to the home page or article list page.

Step 1: Add the canonical tag

The content of href is required to be the PC page address corresponding to the MIP page or H5 page; if there is no PC page, fill in the current mobile page address, in Introduced within the tag.

//原来的
<link rel="canonical" href="http(s)://xxx"/>
 
//改成织梦里面的获取当前页链接
<link rel="canonical" href="{dede:global.cfg_basehost/}{dede:field name=&#39;arcurl&#39;/}"/>
Copy after login

Step 2: Add JSON_LD data

The code below is a JSON-LD example. There is an introduction to the field meanings in Xiongzhaohao. Please read it carefully:

<script type="application/ld+json">
{
 "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
 "@id": "https://ziyuan.baidu.com/college/articleinfo?id=1464",
 "appid": "1582779876867159",
 "title": "百度移动搜索落地页体验白皮书——广告篇2.0",
 "images": [
  "https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png",
  "https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_ca79a146.png",
  "https://m.baidu.com/static/index/plus/plus_logo.png"
  ],
Copy after login

"description ": "High-quality and reasonable advertisements are widely liked by users as a supplement to information. In early 2017, Baidu User Experience Department conducted a satisfaction survey on users and found that many malicious and low-quality advertisements seriously damaged users' search experience.",

 "pubDate": "2017-06-15T08:00:01"
}
</script>
Copy after login

Change the above part to our dedecms dream weaving system. It is fixed and absolutely suitable for your website. Don’t worry.

<script type="application/ld+json">
{
 "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
 "@id": "{dede:global.cfg_basehost/}{dede:field name=&#39;arcurl&#39;/}",
 "appid": "1582779876867159",
 "title": "{dede:field.title/}",
 "images": [
    "{dede:field.litpic /}"  //获取文章第一张图片
  ],
 "description": "{dede:field.description function=&#39;html2text(@me)&#39;/}",
 "pubDate": "{dede:field.pubdate function="MyDate(&#39;Y-m-dTH:i:s&#39;,@me)"/}"
}
</script>
Copy after login

Step 3: Add Xiongzhanghao ID statement

Add code before the

tag on the page

<script src="//msite.baidu.com/sdk/c.js?appid=1582779876867159"></script>
Copy after login

Note: appid is Xiongzhanghao’s unique ID , please do not make any modifications, otherwise it will not be displayed normally.

Step 4: Add the follow function code (strongly recommended). You can add it or not. If you have a separate mobile terminal, you can add it. Adding it to the PC terminal is not suitable

Step 5: Page format verification means that you add the above content to the article_article.htm template page of your dedecms website, and then after updating the website, you need to verify whether your JSON_LD data is really connected. Correct, as shown in the picture.

The above is the detailed content of How does the dedecms Dreamweaver system connect to Baidu Xiongzhao and add JSON_LD data?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template