How to Underline Text in WordPress (Block Editor)

To underline text in WordPress, select the text and press Ctrl + U (Windows) or Cmd + U (Mac). The block editor has no underline button, but the shortcut still works in paragraphs, headings and list items. To underline a whole block instead, open the block settings and use Typography > Decoration > Underline.

I tested every method below on WordPress 7.1 with the Twenty Twenty-Five theme, including what markup each one actually saves. That matters more than you would think, because the shortcut does not produce a <u> tag.

WordPress block editor toolbar showing bold and italic but no underline button

Quick reference: every way to underline in WordPress

MethodWhereScopeSaved markup
Ctrl/Cmd + UBlock editor or classic editor, with text selectedSelected words<span style="text-decoration: underline;">
Typography > DecorationBlock settings sidebarThe whole blockstyle="text-decoration:underline" on the block
<u> tagEdit as HTMLSelected words<u>
Inline styleEdit as HTMLSelected words, with color/style/offset<span style="...">
Styles > Typography > LinksSite Editor (block themes)Every link on the siteGlobal styles CSS
theme.json elements.linkTheme or child theme filesEvery link on the siteGlobal styles CSS
Tested on WordPress 7.1 with Twenty Twenty-Five.

Method 1: Keyboard shortcut (fastest)

Select the text you want to underline, then press the shortcut for your system:

  • Windows and Linux: Ctrl + U
  • Mac: Cmd + U

Press it again with the same text selected to remove the underline. In my test it worked the same in paragraph, heading and list blocks, and in the classic editor.

Text underlined in the WordPress block editor using the Ctrl+U keyboard shortcut

Here is what WordPress saves when you use the shortcut:

Hello underline <span style="text-decoration: underline;">world</span>

That comes straight from Gutenberg’s source: the underline format is registered as a span with an inline text-decoration style, and it only has a keyboard shortcut attached. Bold, italic and strikethrough also register toolbar buttons. Underline does not.

Why Ctrl + U sometimes opens the page source

In Chrome on Windows and Linux, Ctrl + U is also the browser shortcut for viewing the page source. The editor only intercepts it while your cursor is inside a text block. If focus is somewhere else, the browser gets the keypress and a source tab opens. Click back into the text, select it again, and retry.

Underline isn’t in the More menu

The down-arrow “More” menu on the block toolbar is where most people look next. In WordPress 7.1 it lists Footnote, Highlight, Inline code, Inline image, Keyboard input, Language, Math, Strikethrough, Subscript and Superscript. No underline. Strikethrough is there, and it has its own shortcut: Shift + Alt + D on Windows or Ctrl + Option + D on Mac.

Underline a whole block with Typography > Decoration

If you want an entire paragraph, heading or button underlined, skip the shortcut and use the block’s built-in Decoration control. It’s hidden by default, which is why few people find it.

  1. Select the block.
  2. Open the Settings sidebar (the panel icon at the top right) and stay on the Block tab.
  3. In the Typography panel, click the three-dot Typography options button.
  4. Choose Show Decoration.
  5. Pick Underline from the three buttons that appear (None, Underline, Strikethrough).

The block now saves the setting as a block attribute plus an inline style:

<!-- wp:paragraph {"style":{"typography":{"textDecoration":"underline"}}} -->
<p style="text-decoration:underline">Hello underline world</p>
<!-- /wp:paragraph -->

One quirk from testing: clicking None does not clear the setting. It saves text-decoration:none on the block. To remove it completely, use Reset all in the same Typography options menu.

In WordPress 7.1 the Decoration control is available on most text blocks, including Paragraph, Heading, List, Quote, Button, Pullquote, Table and Verse, plus theme blocks like Post Title and Site Title.

Method 2: Wrap the text in a <u> tag

If you prefer markup, or the shortcut is fighting your browser, you can type the HTML yourself.

  1. Click the block you want to edit so the toolbar appears.
  2. Click the three-dot Options menu on the block toolbar and choose Edit as HTML.
  3. Wrap your text in <u>...</u> tags.
  4. Open the same menu and choose Edit visually to switch back.
Edit as HTML option in the WordPress block editor three-dot menu
Here is my <u>underlined</u> text.

I checked that the tag survives: after switching back to visual mode and typing more text in the block, WordPress 7.1 kept the <u> tag untouched.

One catch on semantics. In HTML5, <u> no longer means “underline.” MDN describes it as an unarticulated annotation, such as marking a spelling error, and recommends CSS text-decoration when you only want the visual underline. Browsers still draw it as a solid underline, so readers will not notice, but if you care about clean markup, the shortcut or Method 3 is the more correct choice.

Method 3: Use an inline style (more control)

To control the underline color, style or offset (a wavy red underline, a dotted one), use a <span> with an inline style. Same “Edit as HTML” steps as Method 2.

Adding an inline span style to underline text in the WordPress block editor
Here is my <span style="text-decoration: underline;">underlined</span> text.

Swap in any of the modern text-decoration values for more control:

<span style="text-decoration: underline wavy red;">heads up</span>
<span style="text-decoration: underline dotted; text-underline-offset: 4px;">note</span>

