Writing & Editing

Beginning HTML

A basic understanding of HTML can help you get more out of your WordPress.com site. This article explains how.

Table of Contents

What is HTML?
Adding and Editing HTML
Some HTML Basics
Formatting Text
This block contains unexpected or invalid content.
Editing HTML in the Classic Editor

WordPress.com provides you with a few options for editing the HTML of your page or post. The options available to you depend on which Editor you are using. If you’re using the Classic Editor, you can click here to learn more.


What is HTML?

HTML, or Hyptertext Markup Language, is the main language used to create web pages. With HTML you can use special tags like <a> to add links and <img> to add images.

There are many types of HTML tags, but not all tags are supported here at WordPress.com.  You can read more about which tags are permitted in our Code support document


↑ Table of Contents ↑

Adding and Editing HTML

In the Editor

The easiest way to add HTML to a Page or Post is to use the Custom HTML block. You can learn more about the Custom HTML block here.

Alternatively, almost all of the blocks have the option to edit them as HTML.

  1. Click on a specific block in your editor.
  2. Click on the ellipses (three dots) at the top of the block.
  3. Select Edit as HTML.
  4. To switch back to the visual editor for the block, click the ellipses again, and click Edit visually.
Edit as HTML

A third option, for the particularly brave, is to view the entire page or post in the Code Editor. The Code Editor will load the entire page or post’s HTML.

  1. Edit a Page or Post.
  2. In the top right of the editor, click on the ellipses (three dots) menu.
  3. Select Code Editor.
  4. To switch back to the Visual Editor, click the ellipses again, and click the Visual Editor option.

In a Widget

You can add a Custom HTML Widget to any widget area your theme supports. Click here to learn more.

↑ Table of Contents ↑

Some HTML Basics

In the HTML editor, everything is text — a link is text, a quote is text, even an image is text. But there are two kinds of text here. Some of the text is the actual content of the post you wrote, and some is the HTML code.

It’s easy to tell the two apart: HTML code always starts and ends with angled brackets, < and >. Anything inside a pair of angled brackets is an HTML tag. Tags are predefined HTML commands that specify how your post will look and behave.

<h1&gt;This is a Heading</h1&gt;
<p&gt;This is a paragraph.</p&gt;
<a href="http://www.wordpress.com"&gt;This is linked text</a&gt;

For example, to italicize a word, we use the <em> tag, which is short for emphasis.

To open a new tag, type the tag you want to use just before the text you wish to change in some way: <em>. When you want to end that effect, you insert a closing tag, which is the same tag but with a slash: </em>.

↑ Table of Contents ↑

Formatting Text

It’s easy to use HTML to make text bold, italic, underlined, or struck through.  Here are examples of how to make these changes to your text:

To make text bold:

<strong&gt;bold text here</strong&gt;

For italics:

<em&gt;italic text here</em&gt;

For underline:

<u&gt;underlined text</u&gt;

For strikethrough:

<strike&gt;strikethrough</strike&gt;

↑ Table of Contents ↑

This block contains unexpected or invalid content.

Unexpected or Invalid Content

This can happen when the HTML code you’ve edited or added is not formatted correctly. Clicking Resolve will let our system attempt to resolve the issues with the code. If the system is unable to resolve the error, it will convert the block to HTML. Or, you can Convert to HTML yourself if you’d like to continue working on the block as a Custom HTML block.

Formatting trouble? Check out the HTML Troubleshooting guide for help.

Pages: 1 2 View All

Not quite what you're looking for?

Get Help