---
title: "Deprecation: #15415 - Deprecate removeBadHTML"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:deprecation-15415"
source: "Changelog/8.2/Deprecation-15415-DeprecateRemoveBadHTML.rst"
modified: "2026-09-15T10:46:36+00:00"
---

# Deprecation: #15415 - Deprecate removeBadHTML

See [forge#15415](https://forge.typo3.org/issues/15415)

## Description

Due to the wrong approach of removeBadHTML it is not 100% complete and does not keep its promise.

-   `ContentObjectRenderer::stdWrap_removeBadHTML()`
-   `ContentObjectRenderer::removeBadHTML()`
-   `stdWrap.removeBadHTML`

## Impact

Using the mentioned method or stdWrap property will trigger a deprecation log entry.

## Affected Installations

Instances that use the method or stdWrap property.

## Migration

Implement a proper encoding by yourself. Use `htmlspecialchars()` or `stdWrap.htmlSpecialChars`
in the context of HTML, `GeneralUtility::quoteJSvalue()` or `stdWrap.encodeForJavaScriptValue`
in the context of JavaScript.
