# Always Underline Links in Post Content

> Makes links inside posts and pages underlined, so they can be recognised without relying on color alone, as WCAG requires for links in text.

- Type: CSS
- Runs: Site-wide header
- Category: [Accessibility](https://wpide.com/library/category/accessibility/)
- Tags: links, css, wcag
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/a11y-underline-content-links/

## Code

```css
.entry-content a:not(.wp-block-button__link):not(.wp-element-button),
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-element-button),
.comment-content a {
    text-decoration: underline !important;
    text-decoration-thickness: max(1px, 0.0625em);
    text-underline-offset: 0.15em;
}

.entry-content a:hover,
.wp-block-post-content a:hover,
.comment-content a:hover {
    text-decoration-thickness: max(2px, 0.125em);
}
```

## Notes

Buttons styled as links (wp-block-button) are left alone.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Always Underline Links in Post Content" in its snippet library and add it in one click; or create a new CSS snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