If you’ll style underlines the same way across many posts, define a CSS class once and reuse it instead of repeating inline styles. I cover where that CSS should live in my guide on adding custom CSS to WordPress.

<u> vs <ins> vs CSS: which one to use

All three render as underlined text by default, but they mean different things:

OptionWhat it meansUse it for
<u>Text with a non-textual annotationSpelling-error marks, proper name marks
<ins>Text added to a documentShowing edits next to <del>, changelogs
text-decoration: underlinePure visual style, no meaningDecorative or design underlines (what the shortcut and Decoration control use)
Element meanings per MDN.

WordPress keeps <ins> too. In my test it survived visual editing the same way <u> did. See MDN on the ins element if you use it for revisions.

A lot of “WordPress underline” searches are really about links. Link underlines come from your theme, not the editor, so you change them site-wide.

In the Site Editor (block themes): go to Appearance > Editor > Styles > Typography > Links. The Links panel has the same None / Underline / Strikethrough Decoration buttons, and the change applies to every link.

In theme.json: set it under styles.elements.link. Twenty Twenty-Five already does half of this: its theme.json sets textDecoration: none on link hover. This version keeps links underlined and drops the underline on hover:

{
  "version": 3,
  "styles": {
    "elements": {
      "link": {
        "typography": { "textDecoration": "underline" },
        ":hover": {
          "typography": { "textDecoration": "none" }
        }
      }
    }
  }
}

Don’t edit a parent theme’s theme.json directly, since an update will overwrite it. Put the change in a child theme or use the Styles panel, which saves to the database.

Before removing underlines from links in body text, keep accessibility in mind. If color is the only thing that separates a link from normal text, readers with low vision or color blindness can miss it. Underlined links in paragraphs are the safest default.

Underlining in the classic editor

The classic (TinyMCE) editor lost its underline button too. WordPress 4.7 removed it in 2016, along with the justify button. I installed the Classic Editor plugin on WordPress 7.1 to check: neither toolbar row has an underline button, even with the Toolbar Toggle expanded.

The shortcut still works there. Cmd + U (or Ctrl + U) underlined the selected text and saved the same <span style="text-decoration: underline;"> markup as the block editor. The Classic block inside the block editor uses the same TinyMCE setup.

Why doesn’t WordPress have an underline button?

It was removed on purpose. When the button came out of the classic editor in 4.7, the core team explained that underlining is a bad practice because readers confuse it with links. The block editor kept that decision: underline exists as a format (that is why the shortcut works), but it was never given a toolbar button.

Cases where underline is still the right call:

  • Reproducing a quoted source or document that used underline
  • Marking annotations or proofing notes, which is what <u> is meant for
  • Clearly decorative accents, like a colored, offset or wavy underline on a heading

Cases where you should use something else:

  • General emphasis in a paragraph (use bold or italic)
  • Drawing attention to a call to action (a button works better)
  • Anywhere a reader could mistake it for a link and try to click it

Frequently asked questions

What is the keyboard shortcut for underline in WordPress?

Ctrl + U on Windows and Linux, Cmd + U on Mac. Select the text first, then press the shortcut. It works in the block editor (paragraphs, headings, list items) and in the classic editor. Press it again to remove the underline.

Why is Ctrl + U not working in WordPress?

Usually the cursor is not inside a text block, so the browser handles the keypress instead. In Chrome on Windows that opens the page source. Click into the block, select the text, and press it again. If it still fails, use Edit as HTML and wrap the text in a u tag, or apply Typography > Decoration > Underline to the whole block.

How do I underline a heading in WordPress?

To underline part of a heading, select the words and press Ctrl + U or Cmd + U. To underline the whole heading, select the Heading block, open Typography options in the sidebar, turn on Show Decoration, and choose Underline.

How do I remove the underline from links in WordPress?

On a block theme, go to Appearance > Editor > Styles > Typography > Links and set Decoration to None. On any theme you can also set textDecoration to none under styles.elements.link in a child theme’s theme.json, or use custom CSS. Keep some other visual cue for links in body text so readers can still spot them.

Can I underline text in the classic editor?

Yes, with Ctrl + U or Cmd + U. The classic editor has had no underline button since WordPress 4.7, and expanding the toolbar does not bring it back, but the keyboard shortcut still works.

Is underlining text bad for SEO?

No, it has no direct effect on rankings. The problem is usability: readers expect underlined text to be a link, and clicking something that does nothing is frustrating. Use it sparingly and make decorative underlines look clearly different from your links.

Bottom line

For a few words, Ctrl/Cmd + U is all you need. For a whole block, use Typography > Decoration. Reach for a <u> tag or an inline style when you want the markup or a custom underline style, and handle link underlines in Styles or theme.json. Just avoid underline for general emphasis, since bold and italic do that job without looking like broken links.

Picture of Andy Feliciotti

Andy Feliciotti

Andy has been a full time WordPress developer for over 15 years. Through his years of experience has built 100s of sites and learned plenty of tricks along the way. Found this article helpful? Buy Me A Coffee

Leave a Reply

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

WordPress Tips Monthly
Get the latest from SmartWP to your inbox.