{"id":11285129,"date":"2019-03-07T10:19:35","date_gmt":"2019-03-07T10:19:35","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=helphub_article&#038;p=11285129"},"modified":"2026-05-01T20:59:25","modified_gmt":"2026-05-01T20:59:25","slug":"custom-html","status":"publish","type":"helphub_article","link":"https:\/\/wordpress.org\/documentation\/article\/custom-html\/","title":{"rendered":"Custom HTML"},"content":{"rendered":"\n<p class=\"has-text-align-right has-small-font-size wp-block-paragraph\"><a href=\"https:\/\/wordpress.org\/documentation\/article\/blocks\/\">Go back to the list of Blocks<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Hypertext Markup Language (HTML)<\/strong>, is language used to describe the semantic content of web pages. This can be added using the&nbsp;custom HTML block. This block allows you to insert your code so you can fine-tune your content.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The custom HTML block is for raw HTML only; for example, shortcode is not parsed in this block. It attempts to render any valid HTML. However, if a user lacks the <code>unfiltered_html<\/code> capability (e.g., Contributor), WordPress will sanitize the content using <code><a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_kses\/\">wp_kses()<\/a><\/code>, stripping disallowed tags like <code>&lt;script&gt;<\/code>, <code>&lt;iframe&gt;<\/code>, etc. <\/p>\n\n\n\n<p class=\"has-text-align-left has-background wp-block-paragraph\" style=\"background-color:#e5f5fa\"><a href=\"https:\/\/wordpress.org\/documentation\/article\/roles-and-capabilities\/\">Learn more about WordPress user roles and capabilities.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add a Custom HTML block<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to add a&nbsp;custom HTML block, click on the&nbsp;<strong>Block Inserter<\/strong>&nbsp;icon.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay controls loop muted src=\"https:\/\/wordpress.org\/documentation\/files\/2019\/03\/custom-html.mp4\"><\/video><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can also type <code>\/html<\/code> and hit enter in a new paragraph block to add one quickly.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/1508963\/164263756-13d7432b-f385-4953-bcdb-73e8122ef430.png\" alt=\"\" \/><figcaption class=\"wp-element-caption\">HTML block add typing<\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-align-left has-background wp-block-paragraph\" style=\"background-color:#e5f5fa\"><a href=\"https:\/\/wordpress.org\/documentation\/article\/adding-a-new-block\/\">Detailed instructions on adding blocks<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Editing the Block<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&nbsp;<a href=\"https:\/\/wordpress.org\/documentation\/article\/wordpress-editor\/#adding-a-block\">add the block<\/a>, you can add your code and view it right from the block options. You also have all the standard block options.<br><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/1508963\/164263762-91c8b6d3-985e-4b45-b908-cde86309fc05.png\" alt=\"\" style=\"width:414px;height:86px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Preview block<\/h3>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/1508963\/164263768-4e6a6c16-8e7c-4186-af0e-62464c6daf6c.png\" alt=\"Preview option in HTML block\" style=\"width:359px;height:66px\" \/><figcaption class=\"wp-element-caption\">Preview option in HTML block<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">More Options <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">These controls give you the option to copy, duplicate, and edit your block as HTML.<\/p>\n\n\n\n<p class=\"has-text-align-left has-background wp-block-paragraph\" style=\"background-color:#e5f5fa\"><a href=\"https:\/\/wordpress.org\/documentation\/article\/adding-a-new-block\/\"><\/a><a href=\"https:\/\/wordpress.org\/documentation\/article\/more-options\/\">Read about these and other settings.<\/a><\/p>\n\n\n\n<h2 id=\"block-settings-panel\" class=\"wp-block-heading\">Block Settings<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While most blocks have specific options in the editor sidebar in addition to the options found in the block toolbar, the HTML block does not have extra options.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/1508963\/164263778-594309aa-4b96-45bb-b6c7-ae650f226594.png\" alt=\"Block settings  for the custom HTML block\" style=\"width:348px;height:201px\" \/><figcaption class=\"wp-element-caption\">Block settings for the custom HTML block<\/figcaption><\/figure>\n\n\n\n<div id=\"changelog\" class=\"wp-block-group changelog has-background is-layout-flow wp-block-group-is-layout-flow\" style=\"background-color:#dce5ec\">\n<h2 class=\"wp-block-heading has-medium-font-size\">Changelog<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Updated 2026-05-01\n<ul class=\"wp-block-list\">\n<li>Updated formatting and added link to roles and capabilities<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Updated 2025-07-21\n<ul class=\"wp-block-list\">\n<li>Added detail HTML processing<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Updated 2022-11-26\n<ul class=\"wp-block-list\">\n<li>Removed redudant content <\/li>\n\n\n\n<li>Aligned images for mobile view<\/li>\n\n\n\n<li>Added heading<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Updated 2022-04-20\n<ul class=\"wp-block-list\">\n<li>Update screenshots to 5.9<\/li>\n\n\n\n<li>Add More Options section<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go back to the list of Blocks Hypertext Markup Language (HTML), is language used to describe the semantic content of web pages. This can be added using the&nbsp;custom HTML block. This block allows you to insert your code so you can fine-tune your content.&nbsp; The custom HTML block is for raw HTML only; for example, [&hellip;]<\/p>\n","protected":false},"author":13243985,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false},"category":[80,90],"class_list":["post-11285129","helphub_article","type-helphub_article","status-publish","hentry","category-customization","category-widget-blocks"],"revision_note":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/11285129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles"}],"about":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/types\/helphub_article"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/comments?post=11285129"}],"version-history":[{"count":8,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/11285129\/revisions"}],"predecessor-version":[{"id":16367612,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/11285129\/revisions\/16367612"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wporg\/v1\/users\/avillegasn"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/media?parent=11285129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/category?post=11285129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}