The HTML ping attribute
Quick answer
The HTML ping attribute lists URLs to be notified with a POST request when the link is followed (used for tracking). It is used on the <a> and <area> elements.
Overview
Values
| Value |
|---|
| A space-separated list of URLs. |
Best practices
- Write descriptive link text — avoid "click here", which is meaningless out of context.
- When using
target="_blank", modern browsers addrel="noopener"for you, but set it explicitly for older ones. - Use rel values like
nofollow,noreferrerandcanonicaldeliberately for SEO and privacy. - Make sure links are distinguishable by more than color alone.
Frequently asked questions
What does the ping attribute do?
Pings URLs when the link is clicked.
How do I open a link in a new tab?
Add
target="_blank". Pair it with rel="noopener" for security in older browsers.What does the rel attribute do on a link?
It states the relationship to the linked resource — for example
nofollow, noreferrer, stylesheet or canonical.