Sửa lỗi thiếu entry-title,update,author trong webmaster tool
Nhiều bạn dùng template WordPress hay Blogger do họ chưa tối ưu các thẻ nên khi kiểm tra
Rich Snippet của Google thường bị báo các lỗi như sau :

Thiếu: author
Thiếu: entry-title
Thiếu: updated

Đối với WordPress chúng ta sửa như sau:

Đầu tiên bạn vào phần quản trị trang ( domain.com/wp-admin/) và đến phần Giao diện ( Appearence) => Editor => Single.php
1/ Sửa lỗi : Missing required field “entry-title”
Các theme thông thường sẽ có đoạn code sau :
<h1><?php the_title(); ?></h1>
Hãy thay nó với code bên dưới đây
<h1 class=”title single-title entry-title”><?php the_title(); ?></h1>
2/ Sửa lỗi : Fix Missing required field “updated”
Tìm đoạn code sau :
<span><?php the_time(‘j F,Y’); ?></span>
Thêm vào thuộc tính “date updated” , khi đó code có dạng như sau :
<span class=”post_date date updated”><?php the_time(‘j F,Y’); ?></span>
3/ Sửa lỗi : Missing required hCard “author” và Missing required field “name (fn)”
Bước này sẽ sửa cả 2 lỗi. Tìm đoạn :
<span class=”theauthor”><?php the_author_posts_link(); ?></span>
hoặc
<span class=”theauthor”><?php the_author(); ?></span>
Sửa lại thành
<span class=”vcard author”>
<span class=”fn”><?php the_author_posts_link(); ?></span>
</span>

hoặc
<span class=”vcard author”>
<span class=”fn”><?php the_author(); ?></span>
</span>

Đối với Blospot(blogger) sửa lỗi entry-title, author và update

1- Đăng nhập vào trang blog của bạn.
2- Bấm chọn tab mẫu (Templale)
3- Chọn chỉnh sửa HTML (Edit HTML)
4- Tìm đoạn code có dạng tương tự như bên dưới:

<span class='post-author vcard' >
<b:if cond='data:top.showAuthor'>
<b:if cond='data:post.authorProfileUrl'>
<span class='fn'>
<a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
<data:post.author/>
</a>
</span>
<b:else/>
<span class='fn'><data:post.author/></span>
</b:if>
</b:if>
</span>

Đoạn mã XML trên có thể khác nhau tùy theo mẫu của blogger. Tuy nhiên nó có dạng tương tự như bên trên. Về cơ bản đoạn code màu tìm giống nhau:
- Thay thế đoạn mã vừa tìm được thành đoạn code sau:
<span class='post-author vcard' itemscope='itemscope' itemtype='http://schema.org/Person'>
<b:if cond='data:top.showAuthor'>
<b:if cond='data:post.authorProfileUrl'>
<span class='fn author'>
<a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
<span itemprop='name'><data:post.author/></span>
</a> </span>
<b:else/> <span class='fn author'><span itemprop='name'><data:post.author/></span></span>
</b:if>
</b:if>
</span>

5- Tìm đoạn code thời gian như bên dưới:
<data:post.timestamp/>
- Với đoạn code này công cụ tìm kiếm không xác định được thẻ Update của thời gian nên sẽ báo lỗi thiếu Update. Bạn có thể sửa nó thành đoạn code bên dưới để thêm thẻ update nha:
<span class='updated'><data:post.timestamp/></span>
6- Tìm đoạn code như bên dưới:
<b:if cond='data:post.title'>
<h3 class='post-title'>

- Để thêm thẻ khai báo phần tiêu đề bài viết bạn phải thêm thuộc tính entry-title. Bằng cách thay thế đoạn code vừa tìm được thành đoạn code như bên dưới:
<b:if cond='data:post.title'>
<h3 class='post-title entry-title'>

7- Tiếp tục tìm đoạn mã có dạng như bên dưới:
<div class='blog-posts hfeed'>
- Thay nó bằng đoạn code sau:
<div class='blog-posts'>
8- Tìm đoạn mã:
<div class='post hentry'>
- Và thay nó bằng đoạn code sau:
<div class='post'>
9- style="font-family: "Courier New",Courier,monospace;"><div class='post hentry uncustomized-post-template>
và thay nó bằng đoạn code sau:
<div class='post uncustomized-post-template
- Giờ lưu mẫu lại chờ vài ngày để google cập nhật bạn sẽ thất số lượng lớn các lỗi đã biến mất.
Sau khi thực hiện xong các bạn có thể kiểm tra tại link sau
http://www.google.com/webmasters/tools/richsnippets

No comments