Get the Best WordPress Backup
& Migration Plugin Today
Get Duplicator Now
Duplicator’s New One-Click Backup Cleanups, Auto-Deletion, and Version Updates

Duplicator’s New One-Click Backup Cleanups, Auto-Deletion, and Version Updates

Want cleaner, more organized, and more secure WordPress backups? Learn about Duplicator's new backup log management features and updated version…
WordPress HTML

WordPress is Drag & Drop, BUT… Here’s Why I Still Mess with HTML 

Written By: author avatar Joella Dunn
author avatar Joella Dunn
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.
     Reviewed By: reviewer avatar John Turner
reviewer avatar John Turner
John Turner is the President of Duplicator. He has over 20+ years of business and development experience and his plugins have been downloaded over 25 million times.

Ever wondered how websites actually work?

It might seem like magic, but there’s a language behind every webpage you see. That language is called HTML.

Think of HTML as the basic building blocks of the internet.

Even just a little bit of HTML knowledge can really level up your WordPress game. I’ve seen firsthand how it helps people make their WordPress websites even better.

In this post, I’ll explain what HTML is, why it matters, and how you can add custom HTML code to your WordPress site.

You might be surprised how easy and helpful it can be for effective web design!

Table of Contents

What Is HTML?

HTML stands for HyperText Markup Language. Basically, HTML is the language that structures web content. Think of it as the skeleton of a webpage.

HTML uses something called “tags”. Tags tell the web browser what each part of your content is.

For example, tags can tell the browser that something is a heading, a paragraph, or an image. Browsers read these tags to display web pages the way they should look.

HTML isn’t a programming language. It’s more like a way to organize information so browsers can understand it.

Why Should You Care About HTML in WordPress?

WordPress is super easy to use. You can build a whole website without knowing any code. So, why bother with HTML?

Well, HTML gives you more control over your content. Sometimes the regular WordPress editor just isn’t enough.

Say you want to add a specific attribute to an image. Or maybe you want to create a really unique list style. HTML lets you do things like that.

HTML is also a lifesaver for troubleshooting.

Ever had a weird formatting issue in WordPress? Looking at the HTML can help you quickly find and fix the problem. It’s way faster than guessing with the visual editor.

Plus, HTML gives you flexibility. Want to add some advanced customizations? Like custom classes for styling or more complex layouts? HTML unlocks those possibilities.

And here’s a big one: future-proofing.

WordPress is always changing. But HTML? It’s a fundamental web skill that will always be useful.

I’ve seen it time and time again – understanding HTML makes you way more adaptable in the web world.

HTML 101: The Basics

Let’s talk about the building blocks of HTML. They’re called tags.

Tags are instructions that tell the browser what to do with your content. Most tags come in pairs: an opening tag and a closing tag.

For example, if you want to create a paragraph, you use the <p> tag to start it and </p> to end it.

See the slash in the closing tag? That’s how you know it’s the end.

Let’s look at some common HTML tags you’ll use a lot:

Headings are for titles and subheadings. You’ve got <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.

<h1> is the most important heading (usually the main title), and <h6> is the least important.

Links are what make the web, well, a web! The <a> tag creates links. <a> stands for anchor.

Want to show pictures? The <img> tag is your friend. <img> is short for image.

Need to make a list of things? HTML has you covered. There are two main types:

  • <ul> for unordered lists (bullet points). “ul” stands for “unordered list”.
  • <ol> for ordered lists (numbered lists). “ol” stands for “ordered list”.

And inside both <ul> and <ol>, you use <li> tags for each item in the list. “li” stands for “list item”.

Tags can also have attributes. Attributes give extra information about a tag.

For example, the <a> tag needs an href attribute to tell it where to link to. Like this: <a href="https://example.com">Link text</a>. The href attribute holds the website address.

And the <img> tag needs a src attribute to tell it where to find the image file. It also should have an alt attribute for “alternative text,” which is important if the image can’t load or for accessibility.

Like this: <img src="image.jpg" alt="Descriptive text">.

Here’s a super simple example of HTML in action:

