Blog Công Nghệ – Thủ Thuật

Tệp robot.txt là một dạng  tệp đơn giản được tạo ra bằng công cụ notepad nó cho phép Google có thể thu thập dữ liệu của một website. Vậy làm thế nào để tạo tệp robot.txt trên Blogspot? Hãy xem hướng dẫn tạo tệp robot.txt qua bài viết này nhé.

Đầu tiên các bạn cần phải mở chức năng Robots tùy chỉnh trên Blogspot. Để mở hãy truy cập vào trang quản trị và vào phần Cài đặt ⇒ Tùy chọn tìm kiếm và kéo xuống phía dưới có phần tùy chỉnh file robots hãy click vào và mở chức năng của nó lên.

Cấu trúc của một file robots.txt chuẩn:

User-agent: *
Allow: /
Disallow: /search

Trong đó:

  • User-agent: cho phép con bọ của các công cụ tìm kiếm có thể vào blogspot của mình. Nếu bạn cho phép tất cả thì nên để dấu *
  • Allow: / cho phép các công cụ tìm kiếm index toàn bộ nội dung của trang
  • Disallow: /search báo với bộ máy tìm kiếm là không nên tò mò về nội dung của trang này và không được index chúng.

Tệp robot.txt cho blog dưới 500 bài

User-agent: Mediapartners-Google
Disallow:
User-agent: *
Allow: /
Allow: /search/label/
Disallow: *max-results=*
Disallow: *archive.html
Disallow: *?m=0
Disallow: /search?*
Disallow: *?showComment=*
Disallow: *?spref=fb
Disallow: *?spref=tw
Disallow: *?spref=gp
Disallow: *?utm_source=*
Sitemap: ĐỊA CHỈ BLOG/feeds/posts/default?orderby=UPDATED
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=1&max-results=500

Với những blog trên 500 bài

User-agent: Mediapartners-Google
Disallow:
User-agent: *
Allow: /
Allow: /search/label/
Disallow: *max-results=*
Disallow: *archive.html
Disallow: *?m=0
Disallow: /search?*
Disallow: *?showComment=*
Disallow: *?spref=fb
Disallow: *?spref=tw
Disallow: *?spref=gp
Disallow: *?utm_source=*
Sitemap: ĐỊA CHỈ BLOG/feeds/posts/default?orderby=UPDATED
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=1&max-results=500
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=501&max-results=500
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=1001&max-results=500
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=1501&max-results=500

MÃ code

User-agent: Mediapartners-Google
Disallow:
User-agent: *
Allow: /
Allow: /search/label/
Disallow: *max-results=*
Disallow: *archive.html
Disallow: *?m=0
Disallow: /search?*
Disallow: *?showComment=*
Disallow: *?spref=fb
Disallow: *?spref=tw
Disallow: *?spref=gp
Disallow: *?utm_source=*
Sitemap: ĐỊA CHỈ BLOG/feeds/posts/default?orderby=UPDATED
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=1&max-results=500
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=501&max-results=500
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=1001&max-results=500
Sitemap: ĐỊA CHỈ BLOG/atom.xml?redirect=false&start-index=1501&max-results=500

Với những đoạn mã trên khi bạn tạo xong thì hãy chèn chúng vào trong hộp thoại Robots tùy chỉnh và lưu lại. Như vậy là đã hoàn thành một file robots.txt hoàn chỉnh cho Blogspot

Trong đó:MÃ code