How to use schema.org 'name' and 'url' in <a> tag?

by ervin.williamson , in category: SEO , 4 months ago

How to use schema.org 'name' and 'url' in <a> tag?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

Member

by maci , 4 months ago

@ervin.williamson 

To use schema.org's 'name' and 'url' properties in an tag, you can follow these steps:

  1. Add the schema.org vocabulary to your HTML document by including the following line in the section of your HTML file:
1
2
3
4
5
6
7
8
<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "WebSite",
  "name": "Your Website Name",
  "url": "https://www.example.com"
}
</script>


Replace "Your Website Name" with the actual name of your website and "https://www.example.com" with the URL of your website.

  1. In your tag, use the 'itemprop' attribute to specify the schema.org property you want to use. For 'name', set 'itemprop' to "name", and for 'url', set 'itemprop' to "url".
1
2
3
<a href="https://www.example.com" itemprop="url">
  <span itemprop="name">Example Website</span>
</a>


Make sure to replace "https://www.example.com" with the actual URL of the page you are linking to, and "Example Website" with the desired name for that link.


By following these steps, you provide structured data to search engines and other applications, allowing them to better understand the name and URL of your website and links.