<h1>Welcome to My Blog</h1>

<p>This is my first paragraph of content. It's going to be awesome!</p>

<a href="https://duplicator.com">Check out Duplicator!</a>

That code would create a main heading, a paragraph, and a link on a webpage.

When I first started learning HTML, these basic tags were my starting point. And honestly? They’re still the foundation of almost everything I do online. These simple tags are powerful!

Putting HTML to Work: Practical Examples

So, how can you actually use HTML in WordPress? Let’s look at some examples.

Want to make some text bold or italic? HTML can do that.

Use <strong> and </strong> tags to make text bold. Or use <b> and </b> tags, they also make text bold.

Like this: <strong>This text is bold</strong>.

For italics, use <em> or <i>. Like this: <em>This text is italic</em>.

These tags help you emphasize words and phrases in your content.

We talked about the <a> tag. You can use it to link to other pages on your site, or to other websites.

You can link text, images, or even buttons. It’s all about using that <a> tag with the right href attribute.

Want to add a YouTube or Vimeo video to your WordPress site? Most video platforms give you embed codes. These codes are usually HTML, often using <iframe> tags.

Just copy the embed code from YouTube (or wherever your video is hosted) and paste it into WordPress. WordPress knows what to do with it.

Need a bulleted list? Use <ul> tags. For a numbered list, use <ol> and <li> tags.

Want to add a line to separate sections of your content? The <hr> tag creates a horizontal rule. It’s a simple way to visually break up your text.

These are just a few examples, but you can see how HTML can be really useful in WordPress. It’s all about adding a little structure and extra functionality to your website content.

How to Learn WordPress HTML

So, you’re thinking, “Okay, HTML sounds useful, but how do I learn it?” Good question! Luckily, there are tons of great resources out there.

Here are a few places you can start learning HTML right now.

MDN Web Docs is like the encyclopedia of web development. It’s made by Mozilla (the folks behind Firefox) and it’s super comprehensive and reliable.

If you like interactive learning, Codecademy is awesome. They have courses where you actually write code right in your browser.

W3schools is a popular website for web development tutorials. They have tons of HTML examples and references.

Want to see how HTML is used specifically in WordPress? Check out the official WordPress developer documentation. It’s a bit more technical, but it’s a great resource as you get more comfortable.

No matter which resource you choose, the most important thing is practice. Seriously. You won’t learn HTML just by reading about it. You have to write code and see what happens.

Experiment! Don’t be afraid to break things. That’s how you learn.

How to Use WordPress HTML

There are a bunch of ways to use HTML in WordPress. Let’s go through them one by one.

1. Add a Custom HTML Block in the Block Editor

If you’re using the Block Editor (Gutenberg) in WordPress, you can use a special block just for HTML. It’s called the Custom HTML block.

To use it, just add a new block to your WordPress page or post. Search for “HTML” in the block search bar. You’ll see the Custom HTML block pop up.

Custom HTML WordPress block

Click on it to add it to your content. It’s just like adding any other block. You can even drag and drop it wherever you want it to go.

Once you add the block, you’ll see a box where you can type or paste your WordPress HTML code. Just put your HTML right in there.

WordPress block HTML

Click on Preview to see how your HTML code looks on the page without actually publishing it.

Preview HTML block

This is really handy for checking your code.

2. Edit a Block in HTML

Did you know you can edit any WordPress block as HTML? Yep, even those regular paragraph blocks.

This is useful if you want to make small HTML adjustments to a block that’s already there.

First, click on the block you want to edit. Then, look for the three dots in the block’s toolbar. Click on that.

A menu will pop up. In that menu, hit the Edit as HTML button.

Edit WordPress block as HTML

Suddenly, the block will transform! Instead of the usual visual editor, you’ll see the custom HTML code for that block. Now you can directly edit the HTML.

This is great for little tweaks. Maybe you want to add a specific class to a paragraph for styling later. Or maybe you need to fix a tiny formatting issue that’s easier to handle in HTML.

Once you’re done editing HTML, you can click Edit visually in the block toolbar to go back to the regular visual editor view.

