InMotion Hosting Support Center

There may be times when you want to use HTML in your WordPress website. For example you may prefer to code a hyperlink by hand, or adjust the header sizes. In this tutorial we will show you how to view/add HTML code to a Page or Post in WordPress.

As per WordPress' official Code support page, Javascript, and other embeds such as Flash are not allowed to be added to a Page or Post in WordPress.

Here is a list of the specific HTML tags that WordPress allows: address, a, abbr, acronym, area, article, aside, b, big, blockquote, br, caption, cite, class, code, col, del, details, dd, div, dl, dt, em, figure, figcaption, footer, font, h1, h2, h3, h4, h5, h6, header, hgroup, hr, i, img, ins, kbd, li, map, ol, p, pre, q, s, section, small, span, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var

How to Add HTML to a Page/Post:

  1. Login to the Dashboard for WordPress.
  2. In the navigation menu click the Pages or Posts link, depending which one you want to add HTML to. In my tests I clicked Posts.
  3. Now, click the page or post that you want to edit.

  4. Click the Text tab.

    You will then see the text of the page or post and you can enter the HTML. In my Tests I am adding a Link to an email address:

  5. Click the Update button to save your changes.
    Here is view of the HTML link I added to a Post:


Congratulations, now you know how to add HTML to a WordPress Page or Post!

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2017-11-15 3:13 pm

I am trying to embed this code: <script id="ch_cdn_embed" type="text/javascript" data-page-id="32522" data-cfasync="false" src="https://www.canadahelps.org/services/wa/js/apps/donatenow/embed.min.js"></script>

 

on a Wordpress website but the embeded form does not show up? What am I doing wrong?

Staff
40,163 Points
2017-11-15 3:25 pm
Depends on where you're trying to embed that code. Check this article on 3 ways to embed Javascript in WordPress. The <script> tag is used to define a client-side script (Javascript). Check out the presented solutions and see if it helps get your script working.
n/a Points
2017-11-10 3:44 pm

I am so frustrated!  I've been trying to add this widget to my website for the past week and it won't show up.  When I'm in edit mode it shows the widget on the page but when I go to preview the change before I save it, it doesn't show up. Even when I save the change, it sitll doesn't show up:

<iframe src="https://designfiles.co/widgets/2098" width="300" height="454" style="border:none;"></iframe>

Am I missing something?  Do I need to do something else? Even when I follow your instructions, it's still not showing up?

Crossing my fingers!  Thank you!

Staff
1,598 Points
2017-11-10 4:55 pm
This guide is for creating an HTML link, which may not work for what you are attempting to do. Try following the steps below to create a Custom HTML Widget in the WordPress Customizer:


  1. Log into your WordPress Dashboard

  2. From the Dashboard, hover over Appearance and then click on the Customize option from the left-side menu.

  3. Select Widgets

  4. You will be presented with the areas that your theme is configured to display Widgets. Click on the name of the area you would like to display your iframe.

  5. Click the Add a Widget button.

  6. Select Custom HTML from the list of available Widgets.

  7. Name the Widget by typing it into the Title: field.

  8. In the Content field, enter the full code you have.

  9. Click the Save & Publish button to save your changes.



Following those steps, I was able to add the Widget and the code displays properly on a test site I have setup. I hope this helps!

Sincerely,
Carlos E
n/a Points
2017-11-04 4:23 am

How to add meta title and meta description for each pages in wordpress using HTML?

Staff
13,791 Points
2017-11-06 7:24 am
You can use WordPress SEO Plugin by BoldGrid. It will do exactly what you are looking for and is easy to use.
n/a Points
2017-11-01 5:10 pm

Hello, I'm trying to put this bage from other site but not displaing

