OGP 和 JSON-LD
About 284 wordsLess than 1 minute
SEOOGPJSON-LDOpen Graph Protocol
2025-02-10
Both OGP (Open Graph Protocol) and JSON-LD (JavaScript Object Notation for Linked Data) are methods used to add metadata to web pages, but they serve different purposes and are used by different platforms.
Open Graph Protocol (OGP)
OGP was originally developed by Facebook and is widely used by social media platforms (such as Facebook, Twitter, LinkedIn, etc.) to display rich previews when a webpage is shared. By including specific meta tags in the <head>
section of your HTML, you can control the title, description, image, URL, and other details that appear in social media posts.
<head>
<meta property="og:title" content="Example Page Title" />
<meta property="og:description" content="This is a brief description of the page." />
<meta property="og:image" content="https://example.com/image.jpg" />
<meta property="og:url" content="https://example.com/page" />
<meta property="og:type" content="website" />
</head>
JSON-LD (JavaScript Object Notation for Linked Data)
JSON-LD is a method for encoding linked data using JSON. It is primarily used to add structured data to web pages so that search engines (like Google) can better understand the content and context of your page. This, in turn, can improve your page’s appearance in search results, sometimes leading to rich snippets or other enhanced search features.
<head>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Example Page Title",
"description": "This is a brief description of the page.",
"image": "https://example.com/image.jpg",
"url": "https://example.com/page",
"datePublished": "2025-02-10",
"author": {
"@type": "Person",
"name": "Jane Doe"
}
}
</script>
</head>