{"id":818,"date":"2026-11-15T15:00:37","date_gmt":"2026-11-15T15:00:37","guid":{"rendered":"https:\/\/html-editor-online.com\/blog?p=818"},"modified":"2026-11-15T15:00:37","modified_gmt":"2026-11-15T15:00:37","slug":"import-html-script-appears-as-text-wysiwyg-editor","status":"publish","type":"post","link":"https:\/\/html-editor-online.com\/blog\/import-html-script-appears-as-text-wysiwyg-editor\/","title":{"rendered":"Import HTML Script Appears as Text in WYSIWYG Editor: Why and How to Clean It"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you searched for <em>import HTML script appears as text WYSIWYG editor<\/em>, here is the short answer: you are most likely looking at an import artifact, not a script that ran. The HTML Editor Online documentation says that when a page is imported into the <a href=\"https:\/\/html-editor-online.com\/\" title=\"WYSIWYG HTML Editor\">visual editor<\/a>, the HTML is converted into rich-text content. Scripts are not run during that conversion, but their source can become visible text among your paragraphs. This is documented behavior of this editor, not a general rule of how browsers treat scripts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post I show how to recognize the artifact, remove it from content meant for a CMS, and decide when the HTML Code Editor is the better place to look at a page. The input is a full HTML page loaded with Import URL or Import File. The output you want is clean article copy, or a clear view of the original markup.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li class=\"\"><a href=\"#import-html-script-appears-as-text-in-a-wysiwyg-editor-how-to-spot-it-1\">Import HTML Script Appears as Text in a WYSIWYG Editor: How to Spot It<\/a><\/li><li class=\"\"><a href=\"#why-script-source-shows-up-after-an-import-2\">Why Script Source Shows Up After an Import<\/a><\/li><li class=\"\"><a href=\"#clean-up-when-an-import-html-script-appears-as-text-in-the-wysiwyg-editor-3\">Clean Up When an Import HTML Script Appears as Text in the WYSIWYG Editor<\/a><\/li><li class=\"\"><a href=\"#use-the-html-code-editor-when-you-need-to-inspect-page-markup-4\">Use the HTML Code Editor When You Need to Inspect Page Markup<\/a><\/li><li class=\"\"><a href=\"#what-visible-code-does-and-does-not-prove-5\">What Visible Code Does and Does Not Prove<\/a><\/li><li class=\"\"><a href=\"#if-import-url-fails-use-a-local-html-file-6\">If Import URL Fails, Use a Local HTML File<\/a><\/li><li class=\"\"><a href=\"#frequently-asked-questions\">Frequently asked questions<\/a><\/li><li class=\"\"><a href=\"#next-steps\">Next steps<\/a><\/li><li class=\"\"><a href=\"#sources\">Sources and further reading<\/a><\/li><\/ul><\/nav><\/div>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6afa4800577f4&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6afa4800577f4\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-1-757-1-c3d7fed5d1abf440-1024x576.jpg\" alt=\"Illustration of a developer noticing stray code-like lines inside an article draft after a page import\" class=\"wp-image-821\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-1-757-1-c3d7fed5d1abf440-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-1-757-1-c3d7fed5d1abf440-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-1-757-1-c3d7fed5d1abf440-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-1-757-1-c3d7fed5d1abf440.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"import-html-script-appears-as-text-in-a-wysiwyg-editor-how-to-spot-it-1\">Import HTML Script Appears as Text in a WYSIWYG Editor: How to Spot It<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The artifact is easiest to recognize when you know what the source page contained. Here is a small, fictitious page that has one script element after the article copy:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!doctype html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n  &lt;title&gt;Spring Update&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;h1&gt;Spring Update&lt;\/h1&gt;\n  &lt;p&gt;The workshop opens on Saturday.&lt;\/p&gt;\n  &lt;script&gt;\n    const seats = 12;\n    console.log(seats);\n  &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After importing a page like this, the artifact looks like ordinary editor content that happens to read like programming. You might see a line resembling a variable declaration or a function call sitting next to your headings and paragraphs, for example <code>const seats = 12;<\/code> followed by <code>console.log(seats);<\/code>. Nothing is executing. The words are simply text in the rich-text content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not assume every import produces this. It depends on what the source page contains and how the page is built. Use these signals to decide whether you have the artifact:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lines with semicolons, braces, <code>const<\/code>, <code>var<\/code>, <code>function<\/code> or <code>document.<\/code> appear in the middle of prose.<\/li>\n\n\n\n<li>The code-like text is not something the original article intended to show as an example.<\/li>\n\n\n\n<li>The same text is missing from the visible page when you open the original in a normal browser tab.<\/li>\n\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The last check matters most. If the text is not visible on the live page, but it is visible in the editor, the import is the source of the difference.<\/p>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-2-757-2-845b1711f75be8ef-1024x576.jpg\" alt=\"Conceptual funnel turning a full web page into plain editable content\" class=\"wp-image-823\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-2-757-2-845b1711f75be8ef-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-2-757-2-845b1711f75be8ef-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-2-757-2-845b1711f75be8ef-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-2-757-2-845b1711f75be8ef.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"why-script-source-shows-up-after-an-import-2\">Why Script Source Shows Up After an Import<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The cause is a scope mismatch. The visual editor is built for editing content, not for preserving an entire web page. Its documentation says an import can discard the head, style blocks, IDs and classes, and can convert some controls to text. A full page has structure that a content editor has no place to keep, so the conversion keeps what it can express as rich text.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In a browser, the HTML parser treats the script element as its own kind of element. The <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/scripting.html\" title=\"HTML Standard\" target=\"_blank\" rel=\"noopener\">HTML Standard section on scripting<\/a> defines it separately from ordinary page copy, and the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Reference\/Elements\/script\" title=\"HTML script element - HTML | MDN\" target=\"_blank\" rel=\"noopener\">MDN reference for the script element<\/a> describes how it embeds or references executable code. A browser rendering a page does not show that code as a paragraph. The editor, however, converts the imported HTML into rich-text content, and that conversion does not carry the same boundary. This is a documented behavior of this editor, so do not read it as proof that browsers display the contents of script elements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same scope mismatch explains other import side effects you may notice. If your headings lost their styling hooks, read the guide on why source view can <em><a href=\"https:\/\/html-editor-online.com\/blog\/wysiwyg-source-view-removes-class-and-id-attributes\/\" title=\"WYSIWYG Source View Removes Class and ID Attributes: Why and What to Do\">remove class and id attributes<\/a><\/em> from the content. If you export and open the file, you may also find a <a href=\"https:\/\/html-editor-online.com\/blog\/wysiwyg-html-download-missing-doctype-head-body\/\" title=\"WYSIWYG HTML Download Missing Doctype, Head and Body: Why It Happens\">download without a doctype, head or body<\/a>, which is the same theme from the other direction: the editor holds content, not a page shell.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One more detail: the editor does not run the script during the import, so the text you see is not the result of code. It is source text that was kept as content.<\/p>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6afa480059091&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6afa480059091\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-3-757-3-b02c91141d739de9-1024x576.jpg\" alt=\"Editor removing stray code-like lines from an article draft before moving it to a CMS\" class=\"wp-image-825\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-3-757-3-b02c91141d739de9-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-3-757-3-b02c91141d739de9-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-3-757-3-b02c91141d739de9-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/import-html-script-appears-as-text-wysiwyg-editor-image-3-757-3-b02c91141d739de9.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"clean-up-when-an-import-html-script-appears-as-text-in-the-wysiwyg-editor-3\">Clean Up When an Import HTML Script Appears as Text in the WYSIWYG Editor<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The goal is content that is safe to paste into a CMS. Work in this order so you can always go back:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Keep a copy of the original page.<\/strong> Save the file or note the URL before editing, so you can compare later.<\/li>\n\n\n\n<li><strong>Find the stray code text.<\/strong> Scan the content for lines that read like programming. Searching your eye for <code>const<\/code>, <code>function<\/code>, <code>console<\/code> and <code>document.<\/code> is a quick start.<\/li>\n\n\n\n<li><strong>Remove it from the visual content.<\/strong> Select the stray lines and delete them like any other text.<\/li>\n\n\n\n<li><strong>Check the plain-text preview.<\/strong> The homepage preview is plain text, so it helps you confirm that no code-like lines remain, but it is not a rendered-page preview.<\/li>\n\n\n\n<li><strong>Inspect the markup.<\/strong> Use Copy HTML or Download HTML and read the result before pasting anywhere.<\/li>\n\n\n\n<li><strong>Review again in the CMS.<\/strong> The CMS applies its own processing, so the final result can differ from what you saw in the editor.<\/li>\n\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">For the example page above, the cleaned markup should resemble this, apart from small differences in how the editor serializes it:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;h1&gt;Spring Update&lt;\/h1&gt;\n&lt;p&gt;The workshop opens on Saturday.&lt;\/p&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Be careful not to delete a code example that belongs in the article. If your page deliberately shows code, keep it in a code block and encode angle brackets so they display as text; the <a href=\"https:\/\/html-editor-online.com\/tools\/html_encoder\" title=\"HTML Encoder \/ Decoder\">HTML Encoder \/ Decoder<\/a> tool encodes HTML entities for exactly that purpose. If a legitimate example later behaves badly in a CMS, read about <a href=\"https:\/\/html-editor-online.com\/blog\/quill-code-block-loses-formatting-in-cms\/\" title=\"Why a Quill Code Block Loses Formatting in CMS Pastes\">a code block that loses its formatting in a CMS<\/a> to see what to check.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, remember that removing visible text is not a security step. The editor&#8217;s own sanitizing is not something to rely on for every CMS, so treat the CMS review as part of the job.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"use-the-html-code-editor-when-you-need-to-inspect-page-markup-4\">Use the HTML Code Editor When You Need to Inspect Page Markup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your real goal is to look at how a page is built rather than to edit article copy, the visual editor is the wrong place. The <a href=\"https:\/\/html-editor-online.com\/editors\/html\" title=\"HTML Code Editor\">HTML Code Editor<\/a> accepts URL or file imports and shows the markup in its code pane, with syntax highlighting, auto-closing tags and beautify or minify options. It has no validation, so it will show you the markup but will not tell you whether it is correct.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The code editor also has a live preview, which is a separate feature from the code pane. That preview is sandboxed, but it can run inline scripts. So do not open the preview of imported code you do not trust just to read its text. Reading the code pane is enough for inspection, and it never needs the preview to run.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A quick way to choose between the two:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Editing headings, paragraphs, lists and links for publication:<\/strong> use the visual editor and clean the import as described above.<\/li>\n\n\n\n<li><strong>Checking which scripts, styles or attributes a page contains:<\/strong> use the code pane and read the markup.<\/li>\n\n\n\n<li><strong>Reformatting messy markup:<\/strong> use beautify in the code editor, or the HTML Beautifier tool, knowing that formatting improves layout but does not repair invalid code or validate semantics.<\/li>\n\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Using the right editor avoids the whole problem, because the code pane shows the page as markup instead of converting it into rich text.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-visible-code-does-and-does-not-prove-5\">What Visible Code Does and Does Not Prove<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Seeing JavaScript source in the content does not prove the script executed. In this import path the documentation says scripts are not run, so the text is just text. The reverse is also true: not seeing any code does not prove a page has no scripts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An external script tag points to a separate resource, so its JavaScript does not need to appear in the imported HTML at all:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;script src=&quot;\/assets\/app.js&quot;&gt;&lt;\/script&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Only the tag references the file. The code lives elsewhere, and an import of the page markup will not necessarily contain it. That is why a clean-looking import tells you little about what the original page loads.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It helps to keep several checks separate:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Formatting:<\/strong> whether the markup is readable.<\/li>\n\n\n\n<li><strong>Syntax and structure:<\/strong> whether the HTML is well formed, which the HTML Code Editor does not check.<\/li>\n\n\n\n<li><strong>Runtime behavior:<\/strong> what a script does when it actually runs.<\/li>\n\n\n\n<li><strong>Security:<\/strong> whether content is safe for your CMS and audience.<\/li>\n\n\n\n<li><strong>Meaning:<\/strong> whether the cleaned copy still says what the source said.<\/li>\n\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A clean plain-text preview satisfies none of these on its own. If you want to run a small script of your own deliberately, the <a href=\"https:\/\/html-editor-online.com\/editors\/javascript\" title=\"JavaScript Editor\">JavaScript Editor<\/a> runs code in the browser and shows synchronous console output. Never run code you do not trust there.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"if-import-url-fails-use-a-local-html-file-6\">If Import URL Fails, Use a Local HTML File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Import URL depends on the remote site allowing the browser&#8217;s cross-origin request. If the site does not permit it, the browser blocks the request and the import fails, even though the page opens normally in a tab. That failure is separate from the script artifact, but you may hit both on the same job.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The documented fallback is Import File. Save an authorized copy of the page as an HTML file, then import that file. Only do this for pages you own or have permission to use. Afterward, apply the same cleanup steps: compare against the original, remove stray code text from the content, and inspect Copy HTML or Download HTML before the CMS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also note that relative image paths and links from a saved file may not point where you expect after an import, so check them in the final result.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-1\">Does the visual editor run the JavaScript when I import a page?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">According to the editor&#8217;s documentation, scripts are not run during import. The source can appear as visible text because the HTML is converted into rich-text content.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-2\">Is the visible code a security problem?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The text itself is not executing, but visible code is not proof that the content is safe either. Remove stray code, then review the result in your CMS, which applies its own processing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-3\">How do I keep an intentional code example in the article?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Keep it in a code block and encode angle brackets so they show as text. The HTML Encoder \/ Decoder tool can encode HTML entities for that. Do not delete examples that belong in the article.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-4\">Why did my styles and classes disappear as well?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The documentation says imports can discard the head, style blocks, IDs and classes. The visual editor is for content, so it does not preserve a full page&#8217;s presentation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-5\">Why is there no code visible but the page still uses scripts?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An external script tag points to a separate file, so its JavaScript need not be in the imported HTML. Missing code text does not prove a page has no scripts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-6\">Import URL fails but the page opens in my browser. What now?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Import URL needs the remote site to permit the browser&#8217;s cross-origin request. If it does not, import an authorized local HTML file instead.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-7\">Will the cleaned content look the same in my CMS?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Not necessarily. A CMS may process pasted HTML differently, so review headings, links and lists there after pasting, and keep your original copy for comparison.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps\">Next steps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When an import HTML script appears as text in a WYSIWYG editor, treat it as an artifact of converting a full page into rich-text content, not as running code. Keep the original, remove the stray lines, check the plain-text preview, read Copy HTML or Download HTML, and review again in your CMS. A good next step: open the page you wanted to import in the HTML Code Editor&#8217;s code pane, read the markup there, and bring only the article copy into the visual editor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Related tools and resources on HTML Editor Online:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/html-editor-online.com\/editors\/html\">HTML Code Editor<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\/wysiwyg-source-view-removes-class-and-id-attributes\/\">WYSIWYG Source View Removes Class and ID Attributes: Why and What to Do<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\/wysiwyg-html-download-missing-doctype-head-body\/\">WYSIWYG HTML Download Missing Doctype, Head and Body: Why It Happens<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\/quill-code-block-loses-formatting-in-cms\/\">Why a Quill Code Block Loses Formatting in CMS Pastes<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/tools\/html_encoder\">HTML Encoder \/ Decoder<\/a><\/li>\n\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"sources\">Sources and further reading<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Reference\/Elements\/script\" target=\"_blank\" rel=\"noopener\">HTML script element &#8211; HTML | MDN<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/editors\/html\">HTML Code Editor<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/scripting.html\" target=\"_blank\" rel=\"noopener\">HTML Standard<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/\">WYSIWYG HTML Editor<\/a><\/li>\n\n\n<\/ul>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Import HTML script appears as text in a WYSIWYG editor? Learn to spot the artifact, clean it for your CMS, and use the HTML Code Editor to inspect markup.<\/p>\n","protected":false},"author":1,"featured_media":819,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[158,116,246,255,254,138],"class_list":["post-818","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wysiwyg","tag-cms-content","tag-html-code-editor","tag-html-import","tag-imported-html-cleanup","tag-script-element","tag-wysiwyg-editor"],"_links":{"self":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/comments?post=818"}],"version-history":[{"count":4,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/818\/revisions"}],"predecessor-version":[{"id":826,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/818\/revisions\/826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/media\/819"}],"wp:attachment":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/media?parent=818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/categories?post=818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/tags?post=818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}