[Skip to main content](#vessel-content)

#   Don't allow HTML in product descriptions

##

- **[darrelluk](/forum/user/38717-darrelluk "View darrelluk's Profile")**
- [![darrelluk's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38717-darrelluk "View darrelluk's Profile") Topic Author
- [ Offline](/forum/user/38717-darrelluk)

Less More

- Posts: 112
- Thank you received: 1
-
-

10 years 2 months ago [\#249997](#249997) by [darrelluk](/forum/user/38717-darrelluk "View darrelluk's Profile")  *[Don't allow HTML in product descriptions](/forum/23-market-how-to/886430-dont-allow-html-in-product-descriptions#249997 "-- HikaShop version -- : 3.7.1 -- HikaMarket version -- : 1.7.1 -- Joomla version -- : 3.6.2  I was told to post this in Hikamarket.  How do I prevent users from using HTML in product descriptions? What code and where do I need to change on the Product page so that it keeps it to simple text?  Thx, Darrell")* was created by *[darrelluk](/forum/user/38717-darrelluk "View darrelluk's Profile")*

-- HikaShop version -- : 3.7.1
-- HikaMarket version -- : 1.7.1
-- Joomla version -- : 3.6.2

I was told to post this in Hikamarket.

How do I prevent users from using HTML in product descriptions? What code and where do I need to change on the Product page so that it keeps it to simple text?

Thx, Darrell

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg2NDMwLWRvbnQtYWxsb3ctaHRtbC1pbi1wcm9kdWN0LWRlc2NyaXB0aW9ucz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[darrelluk](/forum/user/38717-darrelluk "View darrelluk's Profile")**
- [![darrelluk's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38717-darrelluk "View darrelluk's Profile") Topic Author
- [ Offline](/forum/user/38717-darrelluk)

Less More

- Posts: 112
- Thank you received: 1
-
-

10 years 2 months ago [\#250004](#250004) by [darrelluk](/forum/user/38717-darrelluk "View darrelluk's Profile")  Replied by *[darrelluk](/forum/user/38717-darrelluk "View darrelluk's Profile")* on topic *[Don't allow HTML in product descriptions](/forum/23-market-how-to/886430-dont-allow-html-in-product-descriptions#250004 "-- HikaShop version -- : 3.7.1 -- HikaMarket version -- : 1.7.1 -- Joomla version -- : 3.6.2  I was told to post this in Hikamarket.  How do I prevent users from using HTML in product descriptions? What code and where do I need to change on the Product page so that it keeps it to simple text?  Thx, Darrell")*

Finally figured how to stop vendors from using crazy font sizes, colours etc.

System &gt; Global Configuration &gt; Text Filters

Find the filter group you have assigned to your vendors.

&gt; Filter type = NO HTML
&gt; Filter Tags = p,br,b,i (to allow basic formatting)

You then go to...

Components &gt; Hikashop &gt; Hikamarket &gt; Configuration &gt; Editor &gt; plg_editors_none

This will remove the editor altogether on the product description field and prevent any HTML tags apart from the ones allowed above to be used, even if you paste text in.

Thx, Darrell

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg2NDMwLWRvbnQtYWxsb3ctaHRtbC1pbi1wcm9kdWN0LWRlc2NyaXB0aW9ucz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 2 months ago -  10 years 2 months ago [\#250029](#250029) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Don't allow HTML in product descriptions](/forum/23-market-how-to/886430-dont-allow-html-in-product-descriptions#250029 "-- HikaShop version -- : 3.7.1 -- HikaMarket version -- : 1.7.1 -- Joomla version -- : 3.6.2  I was told to post this in Hikamarket.  How do I prevent users from using HTML in product descriptions? What code and where do I need to change on the Product page so that it keeps it to simple text?  Thx, Darrell")*

Hi,

Thanks for your post in that section.

In the HikaMarket product class (administrator/components/com_hikamarket/classes/product.php), you will find that code Code:

$product-&gt;product_description = JRequest::getVar('product_description','','','string',JREQUEST_ALLOWRAW); if((int)$config-&gt;get('vendor_safe_product_description', 1)) { $safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1); $product-&gt;product_description = $safeHtmlFilter-&gt;clean($product-&gt;product_description, 'string'); }

You can replace that code by Code:

$product-&gt;product_description = JRequest::getVar('product_description','','','string',JREQUEST_ALLOWRAW); if((int)$config-&gt;get('vendor_safe_product_description', 1)) { $safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1); $product-&gt;product_description = $safeHtmlFilter-&gt;clean($product-&gt;product_description, 'string'); } $strip_tags = $config-&gt;get('vendor_striptags_product_description', ''); if(!empty($strip_tags)) { $product-&gt;product_description = strip_tags($product-&gt;product_description, $strip_tags); }

So you will have a new hidden setting to completely remove all HTML tags in the product description when a vendor edit a product.

You can also replace in the same file Code:

$product-&gt;product_description = JRequest::getVar('product_variant_description','','','string',JREQUEST_ALLOWRAW); $safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1); $product-&gt;product_description = $safeHtmlFilter-&gt;clean($product-&gt;product_description, 'string');

By Code:

$product-&gt;product_description = JRequest::getVar('product_variant_description','','','string',JREQUEST_ALLOWRAW); if((int)$config-&gt;get('vendor_safe_product_description', 1)) { $safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1); $product-&gt;product_description = $safeHtmlFilter-&gt;clean($product-&gt;product_description, 'string'); } $strip_tags = $config-&gt;get('vendor_striptags_product_description', ''); if(!empty($strip_tags)) { $product-&gt;product_description = strip_tags($product-&gt;product_description, $strip_tags); }

So the variants will also have that hidden setting available.

Please note that the patch will be integrated into next HikaMarket release.

For more details about "strip_tags" : [ php.net/manual/en/function.strip-tags.php](http://php.net/manual/en/function.strip-tags.php)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Last edit: 10 years 2 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg2NDMwLWRvbnQtYWxsb3ctaHRtbC1pbi1wcm9kdWN0LWRlc2NyaXB0aW9ucz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.056 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
