连续6年不跑路的安全速度最适合国人VPN
在微信公衆號文章中顯示鏈接預覽的方法包括:配置文章詳情頁的 og:title、og:description、og:image、og:url 頁面參數,以及添加 microdata 或 json-ld 結構化數據。添加的外鏈圖片尺寸不宜過大,可在草稿箱中預覽效果,不同微信版本顯示效果可能有所差異。
如何讓微信公衆號文章顯示鏈接預覽
微信公衆號文章中顯示鏈接預覽(卡片),可以吸引用戶的注意力,提高點擊率。以下是如何實現這一功能的方法:
一、配置文章詳情頁的頁面參數
在文章詳情頁的 HTML 代碼中,需要添加以下幾個頁面參數:
- og:title:預覽中顯示的標題
- og:description:預覽中顯示的描述
- og:image:預覽中顯示的圖片
- og:url:預覽中的鏈接地址
例如:
<meta property="og:title" content="文章標題" /><meta property="og:description" content="文章描述" /><meta property="og:image" content="https://example.com/image.jpg" /><meta property="og:url" content="https://example.com/article" />登錄後複製
二、添加 Microdata 或 JSON-LD
在文章正文的 HTML 代碼中,還可以添加 Microdata 或 JSON-LD 結構化數據,以進一步豐富預覽信息。
Microdata:
<div itemscope itemtype="http://schema.org/Article"> <h1 itemprop="name">文章標題</h1> <div itemprop="description">文章描述</div> <link itemprop="image" href="https://example.com/image.jpg" /> <link itemprop="url" href="https://example.com/article" /></div>登錄後複製
JSON-LD:
<script type="application/ld+json">{ "@context": "http://schema.org", "@type": "Article", "name": "文章標題", "description": "文章描述", "image": "https://example.com/image.jpg", "url": "https://example.com/article"}</script>登錄後複製注意:
- 所添加的圖片 URL 必須爲外鏈地址,且圖片尺寸不宜過大。
- 如果要在草稿箱中預覽鏈接效果,需要將文章設置爲 "發佈" 狀態。
- 不同微信版本顯示效果可能有所差異。
以上就是微信公衆號怎麼發鏈接預覽的詳細內容,更多請關注本站其它相關文章!