![]() |
| Hướng dẫn tối ưu thẻ H1, H2 cho Blogspot |
Đối với các bài viết, thì thẻ H2 này chính là tiêu đề của các widget trên sidebar, footer…Trong bài viết này tôi sẽ hướng dẫn các bạn cách làm thế nào để tối ưu các thẻ H1, H2 cho Blogspot? với các bước thực hiện như sau. Do việc tối ưu can thiệp vào trong code của template blogspot vì vậy việc cần làm đầu tiên là bạn nên backup toàn bộ Template của Blog trước khi tiến hành chỉnh sửa nhé.
Bước 1: Tiến hành sao lưu template trước khi tiến hành chỉnh sửa code
![]() |
| Sao lưu template trước khi tiến hành chỉnh sửa code |
Bước 3: Tìm đoạn code sau <div class='post hentry'> và thay thế toàn bộ nó bằng đoạn code bên dưới.
<div class='post hentry' itemprop='blogPost' itemscope='itemscope'itemtype='https://schema.org/BlogPosting'>Tiếp tục tìm đoạn code này hoặc đoạn code nào đó tương tự như thế:
<meta expr:content='data:post.firstImageUrl' itemprop='image_url'/>
<b:if cond='data:post.title'>Nếu là các template mới thì code có thể dạng như thế này:
<h3 class='post-title entry-title'>
<b:if cond='data:post.link'>
<a expr:href='data:post.link'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</h3>
</b:if>
<b:if cond='data:post.title'>
<h3 class='post-title entry-title' itemprop='name'>
<b:if cond='data:post.link or (data:post.url and data:blog.url != data:post.url)'>
<a expr:href='data:post.link ? data:post.link : data:post.url'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</h3>
</b:if>
Tiến hành thay thế toàn bộ đoạn code tìm được đó bằng đoạn code đã tối ưu này:
<b:if cond='data:post.title'>Bước 4: Lưu template lại để hoàn thành việc chình sửa tối ưu.
<b:if cond='data:blog.pageType == "index"'>
<h2 class='post-title entry-title' itemprop='name'>
<b:if cond='data:post.link'>
<a expr:href='data:post.link' itemprop='url'><data:post.title/></a>
<b:else/>
<b:if cond='data:post.url'>
<a expr:href='data:post.url' itemprop='url'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</b:if>
</h2>
<b:elseif cond='data:blog.pageType == "archive"'/>
<h2 class='post-title entry-title' itemprop='name'>
<b:if cond='data:post.link'>
<a expr:href='data:post.link' itemprop='url'><data:post.title/></a>
<b:else/>
<b:if cond='data:post.url'>
<a expr:href='data:post.url' itemprop='url'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</b:if>
</h2>
<b:else/>
<h1 class='post-title entry-title' itemprop='name'>
<b:if cond='data:post.link'>
<data:post.title/>
<b:else/>
<b:if cond='data:post.url'>
<data:post.title/>
<b:else/>
<data:post.title/>
</b:if>
</b:if>
</h1>
</b:if></b:if>
Kết luận: Qua bài viết trên tôi đã hướng dẫn cho các bạn cách để tối ưu các thẻ H1, H2 trong blogspot giúp cho blogspot của bạn chuẩn SEO Onpage giúp cho việc SEO nhanh lên top.


Không có nhận xét nào:
Đăng nhận xét