<link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Playfair+Display" /><link type="text/css" rel="stylesheet" href="https://www.hitched.co.uk/css/hitchedbadge.css" />        <div class="badge">            <div class="badgeInner">                <a href="https://www.hitched.co.uk/wedding-photographers/east-sussex/love-tabloid_37931.htm" target="_blank" class="company-name">Love Tabloid</a>                <div class="featuredOn"><a href="https://www.hitched.co.uk" target="_blank">As featured on</a></div>                <a href="https://www.hitched.co.uk" target="_blank"><img src="https://images.hitched.co.uk/featuredbadge/hitched-logo-white.png" alt="hitched.co.uk" title="hitched.co.uk" border="0"> </a>            </div>        </div>    Regards

Staff
1,598 Points
2017-11-01 7:53 pm
I made a test page and copy/pasted the code you entered and it seems to be loading fine. Are you still experiencing issues with it?
n/a Points
2017-10-11 12:20 am

I have tried several times to get Recipage to work on my blog. I have followed your directions to the letter and it didn't work.  I wanted to add html code to a page and I had also wanted to add html code to the side column. I have over 1000 recipes listed on Recipage so I really need this to work. Lynn

Staff
40,163 Points
2017-10-11 5:56 am
Hello Lynn,

Recipageis a plugin for WordPress. Plugins do not require that you have to add HTML to the page as you should be installing it through the WordPress plugin section. If you're having trouble with using it then you will need to contact the plugin author. I checked for their support options, but it is currently only available through email. Go to their webpage and the click on the contact link in order to send them a message for assistance

If you have any further questions, please let us know.

Kindest regards,
Arnel C.
n/a Points
2017-10-04 1:16 pm

Hi there - you seem to have great ideas for people to get their wordpress sites up to speed.  I added the media, and then to the correct text spot like this:

file:///C:/Users/Kevin/Downloads/The%20Acoustic%20Celebration.html

The webpage now shows just that text.  How do I get the page to automatically display the content?

thanks!

PS I also tried XYZ HTML, which displays the snippet but not the content...

Staff
40,163 Points
2017-10-04 5:04 pm
First, it needs to be a valid URL. It should not be a local file listing on your computer (as indicated by the C:/ path). Also, it's not always wise to automatically display whatever is uploaded to your site - this can be a major security issue, especially for your users. Content being uploaded should be monitored, reviewed an then approved for display. If a viewer/user (from your website) is providing a URL for media content, then it would need to be uploaded to the server and then typically displayed in the comments section for the post or page.

If your user is a contributor to the website, then you will need to change the role for that user in the WordPress Administrator in order to allow them to approve and post to your WordPress site.

Media that is added to your site should be uploaded through the Media Library in the Dashboard.

I hope this helps to clear up the confusion. If you continue to have problems, please explain the steps you're taking (in detail) in order to troubleshoot the issue in more depth.

n/a Points
2017-09-28 1:27 pm

You rock!  This was so simple, amazing, and helpful!!!

n/a Points
2017-07-23 3:19 pm

I am trying to paste a code from google Adsense into the HTML of my wordpress blog, i have no idea how to do this, do i need to paste the code into a specific blog post, or into somewhere else in the site? also i dont understand when it says to paste it between the <head> and </head> tags if you could help me that would be great. 

Staff
13,791 Points
2017-07-24 8:38 am
Websites have a header which is located between the tags. I'd suggest using a plugin designed for Adsense, that way the code is placed in the correct place. https://wordpress.org/plugins/tags/adsense-plugin/
n/a Points
2017-07-13 2:07 pm

I've coded my own site.  I'm new to wordpress, and am wondering how I can apply my html and css files to my wordpress account.  I want to be able to use functions of wordpress i.e adding pages/project easily while keeping my design.  

Staff
30,194 Points
2017-07-13 2:53 pm
I recommend looking through the WordPress codex, since it is the official documentation for WordPress and has many explanations and examples of the available functions.

Thank you,
John-Paul
n/a Points
2017-05-27 7:25 am

How to add meta tags for each page in wordpress using HTML?

