Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Setup & site building · Guide

How to Underline in WordPress (Step by Step)

How to Underline in WordPress (Step by Step)

Short answer

To underline text in WordPress, highlight the words in the block editor and press Ctrl+U on Windows or Cmd+U on a Mac. For a whole block, use the Decoration option in the Typography panel. You can also wrap text in a u tag in HTML mode or style it with CSS.

Key takeaways

  • WordPress has no underline button, but Ctrl+U or Cmd+U still works.
  • The Typography panel's Decoration option underlines a whole block when the theme supports it.
  • Use the u tag or a span with text-decoration for inline HTML underlines.
  • A CSS class is best for a consistent underline style across the site.
  • Avoid underlining non-link text, because readers expect underlines to be clickable.

Why is there no underline button in WordPress?

WordPress removed the underline button from its editor toolbars because underlined text is easily confused with links, but the feature still works through a keyboard shortcut and other methods.

The classic editor dropped the button in WordPress 4.7, and the block editor never added one to its main toolbar. The reasoning is about usability: on the web, readers expect underlined text to be clickable.

So underline is hidden, not gone. You can still apply it with a shortcut, with the Typography panel on many blocks, with a little HTML, or with CSS.

Before you underline, ask whether bold or italics would do the job. Our guide on how to do italics in WordPress covers another way to add emphasis without looking like a link.

How do you underline text with a keyboard shortcut?

Select the text in the block editor and press Ctrl+U on Windows or Cmd+U on a Mac; press the same keys again to remove the underline.

  1. Open the post or page in the block editor
  2. Click inside a Paragraph, Heading or List block
  3. Highlight the words you want to underline
  4. Press Ctrl+U (Windows) or Cmd+U (Mac)
  5. Update or publish the post

WordPress wraps the selected words in a u tag. The shortcut works in most text blocks, including paragraphs, headings, list items and quotes.

The same shortcut works in the classic editor's Visual tab. WordPress keeps a list of block editor keyboard shortcuts if you want other formatting keys.

If nothing happens, your browser or a browser extension may be using the shortcut. Try a different browser, or use one of the methods below.

How do you underline in the classic editor?

In the classic editor, highlight the text in the Visual tab and press Ctrl+U or Cmd+U, or switch to the Text tab and wrap the words in a u tag.

The classic editor is still used on many older sites and by people who installed the Classic Editor plugin. Its toolbar shows bold, italic and link buttons, but no underline button since WordPress 4.7.

Some toolbar plugins add the button back. They extend the classic editor with extra formatting options, including underline, justify and font size. Only install one if you underline often, since the shortcut does the same job.

If you want to move between the two editors, our guide on how to go back to the classic editor explains your options and their trade-offs.

How do you underline a whole block with the Typography settings?

Select the block, open the block settings sidebar, find the Typography panel, add the Decoration option from its menu, and choose the underline style.

Paragraph and Heading blocks support a text decoration setting in many themes. It applies to the whole block rather than a few words.

  1. Click the Paragraph or Heading block
  2. Open the Settings sidebar with the gear icon
  3. Find the Typography panel
  4. Click the three-dot menu on the panel and enable Decoration
  5. Choose the underline icon

If you do not see Decoration, your theme has not enabled it. Block themes control which typography tools appear through their theme.json file, as explained in the theme.json reference.

This method is handy for a heading that needs a visual line under it. For more on theme settings, see our guide on how to use theme.json.

How do you underline text with HTML?

Switch the block to Edit as HTML and wrap the words in a u tag, or use a span with an inline text-decoration style.

  1. Click the block's three-dot menu
  2. Choose Edit as HTML
  3. Wrap your words like this: <u>your words</u>
  4. Switch back with Edit visually

You can also use a span with style text-decoration: underline. It gives you the same look and lets you add extras such as color or thickness.

<u>This text is underlined</u>
<span style="text-decoration: underline;">This is underlined too</span>

MDN explains that the u element marks text with a non-textual annotation, such as a spelling error. For purely visual underlines, CSS is the cleaner choice.

In the classic editor, switch to the Text tab and type the same tags. Our guide on how to add HTML in WordPress covers other ways to insert raw markup.

How do you underline text with CSS?

Add a CSS class to the block under Advanced, then style that class with text-decoration: underline in Additional CSS or your theme's styles.

