Cara menggunakan iso 8601 javascript

Create a time object based on an ISO 8601 date-time string (e.g. ‘2013-01-01T01:01:01+00:00’). RethinkDB supports all valid ISO 8601 formats except for week dates. Read more about the ISO 8601 format at Wikipedia.

Show

If you pass an ISO 8601 string without a time zone, you must specify the time zone with the defaultTimezone argument.

The date.toISOString() method is used to convert the given date object’s contents into a string in ISO format (ISO 8601) i.e, in the form of (YYYY-MM-DDTHH:mm:ss.sssZ or ±YYYYYY-MM-DDTHH:mm:ss.sssZ).The date object is created using date() constructor. 

Syntax:

dateObj.toISOString()

Parameters: This method does not take any parameter. It is just used along with a Date object created using Date() constructor. 

Return Values: It returns the converted string of Date() constructor contents into ISO format (ISO 8601). 

Note: The DateObj is a valid Date object created using Date()constructor.

Below is the example of Date toISOString() method.

Example 1:

javascript




// Here a date has been assigned

// while creating Date object

var dateobj = 

new Date(

1996-10-15T00:05:32.000Z
0
1996-10-15T00:05:32.000Z
1

1996-10-15T00:05:32.000Z

1996-10-15T00:05:32.000Z
3

1996-10-15T00:05:32.000Z
4

var

1996-10-15T00:05:32.000Z
6

1996-10-15T00:05:32.000Z

1996-10-15T00:05:32.000Z
8

1996-10-15T00:05:32.000Z
9

Output:

1996-10-15T00:05:32.000Z

Example 2: Here nothing as a parameter is passed while creating date object but still toISOString() method return current day name, month name, date, year, and time. 

javascript




2018-04-23T10:26:00.996Z
0

// while creating Date object

var

2018-04-23T10:26:00.996Z
3new
2018-04-23T10:26:00.996Z
5

1996-10-15T00:05:32.000Z

2018-04-23T10:26:00.996Z
7

2018-04-23T10:26:00.996Z
8

var

1996-10-15T00:05:32.000Z
6

1996-10-15T00:05:32.000Z

1996-10-15T00:05:32.000Z
8

1996-10-15T00:05:32.000Z
9

Output:

2018-04-23T10:26:00.996Z

Example 3: Here we will pass a date object toISOString() method return day name, month name, date, year, and time. 

javascript




2018-04-23T10:26:00.996Z
0

// while creating Date object

var dateobj = 

new Date(// Here a date has been assigned0

1996-10-15T00:05:32.000Z
1

1996-10-15T00:05:32.000Z

2018-04-23T10:26:00.996Z
7

2018-04-23T10:26:00.996Z
8

var

1996-10-15T00:05:32.000Z
6

1996-10-15T00:05:32.000Z

1996-10-15T00:05:32.000Z
8

1996-10-15T00:05:32.000Z
9

Output:

1996-10-13T08:35:32.000Z

Note: Months, Dates, hours, minutes, seconds, and milliseconds should all be in their respective range of 0 to 11, 1 to 31, 0 to 23, 0 to 59, 0 to 59, 0 to 999 respectively. 

We have a complete list of Javascript Date Objects, to check those please go through this Javascript Date Object Complete reference article.

Supported Browsers: The browsers supported by JavaScript Date toISOString() method are listed below:

  • Google Chrome
  • Internet Explorer
  • Mozilla Firefox
  • Opera
  • Safari

We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript.

Dengan menambahkan data terstruktur

<html>
  <head>
    <title>Title of a News Article</title>
  </head>
  <body>
    <div itemscope itemtype="https://schema.org/NewsArticle">
      <div itemprop="headline">Title of News Article</div>
      <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
      <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
      <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
      <div>
        <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
          February 5, 2015 at 8:00am
        </span>
        (last modified
        <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
          February 5, 2015 at 9:20am
        </span>
        )
      </div>
      <div>
        by
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/janedoe123">
            <span itemprop="name">Jane Doe</span>
          </a>
        </span>
        and
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/johndoe123">
            <span itemprop="name">John Doe</span>
          </a>
        </span>
      </div>
    </div>
  </body>
</html>
0 ke halaman artikel berita, blog, dan olahraga, Anda dapat membantu Google lebih memahami halaman web serta menampilkan teks judul, gambar, dan informasi tanggal dengan lebih baik untuk artikel di hasil penelusuran di Google Penelusuran dan properti lainnya (misalnya, Google Berita dan Asisten Google). Meskipun tidak ada persyaratan markup yang perlu dipenuhi untuk menggunakan fitur Google Berita seperti Berita utama, Anda dapat menambahkan
<html>
  <head>
    <title>Title of a News Article</title>
  </head>
  <body>
    <div itemscope itemtype="https://schema.org/NewsArticle">
      <div itemprop="headline">Title of News Article</div>
      <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
      <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
      <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
      <div>
        <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
          February 5, 2015 at 8:00am
        </span>
        (last modified
        <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
          February 5, 2015 at 9:20am
        </span>
        )
      </div>
      <div>
        by
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/janedoe123">
            <span itemprop="name">Jane Doe</span>
          </a>
        </span>
        and
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/johndoe123">
            <span itemprop="name">John Doe</span>
          </a>
        </span>
      </div>
    </div>
  </body>
</html>
0 untuk memberi tahu Google secara lebih eksplisit tentang konten Anda (misalnya, bahwa itu merupakan artikel berita, siapa penulisnya, atau apa judulnya).

Cara menggunakan iso 8601 javascript

Contoh

Berikut contoh halaman dengan data terstruktur

<html>
  <head>
    <title>Title of a News Article</title>
  </head>
  <body>
    <div itemscope itemtype="https://schema.org/NewsArticle">
      <div itemprop="headline">Title of News Article</div>
      <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
      <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
      <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
      <div>
        <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
          February 5, 2015 at 8:00am
        </span>
        (last modified
        <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
          February 5, 2015 at 9:20am
        </span>
        )
      </div>
      <div>
        by
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/janedoe123">
            <span itemprop="name">Jane Doe</span>
          </a>
        </span>
        and
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/johndoe123">
            <span itemprop="name">John Doe</span>
          </a>
        </span>
      </div>
    </div>
  </body>
</html>
0.

JSON-LD


<html>
  <head>
    <title>Title of a News Article</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "NewsArticle",
      "headline": "Title of a News Article",
      "image": [
        "https://example.com/photos/1x1/photo.jpg",
        "https://example.com/photos/4x3/photo.jpg",
        "https://example.com/photos/16x9/photo.jpg"
       ],
      "datePublished": "2015-02-05T08:00:00+08:00",
      "dateModified": "2015-02-05T09:20:00+08:00",
      "author": [{
          "@type": "Person",
          "name": "Jane Doe",
          "url": "https://example.com/profile/janedoe123"
        },{
          "@type": "Person",
          "name": "John Doe",
          "url": "https://example.com/profile/johndoe123"
      }]
    }
    </script>
  </head>
  <body>
  </body>
</html>

Microdata


<html>
  <head>
    <title>Title of a News Article</title>
  </head>
  <body>
    <div itemscope itemtype="https://schema.org/NewsArticle">
      <div itemprop="headline">Title of News Article</div>
      <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
      <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
      <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
      <div>
        <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
          February 5, 2015 at 8:00am
        </span>
        (last modified
        <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
          February 5, 2015 at 9:20am
        </span>
        )
      </div>
      <div>
        by
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/janedoe123">
            <span itemprop="name">Jane Doe</span>
          </a>
        </span>
        and
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/johndoe123">
            <span itemprop="name">John Doe</span>
          </a>
        </span>
      </div>
    </div>
  </body>
</html>

Cara menambahkan data terstruktur

Data terstruktur adalah format terstandarisasi untuk memberikan informasi tentang suatu halaman dan mengelompokkan konten halaman tersebut. Jika Anda baru mengenal data terstruktur, Anda dapat mempelajari lebih lanjut cara kerja data terstruktur.

Berikut adalah ringkasan tentang cara membuat, menguji, dan merilis data terstruktur. Untuk panduan langkah demi langkah tentang cara menambahkan data terstruktur ke halaman web, lihat codelab data terstruktur.

  1. Tambahkan . Berdasarkan format yang Anda gunakan, pelajari tempat .Menggunakan CMS? Menggunakan plugin yang terintegrasi ke CMS Anda mungkin akan lebih mudah.
    Menggunakan JavaScript? Pelajari cara membuat data terstruktur menggunakan JavaScript.
  2. Ikuti .
  3. Validasi kode Anda menggunakan Pengujian Hasil Kaya dan perbaiki setiap error kritis. Pertimbangkan juga untuk memperbaiki masalah non-kritis yang mungkin ditandai di alat tersebut, karena tindakan ini dapat membantu meningkatkan kualitas data terstruktur Anda (tetapi hal ini tidak diperlukan agar memenuhi syarat untuk hasil kaya).
  4. Deploy beberapa halaman yang menyertakan data terstruktur dan gunakan Alat Inspeksi URL untuk menguji cara Google melihat halaman tersebut. Pastikan halaman Anda dapat diakses oleh Google dan tidak diblokir oleh file robots.txt, tag
    <html>
      <head>
        <title>Title of a News Article</title>
      </head>
      <body>
        <div itemscope itemtype="https://schema.org/NewsArticle">
          <div itemprop="headline">Title of News Article</div>
          <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
          <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
          <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
          <div>
            <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
              February 5, 2015 at 8:00am
            </span>
            (last modified
            <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
              February 5, 2015 at 9:20am
            </span>
            )
          </div>
          <div>
            by
            <span itemprop="author" itemscope itemtype="https://schema.org/Person">
              <a itemprop="url" href="https://example.com/profile/janedoe123">
                <span itemprop="name">Jane Doe</span>
              </a>
            </span>
            and
            <span itemprop="author" itemscope itemtype="https://schema.org/Person">
              <a itemprop="url" href="https://example.com/profile/johndoe123">
                <span itemprop="name">John Doe</span>
              </a>
            </span>
          </div>
        </div>
      </body>
    </html>
    6, atau persyaratan login. Jika halaman tidak bermasalah, Anda dapat meminta Google meng-crawl ulang URL tersebut.Catatan: Tunggu beberapa saat hingga crawling dan pengindeksan ulang selesai. Perlu diingat bahwa Google mungkin memerlukan waktu beberapa hari untuk mencari dan meng-crawl halaman setelah Anda memublikasikannya.
  5. Agar Google tetap mengetahui setiap perubahan pada masa mendatang, sebaiknya kirimkan peta situs. Anda dapat mengotomatiskan proses ini dengan Search Console Sitemap API.

Pedoman

Anda harus mengikuti panduan ini agar data terstruktur memenuhi syarat untuk disertakan dalam hasil Google Penelusuran.

Peringatan: Jika situs Anda melanggar satu atau beberapa panduan ini, Google dapat melakukan tindakan manual terhadap situs tersebut. Setelah menyelesaikan masalahnya, Anda dapat mengirimkan situs Anda agar dipertimbangkan ulang.
  • Dasar-Dasar Penelusuran
  • Pedoman data terstruktur umum

Panduan teknis

  • Untuk artikel yang terdiri dari banyak bagian, pastikan
    <html>
      <head>
        <title>Title of a News Article</title>
      </head>
      <body>
        <div itemscope itemtype="https://schema.org/NewsArticle">
          <div itemprop="headline">Title of News Article</div>
          <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
          <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
          <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
          <div>
            <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
              February 5, 2015 at 8:00am
            </span>
            (last modified
            <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
              February 5, 2015 at 9:20am
            </span>
            )
          </div>
          <div>
            by
            <span itemprop="author" itemscope itemtype="https://schema.org/Person">
              <a itemprop="url" href="https://example.com/profile/janedoe123">
                <span itemprop="name">Jane Doe</span>
              </a>
            </span>
            and
            <span itemprop="author" itemscope itemtype="https://schema.org/Person">
              <a itemprop="url" href="https://example.com/profile/johndoe123">
                <span itemprop="name">John Doe</span>
              </a>
            </span>
          </div>
        </div>
      </body>
    </html>
    7 mengarah ke setiap halaman atau halaman "lihat-semua" (bukan ke halaman 1 dari sebuah rangkaian multi-bagian). Pelajari kanonikalisasi lebih lanjut.
  • Jika Anda menawarkan akses berbasis langganan ke konten situs Anda, atau jika pengguna harus mendaftar untuk mendapatkan akses, sebaiknya tambahkan data terstruktur untuk langganan dan konten berbayar berpenghalang.

Definisi jenis data terstruktur

Untuk membantu Google memahami halaman Anda dengan lebih baik, sertakan sebanyak mungkin properti yang direkomendasikan yang berlaku untuk halaman web Anda. Tidak ada properti yang sifatnya wajib; tambahkan properti yang berlaku untuk konten Anda.

Objek <html> <head> <title>Title of a News Article</title> </head> <body> <div itemscope itemtype="https://schema.org/NewsArticle"> <div itemprop="headline">Title of News Article</div> <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" /> <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" /> <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" /> <div> <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00"> February 5, 2015 at 8:00am </span> (last modified <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00"> February 5, 2015 at 9:20am </span> ) </div> <div> by <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/janedoe123"> <span itemprop="name">Jane Doe</span> </a> </span> and <span itemprop="author" itemscope itemtype="https://schema.org/Person"> <a itemprop="url" href="https://example.com/profile/johndoe123"> <span itemprop="name">John Doe</span> </a> </span> </div> </div> </body> </html>0

Objek Article harus didasarkan pada salah satu jenis schema.org berikut:

<html>
  <head>
    <title>Title of a News Article</title>
  </head>
  <body>
    <div itemscope itemtype="https://schema.org/NewsArticle">
      <div itemprop="headline">Title of News Article</div>
      <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
      <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
      <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
      <div>
        <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
          February 5, 2015 at 8:00am
        </span>
        (last modified
        <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
          February 5, 2015 at 9:20am
        </span>
        )
      </div>
      <div>
        by
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/janedoe123">
            <span itemprop="name">Jane Doe</span>
          </a>
        </span>
        and
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/johndoe123">
            <span itemprop="name">John Doe</span>
          </a>
        </span>
      </div>
    </div>
  </body>
</html>
0,
<html>
  <head>
    <title>Title of a News Article</title>
  </head>
  <body>
    <div itemscope itemtype="https://schema.org/NewsArticle">
      <div itemprop="headline">Title of News Article</div>
      <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
      <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
      <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
      <div>
        <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
          February 5, 2015 at 8:00am
        </span>
        (last modified
        <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
          February 5, 2015 at 9:20am
        </span>
        )
      </div>
      <div>
        by
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/janedoe123">
            <span itemprop="name">Jane Doe</span>
          </a>
        </span>
        and
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/johndoe123">
            <span itemprop="name">John Doe</span>
          </a>
        </span>
      </div>
    </div>
  </body>
</html>
1,
<html>
  <head>
    <title>Title of a News Article</title>
  </head>
  <body>
    <div itemscope itemtype="https://schema.org/NewsArticle">
      <div itemprop="headline">Title of News Article</div>
      <meta itemprop="image" content="https://example.com/photos/1x1/photo.jpg" />
      <meta itemprop="image" content="https://example.com/photos/4x3/photo.jpg" />
      <img itemprop="image" src="https://example.com/photos/16x9/photo.jpg" />
      <div>
        <span itemprop="datePublished" content="2015-02-05T08:00:00+08:00">
          February 5, 2015 at 8:00am
        </span>
        (last modified
        <span itemprop="dateModified" content="2015-02-05T09:20:00+08:00">
          February 5, 2015 at 9:20am
        </span>
        )
      </div>
      <div>
        by
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/janedoe123">
            <span itemprop="name">Jane Doe</span>
          </a>
        </span>
        and
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
          <a itemprop="url" href="https://example.com/profile/johndoe123">
            <span itemprop="name">John Doe</span>
          </a>
        </span>
      </div>
    </div>
  </body>
</html>
2.

Properti yang direkomendasikan
"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
2

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
3 atau
"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
4

Penulis artikel. Untuk membantu Google memahami penulis secara optimal di berbagai fitur, sebaiknya ikuti .

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
5

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
6

Nama penulis.

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
7

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
8

Link ke halaman web yang mengidentifikasi penulis artikel secara unik. Misalnya, halaman media sosial penulis, halaman tentang saya, atau halaman biodata.

Anda dapat menggunakan properti
"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
9 sebagai alternatif. Google dapat memahami
"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
9 dan
{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
1 saat membedakan penulis.
{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
2

{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
3

Tanggal dan waktu artikel terakhir kali diubah, dalam format ISO 8601.

Tambahkan properti

{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
2 jika Anda ingin memberikan informasi tanggal yang lebih akurat ke Google. Pengujian Hasil Kaya tidak menampilkan peringatan untuk properti ini, yang hanya direkomendasikan jika Anda memutuskan bahwa properti tersebut berlaku untuk situs Anda.

{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
5

{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
3

Tanggal dan waktu artikel pertama kali dipublikasikan, dalam format ISO 8601.

Tambahkan properti

{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
5 jika Anda ingin memberikan informasi tanggal yang lebih akurat ke Google. Pengujian Hasil Kaya tidak menampilkan peringatan untuk properti ini, yang hanya direkomendasikan jika Anda memutuskan bahwa properti tersebut berlaku untuk situs Anda.

{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
8

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
6

Judul artikel. Pertimbangkan untuk menggunakan judul yang ringkas, karena judul yang panjang mungkin akan terpotong di beberapa perangkat.

"author": [
  {"name": "Willow Lane"},
  {"name": "Regula Felix"}
]
0

"author": [
  {"name": "Willow Lane"},
  {"name": "Regula Felix"}
]
1 atau
"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
8 berulang

URL ke gambar yang mewakili artikel. Gunakan gambar yang relevan dengan artikel, bukan logo atau teks.

Pedoman gambar tambahan:

  • Setiap halaman harus memuat setidaknya satu gambar (baik Anda menyertakan markup ataupun tidak). Google akan memilih gambar terbaik untuk ditampilkan dalam hasil Penelusuran berdasarkan rasio lebar tinggi dan resolusi.
  • URL gambar harus dapat di-crawl dan diindeks. Untuk memeriksa apakah Google dapat mengakses URL Anda, gunakan Alat Inspeksi URL.
  • Gambar harus mewakili konten yang di-markup.
  • Gambar harus dalam format file yang .
  • Untuk mendapatkan hasil terbaik, berikan beberapa gambar beresolusi tinggi (minimal 50.000 piksel, yang merupakan hasil perkalian lebar dan tinggi) dengan rasio lebar tinggi berikut: 16x9, 4x3, dan 1x1.

Contoh:

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]

Contoh:

{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}

Praktik terbaik markup penulis

Untuk membantu Google memahami dan menampilkan penulis konten secara optimal, sebaiknya ikuti praktik terbaik ini saat mencantumkan penulis di markup:

Praktik terbaik untuk markup penulis

Menyertakan semua penulis di markup

Pastikan semua penulis yang ditampilkan sebagai penulis di halaman web juga disertakan dalam markup.

Mencantumkan beberapa penulis

Saat mencantumkan beberapa penulis, cantumkan setiap penulis di kolom

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
2 masing-masing:

"author": [
  {"name": "Willow Lane"},
  {"name": "Regula Felix"}
]

Jangan gabungkan beberapa penulis di kolom

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
2 yang sama:

"author": {
  "name": "Willow Lane, Regula Felix"
}

Menggunakan kolom tambahan

Untuk membantu Google lebih memahami siapa penulisnya, sebaiknya gunakan properti

"author": [
  {"name": "Willow Lane"},
  {"name": "Regula Felix"}
]
5 dan
{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
1 (atau
"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
9). Gunakan URL yang valid untuk properti
{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ]
}
1 atau
"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
9.

Misalnya, jika penulisnya adalah orang, Anda dapat menautkan ke halaman penulis yang menyediakan informasi selengkapnya tentang penulis:

"author": [
  {
    "@type": "Person",
    "name": "Willow Lane",
    "url": "https://www.example.com/staff/willow_lane"
  }
]

Jika penulisnya adalah sebuah organisasi, Anda dapat menautkan ke halaman beranda organisasi.

"author":
  [
    {
      "@type":"Organization",
      "name": "Some News Agency",
      "url": "https://www.example.com/"
  }
]

Hanya mencantumkan nama penulis di properti "image": [ "https://example.com/photos/1x1/photo.jpg", "https://example.com/photos/4x3/photo.jpg", "https://example.com/photos/16x9/photo.jpg" ]5

Di properti

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
5, hanya cantumkan nama penulis. Jangan tambahkan informasi lain apa pun. Khususnya, jangan tambahkan informasi berikut:

  • Nama penerbit. Sebagai gantinya, gunakan properti
    "author": {
      "name": "Willow Lane, Regula Felix"
    }
    2.
  • Jabatan penulis. Sebagai gantinya, gunakan properti yang sesuai jika Anda ingin mencantumkan informasi tersebut (
    "author": {
      "name": "Willow Lane, Regula Felix"
    }
    3).
  • Gelar kehormatan di awal dan di akhir. Sebagai gantinya, gunakan properti yang sesuai jika Anda ingin mencantumkan informasi tersebut (
    "author": {
      "name": "Willow Lane, Regula Felix"
    }
    4 atau
    "author": {
      "name": "Willow Lane, Regula Felix"
    }
    5).
  • Kata pengantar (misalnya, jangan sertakan kata seperti "diposting oleh").
"author":
  [
    {
      "name": "Echidna Jones",
      "honorificPrefix": "Dr",
      "jobTitle": "Editor in Chief"
    }
  ],
"publisher":
  [
    {
      "name": "Bugs Daily"
    }
  ]
}

Menggunakan "author": { "name": "Willow Lane, Regula Felix" }6 yang sesuai

Gunakan jenis

"author": {
  "name": "Willow Lane, Regula Felix"
}
7 untuk orang, dan jenis
"author": {
  "name": "Willow Lane, Regula Felix"
}
8 untuk organisasi. Jangan gunakan jenis
"author": {
  "name": "Willow Lane, Regula Felix"
}
9, dan jangan gunakan jenis yang salah (misalnya, menggunakan jenis
"author": {
  "name": "Willow Lane, Regula Felix"
}
8 untuk orang).

Berikut adalah contoh yang menerapkan praktik terbaik markup penulis:

"author":
  [
    {
      "@type": "Person",
      "name": "Willow Lane",
      "jobTitle": "Journalist",
      "url":"https://www.example.com/staff/willow-lane"
    },
    {
      "@type":"Person",
      "name": "Echidna Jones",
      "jobTitle": "Editor in Chief",
      "url":"https://www.example.com/staff/echidna-jones"
    }
  ],
"publisher":
  {
    "name": "The Daily Bug",
    "url": "https://www.example.com"
  },
  // + Other fields related to the article...
}

Pemecahan masalah

Jika Anda mengalami masalah saat menerapkan atau mendebug data terstruktur, berikut beberapa referensi yang dapat membantu Anda.