3. Use the Code Editor in Gutenberg

For those who are comfortable with code, the WordPress block editor has a full-on Code Editor view. This shows you the HTML code for your entire post or page.

To switch to the Code Editor, look at the top right of your Gutenberg editor screen. You’ll see three dots there too – the main options menu for the whole editor. Click on those dots.

In that menu, you’ll see an option called Code editor. Click on it.

Open WordPress block code editor

You’ll see the tags and the structure of your whole page laid out in code.

This WordPress HTML editor is really for advanced users who prefer to work directly in code. If you like coding and want to see the big-picture HTML structure of your page, the Code Editor is for you.

But be careful! If you make mistakes in the HTML, you could mess up the layout of your page. It’s important to understand HTML if you’re going to use the Code Editor extensively.

If you want to go back to the regular visual editor, just go back to that top right menu and click Visual editor.

4. Add HTML with the Classic Editor

The Classic WordPress Editor has two tabs: Visual and Text. The Text tab is where you can get into the code.

Classic editor HTML

When you click Text, you’ll see all the HTML code for your post. This is where you can write or paste HTML code directly.

After you’ve added or edited your HTML, you can click back to the Visual tab to see how it looks. It will show you the rendered version of your HTML.

5. Use a WordPress Code Snippets Plugin

Sometimes you want to add little bits of HTML, CSS, or JavaScript to your WordPress site. Maybe you want to add some custom tracking code, or a special style for a certain part of your site.

You could edit your theme files to do this, but it can be risky. And if your theme updates, your changes might get overwritten.

That’s where code snippets plugins come in. These plugins let you add code snippets right through your WordPress dashboard.

They keep your code organized and separate from your theme files. This is much safer and easier to manage, especially if you’re not a code expert.

Before you add any code snippets, it’s always a good idea to back up your website! If something goes wrong with your code, you want to be able to easily restore your site.

Duplicator is a plugin that makes it super easy to create full backups of your WordPress site. I always recommend backing up before making code changes.

My favorite code snippets plugin is WPCode (formerly “Insert Headers and Footers”). This tool lets you add HTML, CSS, and JavaScript to your website.

WPCode plugin

Plus, there are tons of pre-made snippets for you to use if you’re not used to coding.

WP Code snippets

Using a code snippets plugin is way safer than directly editing theme files. It’s also easier to keep track of your custom code.

6. Add HTML in WordPress Widgets

WordPress comes with a built-in widget called for custom HTML. To find it, go to your WordPress dashboard and click on Appearance and then Widgets.

You’ll see different widget areas, like Sidebar or Footer. These depend on your WordPress theme.

Add the custom HTML widget into the widget area where you want to add your HTML.

WordPress widget HTML

Type or paste your HTML right into that box.

You can add all sorts of things with HTML in widgets. Custom text, images, links, even embed codes – it all works!

After you’ve added your HTML, click the Update button in the widget settings.

That’s it! Your HTML will now be live in that widget area on your website.

7. Edit HTML in WordPress Themes

You can actually go right into your WordPress theme files and edit the HTML there. This gives you a lot of control over your site’s structure, but it also comes with big risks.

Editing theme files directly can break your website if you’re not careful. One little mistake in the code can cause major problems.

If you’re going to edit theme files, I’d recommend always using a child theme. A child theme is like a safe copy of your main theme where you can safely make changes. This way, if your main theme updates, your changes won’t be overwritten.

Okay, warnings aside, here’s how you can edit theme files. In your WordPress dashboard, go to Appearance and then Theme File Editor (sometimes just called Theme Editor).

On the right side, you’ll see a list of your theme files. These files control the structure and layout of your website.

Theme file HTML

Some common files that contain HTML are:

  • header.php: This file usually controls the very top of your website – the header area.
  • footer.php: This file controls the very bottom – the footer area.
  • sidebar.php: If your theme has a sidebar, this file controls it.
  • index.php: This is often the main page of your website, showing your blog posts.
  • single.php: This controls how individual blog posts are displayed.
  • page.php: This controls how regular pages (like “About Us” or “Contact”) are displayed.
  • Template files: Your theme might have other template files for different types of pages.

