{"id":12092864,"date":"2019-11-04T00:31:59","date_gmt":"2019-11-04T00:31:59","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/product-csv-import-stripping-sanitizing-html-code\/"},"modified":"2019-11-04T00:31:59","modified_gmt":"2019-11-04T00:31:59","slug":"product-csv-import-stripping-sanitizing-html-code","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/product-csv-import-stripping-sanitizing-html-code\/","title":{"rendered":"Product CSV Import stripping\/sanitizing HTML code?"},"content":{"rendered":"<p>Hi, I am using the default Product CSV Import module, all latest WC and WP versions. I have added an extra custom column using the <a href=\"https:\/\/github.com\/woocommerce\/woocommerce\/wiki\/Product-CSV-Importer-&amp;-Exporter#mapping-screen\">three filters described here<\/a> and save it as meta data. Everything works fine for regular data, however..<\/p>\n<p>One of the columns contains a script tag with a video player, such as:<br \/>\n<code>&lt;script src=&quot;\/\/content.jwplatform.com\/players\/-redacted-.js&quot;&gt;&lt;\/script&gt;<\/code><br \/>\nwhich I need saved as a meta data exactly how it appears in the CSV.<\/p>\n<p>I am unable to import this column, as the &lt;script&gt; simply gets removed\/sanitized for whatever reason? If I wrap the &lt;script&gt; into random text, it seems to go through.<\/p>\n<p>My question is, what are the rules for sanitizing the $data param in the following filters:<\/p>\n<pre><code>woocommerce_product_import_pre_insert_product_object\nwoocommerce_product_import_inserted_product_object<\/code><\/pre>\n<p>and is there any way to turn it off? I would prefer total control over the data coming from the CSV, even if its a raw HTML\/JS.<\/p>\n<p>Thank you.<\/p>\n","protected":false},"template":"","class_list":["post-12092864","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12092864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12092864\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12092864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}