Using a different image for microdata that isn't displayed in the article?

后端 未结 2 1742
滥情空心
滥情空心 2020-12-21 18:57

I\'m working on a website that has a bunch of articles.

I\'m looking to find a way to add an image that is invisible without putting it inside a hidden div.<

相关标签:
2条回答
  • 2020-12-21 19:28

    You can use JSON-LD instead of microdata.

    That way you add everything you want in JSON data that is not displayed in the page, but recognized by most search engines.

    Here is an example taken from http://schema.org/CreativeWork:

    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "CreativeWork",
      "name": "My Article",
      "image": "http://your.image.url.com"
    }
    </script>
    
    0 讨论(0)
  • 2020-12-21 19:29

    With Microdata, you may use meta and link elements in the body.

    If the value is a URI, you must use link instead of meta.

    So in your case, the markup would be:

    <link itemprop="image" href="link/to/image.jpg">
    
    0 讨论(0)
提交回复
热议问题