Staff
9,867 Points
2017-05-30 10:39 am
What kind of meta tags are you trying to use? You can add tags to every post under the publish box in the post section. Are you trying to use custom meta fields?
n/a Points
2017-05-22 7:54 pm
When I add a calendar from another site, all it does is create a link. How can I get the calendar to show on my WordPress site? I tried an iframe, but that didn't work.
Staff
9,867 Points
2017-05-23 8:25 am
Make sure that the link used in the iframe is properly formatted. Often, a direct link to a page contains only the link content and is not meant to display any information. Or, the calendar may be password-protected, like a Google calendar, in which case the calendar will need to be made public with a shareable link. Often, a specific "embed" link will be most helpful.
n/a Points
2017-05-03 11:50 am

how do I view the HTML code of my home page? 

Staff
40,163 Points
2017-05-03 2:21 pm
Hello,

It depends on the type of website you have created. If you created it from scratch, then you should be able to view it in a text editor. In fact, you should be able to view most code from websites in an editor - it just depends on the location of the code and the type of code. In some cases, like WordPress there is a built in editor. If you're not familiar with it, then you may need to speak with a developer or your hosting support. If you want us to look at it and you are an InMotion customer, please provide more information about your account.

If you have any further questions, please let us know.

Kindest regards,
Arnel C.
n/a Points
2017-03-04 4:19 pm

I am trying to add an html to have a disclosure notice added to each post automatically.  I am able to add it however, every thing that I type on the post turns into a hyperlink to the disclosure policy.  What am I doing wrong??

 

This is what I am posting in the Plugin-Content-HTML before content:

<font size="1"> This post may contain affiliate links, view our <a href="http://savvydealsplus.com/about-us-online-savings/disclosure-policy/">disclosure policy for details.</font>

Staff
43,761 Points
2017-03-06 4:32 pm
You need to have a closing tag for your anchor element </a> before the closing font tag.
n/a Points
2017-02-17 1:59 pm

I'm trying to embed HTML from my email program (Mail Chimp) to my wordpress site for a pop up subscription page.  The code doesn't seem to be correct, how do I check it?  This is what I have to paste...

<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us15.list-manage.com","uuid":"b38afb5dd9717a241a2b0b652","lid":"133a490b35"}) })</script>

 

Staff
2,858 Points
2017-02-17 2:38 pm
Erin, where did you get this code from? Have you tried using it on a test page / post? Do you get any errors when you use it on a page / post?
n/a Points
2017-02-01 2:00 pm

<!DOCTYPE html>

<html>

<body>

<div>

<form action="https://api.elasticemail.com/contact/add?version=2" method="post">

<input name="source" type="hidden" value="WebForm" />

<input name="notifyEmail" type="hidden" value="" />

<div class="inputs"><span id="email">

<label for="email">Email

</label>

<input class="form-control" maxlength="40" name="email" required="" size="20" type="email" />

</span></div>

<ul class="lists" style="list-style: none; display: none;">

<li><input id="iHGhkRdQ" checked="checked" name="publiclistid" type="checkbox" value="db1100f4-9c4f-4f6f-a3a7-a0dd91fc77fe" />

<label class="publiclistlabel" for="iHGhkRdQ">trial

</label></li>

</ul>

<input name="submit" type="submit" value="Subscribe" /></fieldset>

</form> 

</div>

<body/>

<html/>

I am trying to add this code but the input box and the button ps not showing .can you please help?

Staff
40,163 Points
2017-02-02 6:17 am
Hello Hai,

Where are you trying to add that code? If it's a form, it probably should be on a page or post and linked instead of editing one of the internal structures of the WordPress them such as the home page.

If you have any further questions, please let us know.

Kindest regards,
Arnel C.
n/a Points
2017-01-31 6:25 am

this little tutorial is very meaningful..thank you

n/a Points
2017-01-25 11:48 am

Just followed your steps and they were very easy! Helped out a lot especially because I'm still new to blogging. thanks! 

n/a Points
2017-01-16 4:53 pm

