Pular para o conteúdo
Skillpedia
Sites e telas (frontend)75 mil · #2899

invalid-links

O que ela faz

Esta skill verifica os links de uma página em busca de destinos vazios, somente em JavaScript ou que não são URLs, e que os rastreadores não conseguem seguir. É para desenvolvedores que criam navegação e links dinâmicos.

Quando usar

  • ✓Quando um botão com aparência de link usa javascript:void como destino.
  • ✓Quando itens de menu dinâmicos não têm uma URL real.
  • ✓Quando uma auditoria aponta links com destinos vazios ou apenas com âncora.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/invalid-links/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Você pode verificar se minha página tem links que os buscadores não conseguem seguir?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente lê cada elemento de link e sinaliza hrefs vazios, apenas com hash, baseados em JavaScript ou ausentes. Ele sugere substituí-los por URLs reais e usar JavaScript apenas para aprimorar a navegação.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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

Perguntas frequentes

Por que um href quebrado importa para o SEO?

A skill diz que os rastreadores não conseguem seguir links inválidos, então as páginas de destino podem nunca ser descobertas.

A navegação somente em JavaScript funciona?

A skill diz que a navegação com onclick sem href é invisível para os rastreadores dos buscadores.

Links mailto e tel são um problema?

A skill diz que são válidos, embora não ajudem na descoberta de páginas.

Detalhes

Descrição original do autor

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

Popularidade

Estrelas no GitHub
75 mil
Posição no ranking
#2899
Licença
MIT
Atualizada em
31/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas