Title: Encoding problems with &#8220;&amp;&#8221;
Last modified: July 2, 2017

---

# Encoding problems with “&”

 *  Resolved [unicco](https://wordpress.org/support/users/unicco/)
 * (@unicco)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/encoding-problems-with/)
 * I’m importing a URL into my woocommerce- “variation description”. This URL has“&”
   in it ([http://www.example.com/products/?/products/?product=6321,01,74,00&lng=DK&category=](http://www.example.com/products/?/products/?product=6321,01,74,00&lng=DK&category=)).
   In my CSV-file this URL is correct, but when I look at the imported data, within
   woocommerce, the “&” has changed to “& a m p ;” (without the spaces, as wordpress.
   org is replacing this html-tag to &) – so the url looks like: “[http://www.example.com/products/?product=6321,01,74,00&amp](http://www.example.com/products/?product=6321,01,74,00&amp);
   a m p ;lng=DK&category=”. Pretty annoying.
 * You require 100000 information when creating a ticket on your official site, 
   and I dont have time for that.
    -  This topic was modified 8 years, 9 months ago by [unicco](https://wordpress.org/support/users/unicco/).
    -  This topic was modified 8 years, 9 months ago by [unicco](https://wordpress.org/support/users/unicco/).
    -  This topic was modified 8 years, 9 months ago by [unicco](https://wordpress.org/support/users/unicco/).
    -  This topic was modified 8 years, 9 months ago by [unicco](https://wordpress.org/support/users/unicco/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [unicco](https://wordpress.org/support/users/unicco/)
 * (@unicco)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/encoding-problems-with/#post-9281524)
 * Btw. Have you ever heard about “high cohesion” in programming. Your import function
   is like 5000 lines long. What the freaking **** have you been thinking?
    -  This reply was modified 8 years, 9 months ago by [unicco](https://wordpress.org/support/users/unicco/).
 *  Thread Starter [unicco](https://wordpress.org/support/users/unicco/)
 * (@unicco)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/encoding-problems-with/#post-9281554)
 * In \wpai-woocommerce-add-on\libraries\XmlImportWooCommerceProduct.php you should
   change line 585 from
 * `$this->pushmeta($pid, '_variation_description', wp_kses_post($product_variation_description[
   $i]) );`
 * to
 * `$this->pushmeta($pid, '_variation_description', htmlspecialchars_decode( wp_kses_post(
   $product_variation_description[$i]) ) );`
 * That fixed the problem.
    -  This reply was modified 8 years, 9 months ago by [unicco](https://wordpress.org/support/users/unicco/).
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/encoding-problems-with/#post-9292129)
 * Hi [@unicco](https://wordpress.org/support/users/unicco/),
 * This is actually how WooCommerce works, if you manually try to save this URL `
   http://www.example.com/products/?/products/?product=6321,01,74,00&lng=DK&category
   =` in the variation description you will see `$amp` as well.
 * To fix that, in your import template you can wrap your variation description 
   in the htmlspecialchars_decode function, like this: `[htmlspecialchars_decode({
   my_var_desc_data[1]})]`
    -  This reply was modified 8 years, 9 months ago by [WP All Import](https://wordpress.org/support/users/wpallimport/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Encoding problems with “&”’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/encoding-problems-with/#post-9292129)
 * Status: resolved