PrestaShop Catalogue Management

Clean HTML in Product & Category Descriptions: Strip Word Markup, Inline Styles and Empty Tags (PrestaShop 8 & 9)

Strip Word markup, inline styles and empty tags from your descriptions, without touching the text.

Descriptions pasted from Word, Google Docs or an old WYSIWYG editor carry kilobytes of invisible code: MsoNormal classes, inline styles forcing Calibri 11pt, empty o:p tags, Office conditional comments, runs of non-breaking spaces. This module walks through your product and category descriptions, removes what does not belong there and leaves the text alone. You start with a simulation that writes nothing, compare ten before/after samples, then clean for real with a backup and a way back.

At a glance
  • Cleans product and category descriptions, plus CMS pages, brands and suppliers
  • Removes Microsoft Word markup, inline styles, editor classes and empty tags
  • Simulation mode writes nothing and reports ten before/after samples and the weight saved
  • AJAX batch processing: a large catalog goes through without a PHP timeout
  • Every overwritten value is backed up, a whole run is restored in one click
PrestaShop 8 & 9 Simulate before writing One-click rollback Multistore Source code included
  • 30-day refund
  • 12 months updates
  • 24h support
www.datafirefly.com/en/
HTML cleanup of PrestaShop product descriptions: Word code, inline styles and empty tags removed
v1.0.1 · updated 2026-07-27
What it does

The short version.

01

The Word code goes, the text stays

Conditional comments, XML islands, o:p and w:WordDocument tags, MsoNormal classes, mso- properties: what Word leaves behind is identified and removed. On a typical description pasted from Word, the weight drops from 56 KB to 24 KB.

02

You see it before it is written

The Simulate button walks the catalog without changing anything and reports how many records are affected, the weight saved and ten before/after samples shown side by side, each with a direct link to the record.

03

Your videos, tables and code blocks survive

YouTube, Vimeo, Dailymotion and Google Maps iframes are kept with their dimensions and their allowfullscreen attribute, and the trusted domain list is editable. Empty table cells are not removed, and the content of pre and code tags is never reformatted.

04

Safe to run again

The engine is idempotent: cleaning an already processed description leaves it byte for byte identical. A healthy record is never rewritten, so its modification date does not move.

05

One-click rollback

Every overwritten value is copied into a dedicated table, grouped by run. The Backups panel puts a whole run back without going near the database. Retention is configurable and old entries are purged automatically.

The long version

Everything you'd want to know before you install.

A detailed look at how Clean HTML in Product & Category Descriptions: Strip Word Markup, Inline Styles and Empty Tags (PrestaShop 8 & 9) works, why we built it the way we did, and the thinking behind the features above.

§ 01

What the module removes

A description pasted from Word arrives with an Office conditional comment at the top, an XML island, paragraphs carrying the MsoNormal class, inline styles forcing a font and a size, empty o:p tags and runs of three non-breaking spaces. None of it shows on the page, but all of it sits in your database, travels to every visitor and gets read by Google. The module recognises these patterns and removes them. Text, links, lists, tables and images are kept.

§ 02

A real parser, not a regular expression

Cleaning goes through DOMDocument. The document is rebuilt, which repairs unclosed tags and bad nesting along the way instead of breaking them further. Two regular expression passes wrap the DOM analysis, only for what a parser cannot represent: conditional comments, XML islands, namespaced tags. If parsing fails on unusual content, the module returns the original value untouched.

§ 03

Simulate, batch, back up

Processing runs in AJAX batches, with a progress bar and a stop button. Batch size goes down to 5 records on constrained hosting, which avoids the PHP timeout even on a catalog of several tens of thousands of records. In simulation mode nothing is written: you get the counters, the weight saved and ten before/after comparisons. In real mode every replaced value is copied into the backup table with a run identifier, so the whole thing can be put back from the back office.

§ 04

What the module does not break

Iframes from trusted providers keep their allow and allowfullscreen attributes and their dimensions; the check runs on the real host, so an address like youtube.com.example.tld is rejected. Empty table cells are preserved so your layout does not shift. The content of pre, code and textarea tags escapes whitespace normalisation. And the engine is idempotent: running the cleaning again on an already processed record produces no change, so no stray update timestamps.

§ 05

Cleaning on save

An option applies the same rules every time a product or a category is saved in the back office, through the hooks fired before the object is written. It is off by default: it is better to validate your rules in simulation before applying them continuously. This mode does not create a backup entry, unlike batch processing.