Guides/Create content/Add code to your site

Add code to your site

There are several ways you can add custom code to your WordPress.com website. This guide explains which types of code can be added to your website, depending on your WordPress.com plan.

About code restrictions

Image for: About code restrictions

The type of code you can add to a WordPress.com website depends on your plan level:

Alternatives to code

If you wish to use an iframe, javascript, or other code on a site without upgrading to a supported plan, consider the following alternatives:

HTML

Image for: HTML

HTML is the language of every webpage you visit on the internet. It uses special codes (called tags) to structure and organize the content of a webpage, such as text, images, links, and multimedia. All WordPress.com sites can use the following HTML tags:

  • a
  • address
  • 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
  • i
  • img
  • ins
  • kbd
  • li
  • map
  • mark
  • ol
  • p
  • pre
  • q
  • rp
  • rt
  • rtc
  • ruby
  • s
  • section
  • small
  • span
  • strike
  • strong
  • sub
  • summary
  • sup
  • table
  • tbody
  • td
  • tfoot
  • th
  • thead
  • tr
  • tt
  • u
  • ul
  • var

In addition, sites with a plugin-enabled plan can use the following codes:

embed, frame, iframe, form, input, object, textarea, script, style, link

You can access and edit the HTML of any page in the WordPress editor.

You can insert a custom HTML block for smaller snippets of HTML.

CSS

Image for: CSS

CSS handles the presentation and appearance of HTML web content. CSS can control the colors, fonts, sizes, spacing, and positioning of elements on a webpage.

CSS editing is supported on sites the Premium, Business, or Commerce plan. Visit our Custom CSS guide to learn more.

JavaScript

Image for: JavaScript

JavaScript brings interactivity and dynamic elements to web pages. JavaScript is used to create engaging features like interactive forms, animations, and responsive design.

JavaScript codes typically begin with a <script> tag and may be used on sites with a plugin-enabled plan. You can insert JavaScript code using a Custom HTML block or another method from the following section that describes how to insert code.

JavaScript from trusted partners, such as YouTube and Google Maps, can be converted to a supported embed or shortcode on any plan.

How to insert code

Image for: How to insert code

⚠️

Be extra careful when adding custom code that may make your site vulnerable to attacks. We recommend that you only add code that comes from a reputable source. If you are ever in doubt, err on the side of caution and look for an alternative method.

With the limitations described above, you can add code to your site using the most appropriate method for your goals. The following methods can work for inserting most code, including iframes and JavaScript:

Plugin-enabled sites only:

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!