I am attempting to add a code to a page on my site.  I have a coupon site.  After code is on page and saved I go to my coupon database, find a coupon from coupons.com and select it to go to that site.  Instead of a page offering their coupons coming up a page says "the page you asked for couldn't be found".  If however at this point I go on the page showing this to the right under a list of pages, i will find the page saved as coupons.com..if I click it, the coupons load and it is all there.  

I need to get the page I do find in the end under pages to come up when a coupon for coupons.com is selected from my database.  Hope I have explained this so you have a clue what i am attempting.  Thankyou

n/a Points
2017-01-09 5:08 pm

I have been doing as you instruct for days now and can not get my Wordpress blog to accept it.  Now, reading your post I see why.  I am trying to monetize my wordpress blog using Amazon and they use Javascript which you say Wordpress does not accept.  Is there a way around this or do I need to move my blog to some other platform so I can enter the html?  Here is a bit of what I have been trying to paste;

<script type="text/javascript">

amzn_assoc_placement = "adunit0";

amzn_assoc_search_bar = "true";

amzn_assoc_tracking_id = "herbnkathy-20";

amzn_assoc_search_bar_position = "bottom";

I have been pasting the entire html code that Amazon produces for me not only directly into the text of a post, but also tried putting it in an html text widget with no success - all I see is the html, no image or link

Thank you for any help you can give this novice

Staff
9,867 Points
2017-01-10 11:41 am
You would need to add this code to one of the core files manually. For example, the index.php file. If you are not comfortable editing source files you may want to consult a developer.
n/a Points
2016-12-26 10:53 pm

the secret to getting the p or br tags to add spacing between paragraphs, i've found is to add styling to the p tag... otherwise it collapses. so try p style="margin:10px 0;" if you want space between paragraphs. 

n/a Points
2016-12-02 6:34 pm

Hey ,thanks a lot. I'm new in this stuff and I'm so confused but I finally find this page where is so good explained. Thank you , I wanted to give up but now I'm going to research more. 

Staff
2,858 Points
2016-12-02 8:59 pm
Dalia, that's so awesome! Cool folks like you encourage and inspire us to be better every day!
n/a Points
2016-11-30 6:46 pm

I can't seem to add any HTML to the Text/HTML widget, as the code only shows up as text.  The explanation on the widget says that it can take HTML, but it doesn't do anything.

 

The following is the code I am trying to add:

<script src="//z-na.amazon-********.com/widgets/onejs?MarketPlace=US&adInstanceId=ceff46da-1956-4c1b-9be8-cf30ce5ea020&storeId=bgar07-20"></script>

But it just shows up as the following instead of showing the ads:

//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=ceff46da-1956-4c1b-9be8-cf30ce5ea020&storeId=bgar07-20

Staff
30,194 Points
2016-12-01 9:47 am
The link within quotation marks does not look like a correct path. For example, you do not typically see two slashes "//" together like that.

I recommend double checking your amazon add settings to ensure the correct link path.

Thank you,
John-Paul
n/a Points
2016-11-30 4:46 am

I needed to add a code from Google but can't seem to find the file that contains the HTML tags. I tried going through the index file in public html folder but didnt work. HTML/HEAD tags weren't there as well. Would you know where to find them?

Staff
40,163 Points
2016-11-30 10:03 am
Hello Maye,

If you're trying to modify your WordPress installation to add the code, then you would typically be looking for the header.php. You can easily find it by using the EDITOR option in the Appearance menu of your WordPress Administrator.

I hope this helps to answer your question, please let us know if you require any further assistance.

Regards,
Arnel C.
n/a Points
2016-11-23 11:41 am

Hi Arnel C,

Thank you for the fast reply.  I've tried both ways so it must have to do with the theme, which is GoodLayers Real Soccer.  I may have to ping them on this issue.  Have a Happy Thanksgiving!

 

Doug

 

n/a Points
2016-11-23 10:07 am

