3 Ways to Underline Hyperlinks in WordPress

Last updated on June 26th, 2022 at 11:41 am

Depending on your WordPress theme you can use one of the following CSS methods to underline hyperlinks in posts in WordPress.

  • Add the following CSS code in your child theme or though WP Dashboard > Appearance > Customize > Additional CSS. Alternatively, you can use a plugin such as Simple CSS and paste the code there.
.entry-content a {
text-decoration: underline;
}
  • On the other hand, you can use the following custom CSS code to underline the links on your site. Note that all of the links will be underlined including the hyperlinks in the menus and sidebars on the site.
a, .entry-meta a, entry-content a {
color: red;
text-decoration: underline;
}
  • This CSS code also contains color: red; which changes the color of the hyperlink. Feel free to remove that line if you don’t want to set a specific color for your links.

Underline Links in Posts Only

If the previous codes underline all of the hyperlinks on your site, the following CSS code will underline the links in your posts only.

3 Ways to Underline Hyperlinks in WordPress

This solution is ideal if you want to underline the hyperlinks in your text including posts and pages.

.post a {
text-decoration: underline!important;
}

 

Feel free to drop us a line if you need any further assistance with implementing these codes on your site.

Cheers!

Author: wpbackend

Content creator at wpbackend.com

Leave a Reply

Your email address will not be published. Required fields are marked *