# How to clean HTML pasted from Word in PrestaShop descriptions

> The visible text sometimes represents less than 10% of the description's actual weight. What the word processor injects, why mobile rendering breaks, and how to clean in bulk without losing the structure.

- Page: <https://www.datafirefly.com/en/2026/09/20/clean-html-descriptions-prestashop/>
- Language: en
- Published: 2026-09-20
- Last updated: 2026-09-20
- Other languages: [fr](https://www.datafirefly.com/2026/09/20/nettoyer-html-descriptions-prestashop/index.md), [es](https://www.datafirefly.com/es/2026/09/20/limpiar-html-descripciones-prestashop/index.md), [de](https://www.datafirefly.com/de/2026/09/20/html-beschreibungen-bereinigen-prestashop/index.md), [it](https://www.datafirefly.com/it/2026/09/20/ripulire-html-descrizioni-prestashop/index.md), [pl](https://www.datafirefly.com/pl/2026/09/20/czyszczenie-html-opisow-prestashop/index.md), [nl](https://www.datafirefly.com/nl/2026/09/20/html-beschrijvingen-schoonmaken-prestashop/index.md), [pt](https://www.datafirefly.com/pt/2026/09/20/limpar-html-descricoes-prestashop/index.md)
- Index: <https://www.datafirefly.com/en/2026/llms.txt>

A product description pasted from a word processor looks clean in the editor and becomes a problem in the code. The visible text sometimes represents less than 10% of the description's actual weight, the rest being formatting markup you have no use for.

## What the word processor actually injects

A copy-paste from a document brings in four families of junk code.

**Inline styles.** Every paragraph, every fragment of a sentence gets a font, size, colour and line-height declaration. A ten-word sentence can carry three hundred characters of style attributes.

**Proprietary tags.** Elements and attributes specific to the original software, which browsers ignore but which stay stored in the database and served on every display.

**Conditional comments.** Blocks of code meant for old browsers, sometimes bulkier than the text itself.

**Empty and nested tags.** Paragraphs containing nothing but a non-breaking space, formatting elements stacked five levels deep around a single word.

## The concrete consequences

Three effects, in order of severity.

**Page weight.** On a catalogue where each description weighs 30 kilobytes instead of 3, the product page loads more slowly, and that affects your performance metrics.

**Broken mobile rendering.** This is the most visible problem for your customers. A font fixed at 11 points and a width in pixels produce unreadable text or horizontal overflow on a small screen. The theme cannot correct what an inline style imposes.

**Visual inconsistency.** Five people pasting from five different documents produce five different typographies across your catalogue. The site looks cobbled together, and no theme change fixes it.

A fourth, quieter effect: the content becomes hard to reuse. Exporting these descriptions to a product feed or a marketplace passes on the junk markup, which is often rejected or displayed as is.

## What to remove, and what to keep

This is the question that decides whether a bulk clean-up is feasible.

**Remove without hesitation:** inline style attributes, proprietary tags and attributes, comments, purely visual formatting tags, empty paragraphs, class attributes that do not exist in your theme.

**Keep at all costs:** the semantic structure. Headings, paragraphs, lists, tables, links, bold and italic where they carry meaning.

**Examine case by case:** tables, whose formatting may be necessary for readability, and images embedded in the description, whose fixed dimensions can break mobile rendering.

The deciding rule: remove what describes appearance, keep what describes the nature of the content. A heading must stay a heading, not become a bold 16-point paragraph.

## Cleaning in bulk without breaking anything

Three precautions, in this order.

**Back up first.** A badly calibrated clean-up on three thousand descriptions cannot be recovered by hand. The database backup must be made and verified.

**Test on a sample.** Take twenty representative products, including the most complex: those with tables, embedded images and long lists. Compare before and after visually, not only in the code.

**Work in batches.** One category at a time rather than the whole catalogue. You limit the scale of a mistake and you can adjust the rules between two passes.

A method point: also handle short descriptions, category descriptions and CMS pages. They suffer from the same problem and are often forgotten.

## Stopping the problem coming back

A one-off clean-up is pointless if the same content returns with the next import.

Three preventive measures.

**Pasting without formatting.** Train your teams on the plain-text paste shortcut. It is the most effective and least expensive measure.

**Filtering on input.** The back-office editor can be configured to clean pasted content automatically. That configuration exists and is rarely enabled.

**Cleaning on import.** If your descriptions come from a supplier or a file, the processing must happen at import time, not afterwards.

## The case of supplier descriptions

A frequent situation on reselling catalogues: descriptions arrive from a supplier file, with their own markup.

Two problems come on top of the technical clean-up. The content is **identical across all resellers**, which does nothing to distinguish you in the eyes of search engines. And it sometimes contains **references to the supplier**, external links or warranty statements that do not match your terms.

HTML cleaning fixes the form. The substance calls for a rewrite, at least on your main references.

## Checking the result

Three checks after a clean-up.

The **average weight of descriptions**, before and after. A reduction of 60 to 80% is common on a catalogue that has never been cleaned.

The **mobile rendering** of a sample of pages, particularly those that contained tables.

The **load time** of a typical product page, which should improve noticeably on the heaviest descriptions.

The  handles this work on PrestaShop 8 and 9: removal of word-processor code, inline styles and empty tags, batch processing with a preview before applying, and preservation of the semantic structure.
