Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> HTML

วิธีสร้างลิงก์ HTML ที่ไม่ติดตาม (Nofollow Link)

ใช้ attribute rel="nofollow" ในแท็ก <a> เพื่อบอก search engine ว่า "อย่าติดตามลิงก์นี้" หรือ "อย่าส่ง PageRank ผ่านลิงก์นี้"

รูปแบบ

<a href="https://example.com" rel="nofollow">Another Website</a>

เมื่อไหร่ควรใช้ nofollow

  • ลิงก์โฆษณา/สปอนเซอร์ (paid links)
  • User-generated content (comments, forum posts)
  • ลิงก์ที่ไมไว้วางใจ (untrusted content)
  • ลิงก์ login/register (ไม่มีประโยชน์ต่อ SEO)
  • Internal links ที่ไม่สำคัญ (privacy policy, terms)

ค่าอื่นของ rel attribute

ค่าความหมาย
dofollowติดตามลิงก์ปกติ (ค่าเริ่มต้น ไม่ต้องระบุ)
nofollowไม่ติดตาม ไม่ส่ง link juice
sponsoredลิงก์โฆษณา/สปอนเซอร์ (Google แนะนำ)
ugcUser Generated Content (comments, posts)
externalลิงก์ไปเว็บภายนอก
noopenerความปลอดภัยเมื่อใช้ target="_blank"
noreferrerไม่ส่ง referrer header

การรวมค่า

<a href="https://example.com" rel="nofollow noopener noreferrer" target="_blank">Link</a>

ผลกระทบต่อ SEO

  • Google อาจเลือกติดตามหรือไม่ติดตามได้ (hint ไม่ใช่ directive)
  • ไม่ส่ง anchor text signal ผ่าน nofollow links
  • ยังคงมีค่าสำหรับ traffic และ branding