본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)75k · #2899

invalid-links

하는 일

이 스킬은 페이지 링크가 크롤러가 따라갈 수 없는 빈 목적지, JavaScript 전용 목적지, URL이 아닌 목적지를 갖는지 확인합니다. 내비게이션과 동적 링크를 만드는 개발자를 위한 것입니다.

사용하는 경우

  • ✓링크처럼 보이는 버튼이 목적지로 javascript:void를 쓸 때.
  • ✓동적 메뉴 항목에 실제 URL이 없을 때.
  • ✓감사 결과에서 빈 목적지나 해시만 있는 링크가 보고될 때.

스킬 링크

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/invalid-links/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/invalid-links/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“검색엔진이 따라갈 수 없는 링크가 있는지 제 페이지를 확인해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 모든 링크 요소를 읽고 빈 href, 해시만 있는 href, JavaScript 기반 href, 누락된 href를 표시합니다. 실제 URL로 바꾸고, JavaScript는 내비게이션을 강화하는 용도로만 쓰도록 제안합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Fix invalid links

Google can only follow links declared as valid <a href> elements with crawlable URL values. Invalid links — empty hrefs, JavaScript voids, or non-URL content — prevent PageRank from flowing to linked pages and stop Googlebot from discovering those destinations.

Quick Reference

  • Invalid <a> tags (empty href, JavaScript voids, non-URL values) are not crawlable — Googlebot cannot follow them
  • Links must use crawlable <a href='...'> elements with valid absolute or relative URLs to pass PageRank and be followed
  • JavaScript-only navigation (onClick handlers without href) is invisible to search engine crawlers

Check

Parse all <a> elements on the page. Flag links where href: (1) is empty (href='' or href='#' with no meaningful target). (2) starts with javascript: (e.g., href='javascript:void(0)'). (3) starts with mailto: or tel: — these are valid but not crawlable for page discovery. (4) contains only a fragment identifier that references an anchor not present on the page. (5) is absent entirely (<a> without any href attribute). Report the count per type.

Fix

  1. For links using href='javascript:void(0)' or href='#' as navigation triggers:
    • Add a real URL as the href value
    • Use JavaScript to enhance the navigation, not replace it
    • Before: <a href="javascript:void(0)" onclick="openModal()">View Details</a>
    • After: <a href="/products/details" onclick="openModal(event)">View Details</a>
  2. For <a> elements without href (used as button-like elements):
    • If they trigger navigation: add href
    • If they trigger actions only: change to <button> elements
  3. For empty href='': either add the correct URL or remove the <a> wrapper
  4. For href='#' anchors: use meaningful fragment IDs that reference actual page sections (href='#features' where id='features' exists)

Explain

Google's documentation states that crawlable links must be <a> tags with an href attribute containing a valid URL. Links with javascript: hrefs, empty hrefs, or no href attribute are not followed by crawlers. This means pages only reachable through invalid links are not discovered by Googlebot, and any intended PageRank flow is blocked.

Code Review

Query all <a> elements in the rendered DOM. For each, extract the href attribute. Flag: absent href, empty string, '#' only, values starting with javascript:, values starting with void. Separately flag <div>, <span>, or <button> elements with onclick navigation handlers that lack a corresponding <a href> — these are not crawlable.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/seo/invalid-links

자주 묻는 질문

잘못된 href가 SEO에 왜 중요한가요?

스킬은 크롤러가 잘못된 링크를 따라갈 수 없어서, 목적지 페이지를 아예 찾지 못할 수 있다고 설명합니다.

JavaScript 전용 내비게이션도 작동하나요?

스킬은 href 없이 onclick으로만 된 이동은 검색엔진 크롤러에게 보이지 않는다고 설명합니다.

mailto와 tel 링크도 문제인가요?

스킬은 이들은 유효한 링크이지만 페이지 탐색에는 도움이 되지 않는다고 설명합니다.

상세 정보

작성자의 원본 설명

Use when auditing a page's link elements for crawlability, reviewing JavaScript-heavy SPAs where navigation may not use `<a href>` tags, or checking that dynamically generated links have valid href values.

repo: thedaviddias/Front-End-Checklist

인기도

GitHub 스타
75k
순위
#2899
라이선스
MIT
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