Regardless of what I try the page only shows the actual code.  I've tried wrapping it in <pre> and <code> but when I view the page it's just html code.

Staff
40,163 Points
2016-11-23 10:49 am
Hello Doug M,

Where are you adding the code in the editor? If you're doing it on the VISUAL tab, then the code will remain as text and not be parsed by WordPress. If you're adding it in the TEXT tab of the editor, then the code will be parsed as HTML code. Please double-check this and let us know if you require further assistance.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2016-11-15 9:27 am

This is not working for me i don't know why.

Staff
13,791 Points
2016-11-15 1:20 pm
WE need more information than what you have provided. Are you getting a specific error message? Do you have an example we can see?
n/a Points
2016-11-10 2:11 pm

Hey, I want to add a paypal Nay Now button to my woocommerce checkout page.

Any idea how I could do that? Paypal gave me an HTML code to past it ''were I want it,'' but I don't know how I could add it to the checkout page, since it's all authomatic and it only says [woocommerce_checkout]

What can I do?

Staff
30,194 Points
2016-11-10 3:33 pm
PayPal Express Checkout is available as an addon to WooCommerce. This is the easiest method for adding PayPal to Woocommerce.

Thank you,
John-Paul
n/a Points
2016-10-10 7:25 pm

Hi I followed your steps and it isn't working. I'm trying to post a google ad sense code and it doesn't appear correctly. Can you help?

Staff
9,867 Points
2016-10-11 10:25 am
It may have something to do with the hype of code you are posting and how it appears within the content area of the post. You may want to post your code in the actual file for theme or consider installing a plugin that allows you to paste ad codes into widget areas.
n/a Points
2016-09-30 10:58 am

Thanks. What would be sweet if you had a book of different codes like a cheat sheet that a person could refer to when they have something they want to add. 

 

Staff
13,791 Points
2016-09-30 11:01 am
That's kind of tough to do, in reference to HTML. But if there's something you're looking to do specifically we're happy to recommend a solution.
n/a Points
2016-09-26 3:38 pm

For some reason it isn't working, Why

Staff
13,791 Points
2016-09-30 11:00 am
what exactly isn't working? Can you provide more details about what you are trying to do so we can help you?
n/a Points
2016-09-19 6:54 pm

I've tried adding code to the text page, but when I update it disappears.  I'm trying to add some specific spacing using a <p><p/> tag and a <br/>tag and neither of them stay when I update ???? :(

Staff
43,761 Points
2016-09-20 7:49 am
Try adding <p>$nbsp;</p> and see if that helps. <p></p> is blank and may be stripped out.
n/a Points
2016-09-19 4:23 pm

I need to add code to the header area of my web site. I have no idea where to see that as it is not on the page I want to add some code to.

Can you tell me where I can edit the header?

Thanks in advance.

n/a Points
2016-09-16 10:27 am

Thank you very much. You just brought me from going crazy mode to now I get it mode. Wonderful.

 

 

n/a Points
2016-08-29 2:02 am

how to add image html code ??

Staff
43,761 Points
2016-08-29 3:19 pm
Just the same as above, using an img tag.
n/a Points
2016-08-27 6:22 am
How can i insert preload animation in my wordpress blog please reply.
Staff
43,761 Points
2016-08-29 3:18 pm
Are you talking about an animated gif? It would be added the same, with an img reference.
n/a Points
2016-08-21 10:07 pm

you save this old OLD guy ass. thanks guys

n/a Points
2016-11-11 6:27 am

Wow! More than I could've hoped for.  A simple, straightforward idiots guide! Thank you, thank you, thank you.

Staff
2,858 Points
2016-11-11 10:01 am
OKOactive, I'm glad our article was of assistance, and you're most welcome. Have a great day!
n/a Points
2016-07-31 3:08 am

Just followed the steps, and added Badge for Blogger Network HTML code to my site, Thank you!

n/a Points
2016-07-25 8:54 am

Thanks

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

74 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!