You can edit the HTML directly in the Theme File Editor. Just click on a file to open it, find the HTML you want to change, and make your edits. Then click Update File to save your changes.

Remember: Only edit theme files if you really know what you’re doing, and always use a child theme and have a backup.

In my experience, I only edit theme files for very specific customizations that can’t be done in other ways. And even then, I’m super cautious. Child themes and Duplicator backups are always part of my workflow when I’m touching theme files.

8. Use FTP to Edit WordPress HTML

FTP stands for File Transfer Protocol. It gives you the most direct access to edit your WordPress theme files (and other files too).

To use FTP, you’ll need a few things:

  • An FTP Client: This is software that lets you connect to your server. Popular FTP clients are FileZilla, Cyberduck, and Transmit.
  • FTP Credentials: You’ll get these from your web hosting provider. They usually include your FTP host, username, password, and port number.

If you can’t find your FTP credentials, check your hosting account settings or contact support.

Once you have these, open your FTP client and enter your FTP credentials to connect to your server.

FileZilla Quickconnect

After you connect, you’ll see a view with two sides. One side shows files on your computer, and the other side shows files on your web server.

Navigate to your WordPress theme files on the server side. The path is usually something like /wp-content/themes/your-theme-name/.

WordPress themes in FTP

Once you’re backed up and you’re in your theme folder via FTP, you can download the theme HTML files to your computer or directly edit them.

Just right-click on the file in your FTP client and choose Download or View/Edit.

Edit theme files in FTP

Now, edit the downloaded file on your computer using a code editor. Good code editors for this are VS Code, Sublime Text, Atom, or Notepad++.

Open the file in your code editor and make your HTML changes.

Once you’re done adding HTML, save the file. Right-click on the file in your FTP client and choose Upload. This will overwrite the original file on your server with your edited version.

FTP is a powerful tool, but it requires some technical know-how. And it’s important to be responsible when using it. Always double-check your changes before uploading, and always have a backup ready.

Frequently Asked Questions (FAQs)

How do I add HTML code in Elementor?

Add HTML code in Elementor by using the HTML widget. Drag the widget into your layout, then paste your HTML code into the content box. This method allows you to insert custom HTML anywhere on your page without editing the theme files.

How do I add HTML code in WordPress headers?

Add HTML code in WordPress headers by inserting it into the <head> section using a plugin like WPCode. Install the plugin and find the Header & Footer tab. Add HTML code into the header code box and save your changes. This avoids editing theme files directly.

What’s the best WordPress code editor plugin?

The best WordPress code editor plugin is WPCode (formerly Insert Headers and Footers). WPCode lets you safely add custom code to your site without editing theme files. It supports adding CSS, HTML, JavaScript, and PHP. Plus, it includes error protection and conditional logic for targeted code placement.

Is WordPress HTML or PHP?

WordPress is built primarily with PHP, which runs on the server to generate dynamic content. It also uses HTML, CSS, and JavaScript to render and style web pages in the browser. PHP handles the backend logic, while HTML structures the content displayed to users.

Where can I find WordPress HTML templates?

Find WordPress HTML templates on marketplaces like ThemeForest or TemplateMonster. These platforms offer professionally designed HTML templates that can be adapted for WordPress development. Download, customize, and convert them using a page builder or theme framework.

Final Thoughts

Learning even a little bit of HTML can really open up a new world of possibilities with WordPress. It gives you more control, more flexibility, and a deeper understanding of how websites actually work.

Don’t be afraid to keep learning and experimenting. The more you play with code, the more comfortable you’ll become.

Explore those resources I mentioned, try out the different ways to add HTML in WordPress, and just see what you can create!

And remember, always back up your site before making big changes! Tools like Duplicator make backups a breeze, and they can save you a lot of headaches down the road.

While you’re here, I think you’ll like these other WordPress guides:

author avatar
Joella Dunn Content Writer
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.