This is the best route when you want the same underline in many places, because you can change the style once and it updates everywhere.

  1. Select the block and open the Settings sidebar
  2. Expand Advanced and add a class, such as underline-text
  3. Add the CSS rule to your site
  4. Preview the page
.underline-text {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

The text-decoration property also supports wavy, dotted and double lines, and you can set a separate color.

In classic themes, add CSS under Appearance > Customize > Additional CSS. In block themes, use the Additional CSS option in the Site Editor's Styles panel. If your rules do not seem to apply, our guide on fixing CSS changes not showing explains caching and specificity problems.

How do you underline text in Elementor?

In Elementor, select the Heading or Text Editor widget, open the Style tab, click Typography, and set Decoration to Underline.

The Text Editor widget also has a classic toolbar. Highlight the words and press Ctrl+U or Cmd+U to underline only part of the text.

You can set an underline for a whole site in Site Settings under Typography, but use that sparingly. A site where body text is underlined is hard to read.

Which underline method should you use?

Use the keyboard shortcut for a few words, the Typography setting for a full block, and CSS when you need a consistent style across the site.

MethodScopeSkill neededWorks in
Ctrl+U or Cmd+USelected wordsNoneBlock and classic editors
Typography > DecorationWhole blockNoneThemes that enable it
u tag or spanSelected wordsBasic HTMLAny editor
CSS classAny element, site-wideBasic CSSAny theme
Elementor TypographyWidgetNoneElementor pages

How do you remove an underline in WordPress?

Highlight the underlined text and press Ctrl+U or Cmd+U again, or remove the u tag in HTML mode; for links, change the underline with CSS.

If an underline will not go away, it may come from your theme rather than the editor. Themes often underline links by default, and some underline headings or menu items too.

To remove the underline from links, add a CSS rule that targets them, such as setting text-decoration to none on links inside your content area. Keep some other visual cue, like color or bold, so readers can still spot links.

When should you avoid underlining text?

Avoid underlining text that is not a link, because readers expect underlined words on a web page to be clickable.

Accessibility guidance points the same way. The W3C's guidance on use of color explains why links need a cue other than color, and underlines are the most common one. Using them for plain emphasis muddies that signal.

For emphasis, bold and italics are safer. For headings, a border or a short decorative line made with CSS gives a similar look without the link confusion.

If you do want a link that looks distinct, our guide on how to add a hyperlink in WordPress covers link options in the block editor.

Why is underline not working in WordPress?

Underline usually fails because a browser shortcut overrides Ctrl+U, the theme does not expose Decoration, or theme CSS removes text-decoration from u tags.

  • Ctrl+U opens page source: some browsers use that shortcut. Make sure your cursor is inside the editor first.
  • No Decoration option: your theme has not enabled it. Use HTML or CSS instead.
  • Underline shows in the editor but not on the site: your theme's stylesheet may reset text-decoration. Add a more specific CSS rule.
  • Underline vanishes after saving: a plugin that cleans HTML may strip the tag. Use a span with a class instead.

If the editor itself misbehaves, try switching off plugins one at a time. Our guide on fixing a plugin conflict shows a safe way to test.

Frequently asked questions

Why did WordPress remove the underline button?

WordPress removed it from the classic editor toolbar in version 4.7 because underlined text looks like a link on the web, which confuses readers. The block editor never added it to the main toolbar, but the keyboard shortcut still works.

What is the shortcut to underline in WordPress?

Press Ctrl+U on Windows or Cmd+U on a Mac after selecting the text. Press the same shortcut again to remove the underline. It works in both the block editor and the classic editor's Visual tab.

How do I underline a heading in WordPress?

Select the Heading block, open the Typography panel in the sidebar, enable Decoration from the panel menu, and choose underline. If your theme hides that option, add a CSS class to the heading and style it with text-decoration.

Can I change the color or thickness of an underline?

Yes, with CSS. The text-decoration-color, text-decoration-thickness and text-underline-offset properties let you change the color, weight and gap of the line. Add them to a custom class and apply it to the block.

Is underlining text bad for SEO?

Underlining has no direct effect on search rankings. The concern is usability: readers may click underlined text expecting a link. Use bold or italics for emphasis and save underlines for links where possible.

Sources

  1. Keyboard Shortcuts (Block Editor) WordPress.org Documentation
  2. theme.json reference WordPress Developer Resources
  3. The Unarticulated Annotation (Underline) element MDN Web Docs
  4. text-decoration MDN Web Docs

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.