The world wide web, your web site, your pages and even your web content are all built and powered by a language of code.
It is inevitable, then, that sooner or later, you will probably need something done for your business online, for your web site, or in your content that will require having coding skills.
HTML is one of the code languages that is used throughout the web, web sites, blog pages and also web content.
One of the best things about using a WordPress-powered website or blog is that you don’t need to know HTML in order to create and format content for your posts. WordPress has unique features like “themes”, “plugins” and “widgets” that let you manage your website without having to touch code, and a powerful, built-in visual editor that lets you create and easily format content simply by clicking on a few menu buttons.
As you will discover below, having some practical HTML knowledge can be a useful thing when writing, editing or formatting content in your WordPress-driven website. Having a basic knowledge of HTML can also save you time and money.
You don’t need to learn HTML in order to use WordPress, but having a little bit of HTML knowledge can be really useful as a WordPress user!
A Beginner’s Guide To Using HTML Code In WordPress – Tutorial
As mentioned above, it’s useful to have some knowledge of HTML when creating, changing or formatting content on your WordPress site.
Let’s say that:
- You would like to make changes to your existing content, add a text link and an image into an area of your sidebar, or direct your visitors to a contact form, newsletter subscription page, etc. If you know basic HTML, you can do this very quickly without help from others.
- You outsource content work to a freelancer and get back files containing formatted text. Knowing a little HTML will help you better proof, understand and assess the quality of the content before you accept and pay for the work.
- Someone creates content for your website. You spot a couple of simple text formatting errors, like a word that should have been made bold, or a hyperlink that has not been added to your copy. Having some basic knowledge of HTML can help you fix simple mistakes in your pages very quickly without needing to go and ask (or pay) a webmaster, a web designer, or someone else to do it for you.
- You need to discuss a project or requirement with your website developer. Having some basic knowledge of HTML not only will help you communicate more effectively with web developers and web designers, it can also help you better negotiate projects with technical service providers.
You don’t need to become a code-loving web programmer – just be familiar enough with basic HTML to be a “web-smart” business owner!
HTML – A Basic Definition
HTML is an acronym for HyperText Markup Language. According to Wikipedia’s definition of HTML …
HTML is the main markup language for creating web pages and other information that can be displayed in a web browser.
HTML is written in the form of HTML elements consisting of tags enclosed in angle brackets (like
<table>), within the web page content. HTML tags most commonly come in pairs like
</h1>, although some tags, known as empty elements, are unpaired, for example
<img>. The first tag in a pair is the start tag, the second tag is the end tag (they are also called opening tags and closing tags). In between these tags web designers can add text, tags, comments and other types of text-based content.
The purpose of a web browser is to read HTML documents and compose them into visible or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page.
Source: Wikipedia, HTML
Important: Like all things online, HTML is also subject to frequent change, and sometimes these changes will have an impact on WordPress.
Currently, HTML is in version 5 (also called HTML5), and this change has introduced a number of new tags to remain up-to-date with new advances in software and browser technology. As several tags used in older and even recent versions of WordPress get dropped from HTML5, you should expect that WordPress will also continue updating its core application in order to stay compatible with industry-wide standards.
Using HTML Code In WordPress
Built-In WordPress Text Content Editor
I cover the WordPress WYSIWYG Editor and how to add content to posts and pages in other articles.
What HTML Is OK To Use In WordPress Content?
The WordPress Text editor allows you to insert various widely-used HTML formatting tags, such as the ones shown in the table below:
HTML Formatting Tags Allowed In WordPress
Below are a few practical content formatting examples using some of the HTML tags displayed in the illustration above …
HTML Code Used In WordPress Content
To learn more about using HTML, go here:
The WordPress HTML (Text) Content Editor Explained
Out of the box, the Text Content Editor displays a standard set of menu buttons …
WordPress HTML (Text) Editor Menu
Below is a brief description of the function of each of the Text Editor menu buttons with their corresponding HTML formatting tag (refer to the screenshot above):
<strong></strong>Use this HTML tag for strong text emphasis (i.e. bold).
- i :
<em></em>Use this HTML tag to add italics to your text.
<a href="http://example.com"></a>Use this HTML tag to add a hyperlink to your selected text.
- b-quote –
<blockquote></blockquote>Use this HTML tag for quoted or cited text.
<del></del>This HTML tag is used to label text considered deleted from a post or page. Most web browsers will typically display this as striked-through text.
<ins></ins>Use this HTML tag to mark text that has been inserted into the current content. Most browsers typically display this as underlined text.
src="http://www.yourdomain.com/img/image.jpg" alt="image description" />This HTML tag lets you insert an image into your post or page and add an “alt” description (a text description of your image in case the image is not rendered in your visitor’s screen. Note: you can also use the Add Media button (15) to insert an image into your content.
<ul></ul>Use this HTML tag to insert an unordered list into your post. Unordered lists typically appear as a list of items preceded by bullets. Note: this HTML tag needs to be used with the
<li>tag (see below) in order for bullet lists to work.
<ol></ol>Use this HTML tag to insert a numbered list. Items in an ordered list are usually numbered (just like the list you are reading now!). Note: this formatting tag needs to be used with the
<li>tag (see below) in order for bullet lists to work.
<li></li>This HTML tag is used to insert or turn your selected text into a list item. (This tag should be used in conjunction with the ul or ol tag).
<code></code>Use this HTML tag to display code (like html formatting tags) in your text. If you don’t use these tags to surround the code you want to display, WordPress will convert your tags and you will get errors (e.g. broken text). Note: content inserted within the
<code>tags generally will appear using a preformatted styling of text, such as a monospaced font like Courier. (See the “Tips” section below for more details).
<!--more-->Use this button to break your post into “teaser” and main content sections. For example, if you type a few paragraphs, then add the “more” tag and add the remaining section of your post, visitors will only be able to read the first couple of paragraphs of your post and a hyperlink (e.g. continue reading…), which brings up the rest of your post if clicked on.
- Close Tags button – Closes any open HTML tags left in your content. Note: proof your content after using this function to make sure that all HTML tags have formatted your text correctly.
- Distraction-Free Writing Mode – click this button to work in “distraction-free” writing mode (see screenshot example below). You can toggle between the Visual Editor and Text Editor modes, insert media and hyperlinks and update your content while in “distraction-free” mode. Click the button again to revert to the normal text editor mode.
- Add Media button – Click this button to insert media into your content (e.g. images, videos, audio files). This button appears whether you’re in the Visual or Text editor tabs.
Distraction-Free Writing Mode [#14]
Some Useful Tips Related To Using HTML In WordPress
HTML Content Editors
If you plan to go beyond the basics of HTML and use it more extensively, there are several Free HTML software applications you can download and use when getting started.
For example, a popular HTML software application you can download at no cost is KompoZer.
Kompozer – HTML Editor
KompoZer is Free Open Source software built as a complete web authoring system that combines web file management and easy-to-use WYSIWYG web page editing. It’s designed to be extremely easy to use, especially for non-technical computer users who just want to create attractive, professional-looking web pages without needing to know HTML or web coding. You can build HTML-based content in this application, then use plugins that let you insert code into your pages or posts.
Another option, if you don’t want to mess with code or use an external HTML content editor, is to use a WordPress plugin that lets you build content inside WordPress itself.
If you have no need or desire for doing any kind of work that involves technical coding, but would still like to be able to easily create, insert and format content containing HTML into areas of your WordPress site other than your posts or pages (e.g. your sidebar, author biography, etc.), then see the useful tutorial below for a very simple solution that involves spending no extra time downloading software.
Quick Tutorial: Adding Formatted Text To The “About Yourself” Section Of Your User Profile
In your WordPress site, there are some places like widgets in your sidebar, or the About Yourself text area in your User Profile screen that allow you to insert HTML.
These areas, however, don’t provide a content editor like the WYSIWYG editor found in your Posts and Pages sections …
WordPress Visual Editor
You can still use the WordPress WYSIWYG editor to compose your HTML-formatted text, and then paste it into these other areas.
Let’s show you an example, so you can see how simple this can be.
Typically, whenever you publish a post in WordPress, a link to the post author is displayed somewhere in your posts (i.e. at the bottom or top of the post) …
Link To Author Page In WordPress Post
Clicking on the author link takes you to the Author Archives section, where they can learn more about you (or other registered users) and view other posts that you (or other authors) have published …
Note: As the above screenshot illustrates, you can add hyperlinks and simple formatting like bold and italicized text to enhance your author bio box and promote yourself, your services, social media pages, other online properties that you own, etc. to blog readers …
The author profile is located in the About Yourself > Biographical Info field inside your Profile section …
Although the Biographical Info text box allows you to add HTML-formatted content, it doesn’t have a content editor, so you have to either know how to type HTML code directly into the text box, or create it elsewhere, then copy and paste it in …
Let’s “paste the content” into this field using the method described below.
First, create a new post and type your content in the Visual Editor.
In this case, we want to create an author bio …
Next, format your content using the Visual Editor . Please note that you will only be able to use simple formatting in your author description such as hyperlinks, bold, underline and italicized text, so keep it simple – use bold, italics and text links sparingly across one or two paragraphs to explain who you are and what you do, and include a call to action for your readers …
Keep working in the Visual Editor tab until you have written your author bio …
When you are happy with your author bio, switch over to the Text Editor and copy everything to your clipboard …
next, go to your profile area by selecting Users > Your Profile from your dashboard menu …
Scroll down the screen to the About Yourself section and paste the content from your clipboard into the Biographical Info text area ….
Remember to click Update Profile to save your changes …
Congratulations … You have just created an author description for your blog posts and formatted it using basic HTML!
To learn more about editing your profile settings, refer to this tutorial: How To Edit Your WordPress User Profile
As we’ve mentioned a number of times, you don’t have to learn HTML to use WordPress, but it can be useful to have a little basic knowledge of HTML.
Tip #1 – If you want to add more complex design elements to your content (e.g. highlighted segments, 3-column paragraphs, etc.) without learning HTML, you can use cut & paste HTML snippets …
Save time using cut & paste HTML tools
Tip #2 (Advanced WP User): You can enhance the function of your WordPress Text Editor using different WordPress plugins.
WordPress HTML lets you add custom HTML to both the page and post body and head sections.
WordPress HTML. (Screenshot source: plugin website)
Pasting HTML directly into your WordPress editor can often break various elements and corrupt the HTML. By pasting the HTML code in the custom fields dialogue boxes, you can output the exact HTML to your page or post.
Extensible HTML Editor Buttons is a plugin you can add to your website that allows you to have better control of settings for HTML tags like div and span, as well as adding custom buttons and additional functions to the text editor …
WordPress Plugin – Extensible HTML Editor Buttons. (Screenshot source: plugin website)
Here is another free WordPress plugin you can use …
Raw HTML lets you disable automatic formatting like automatic paragraph creation and smart quotes, and use raw HTML/JS/CSS code in your WordPress posts.
Raw HTML – Plugin For WordPress. (Screenshot source: plugin website)
Tip #3 – Troubleshooting HTML Tag Errors: If your text formatting displays incorrectly after publishing your page or post, make sure that you have entered your HTML tags correctly in the Text Tab, not in the Visual Tab.
For example, if you type the following text in the Visual Editor …
Your text will look like this when your post is published …
You can see the problem by switching over to the Text Tab …
As you can see in the screenshot above, WordPress converts the symbols “<” and “>” into their HTML code equivalents (called ASCII characters).
- “<” (open angled bracket) = “<“
- “>” (closed angled bracket) = “>“
To preserve the symbols “<” and “>” intact and ensure that your text will format correctly, you need to paste the code into the Text Tab …
Now … when you publish your post, you should find that your text formatting is correct …
Tip #4 (Advanced WordPress User): By default, WordPress doesn’t allow some HTML tags to be used (e.g. codes such as embed, object and others). This is for security reasons.
If you do experience any problems when adding common HTML tags into your content that are allowed to be used in WordPress, try disabling the visual editor in your user profile section …
After disabling the visual editor and saving your new profile settings, go back to your page or post and re-paste the content with the problematic HTML tags, then republish your post.
If the above suggestion fixes the issue, go back to the Profile area, reactivate your Visual Editor, and see if the HTML code is still working fine with the visual editor restored.
Note: If the above suggestion does not fix the issue and you still continue to experience problems adding HTML code to your content, you may need to look at other options. This may include:
- Getting help from an experienced WordPress support service provider
- Searching the WordPress Support Forum or WordPress troubleshooting resources for possible causes and solutions
- Reinstalling your WordPress application (i.e. you may need to perform a clean installation)
- Contacting your web host for help
Congratulations! Now you know how to use basic HTML to format and style your content.