Remove layout destroying HTML-Tags

Descrizione

Ripulisce il copia e incolla. Se vuoi riempire rapidamente un articolo o una pagina con contenuti già esistenti, usi spesso il copia e incolla, ma questo può distruggere il layout di un sito web!

The basic problem is that if you copy&paste content from different sources into the visual editor, any formatting is copied over. Specifically, whether from text documents, other websites, online-shops and cms or even from social media, something comes along everywhere. This also applies to content generated in AI chats, which often contains unwanted formatting as well.

Poiché spesso, oltre agli elementi HTML innocui, sono presenti anche elementi DIV, questi possono causare un rendering errato del proprio sito web o interromperne la visualizzazione. Il DIV-Detector integrato rileva automaticamente gli elementi div presenti nei contenuti dopo aver fatto l’incolla e mostra un avviso visivo con un link diretto per la pulizia.

To avoid this, this plugin checks the existing formatting and attributes and removes all those that could lead to a problem – with one click.

The cleanup includes:

  • Removes layout-breaking elements such as div and span as well as wrapper elements (figure, article, picture, aside, pre, blockquote) – the text is kept
  • Removes unnecessary attributes (e.g. classes, styles, IDs as well as aria-* and data-*) – alt texts of images on your own website are preserved
  • Removes style, script and iframe blocks including their content
  • Removes leftover CSS that comes along when you paste e-mails or Word documents
  • Removes emojis and hashtag links (e.g. from Instagram)
  • Removes images from foreign domains, local images are kept
  • Reduces repeated empty paragraphs and line breaks
  • Merges redundant nested formatting
  • Converts lists (e.g. from Word) into standards-compliant lists and cleans them up

Se copi e incolli nell’editor di testo, di solito non ci sono problemi.

Testato con questi page builder:

  • Classic Editor
  • Gutenberg
  • Divi 4.27
  • Elementor 4.3
  • WPBakery 9.0
  • Beaver Builder 2.11

Accessibility

The DIV warning in the Classic Editor is announced automatically by screen readers. Alt texts of images hosted on your own website are preserved during cleanup, so the accessibility of your content is not reduced. Cleaning up also converts presentational bold and italic markup into semantic strong and em elements.

Privacy GDPR

Questo plugin elabora il codice HTML analizzato e convertito esclusivamente all’interno del sito web in questione. Nessun contenuto viene memorizzato o trasferito ad altri server o servizi per l’elaborazione. Non vengono integrati né utilizzati strumenti di analisi o servizi di tracciamento esterni. La protezione dei dati in conformità con il GDPR è quindi garantita in ogni momento.

Screenshot

Installazione

Installazione da WordPress

  1. Visita Plugin > Aggiungi nuovo.
  2. Cerca Remove layout destroying HTML-Tags.
  3. Installa e attiva il plugin Remove layout destroying HTML-Tags.

Installazione manuale

  1. Carica l’intera cartella remove-layout-destroying-html-tags nella directory /wp-content/plugins/.
  2. Visita Plugin.
  3. Attiva il plugin Remove layout destroying HTML-Tags.

FAQ

Perché alcuni elementi img vengono rimossi?

Le immagini esterne — quelle il cui attributo src punta a un dominio esterno — vengono rimosse per motivi legati al copyright, alle prestazioni e alla sicurezza. Le immagini ospitate sul proprio dominio (percorsi relativi o URL assoluti dello stesso dominio) vengono mantenute. È consigliabile inserire sempre i dati delle immagini in modo corretto e dotarli degli attributi appropriati, il che migliora l’accessibilità, la SEO e la GEO (Generative Engine Optimization).

Funziona con Beaver, Gutenberg, Divi, Elementor o WPBakery?

Al momento funziona bene con Classic Editor, Gutenberg, Divi 4, Elementor, WPBakery e il builder di Beaver. L’integrazione per Divi 5 è in corso.

Why are the aria-* and title attributes removed?

These attributes are important for accessibility, but should be added and adapted individually so that the context is maintained. The alt text of images hosted on your own website is kept.

Perché vengono rimosse anche le emoji?

Sebbene le emoji si basino sull’Unicode internazionale, a volte vengono visualizzate in modo diverso. Ciò significa che le emoji possono apparire completamente diverse su iOS, Android e Windows ed essere interpretate diversamente di conseguenza. Queste vengono filtrate per evitare fraintendimenti in termini di contenuto e per evitare potenziali errori di visualizzazione.

Come funziona in Gutenberg?

Ci sono due modi per usarlo in Gutenberg: si può ripulire l’intero articolo o l’intera pagina o solo il contenuto di un blocco. Per pulire un blocco, basta usare l’icona nella barra degli strumenti. Se si desidera ripulire l’intero contenuto in una sola volta, andare nella barra laterale e utilizzare il pulsante Pulisci HTML nella sezione Pulizia HTML.

Come funziona in Beaver Builder?

In Beaver Builder il pulsante di pulizia appare direttamente sopra la barra degli strumenti dell’editor di testo all’interno di ogni modulo di testo. È sufficiente fare clic sul pulsante per ripulire il contenuto HTML di quel modulo. Un indicatore di caricamento segnala che il processo è in corso e il pulsante diventa verde per un breve istante una volta completata la pulizia.

Do I still need the plugin in Gutenberg and Elementor 4?

Current versions of Gutenberg and the Atomic elements in Elementor 4 already filter out many unwanted elements, such as div and span, when you paste content and keep only a small set of formatting. The plugin is still useful for the Classic Editor, the classic Elementor Text Editor widget, Divi, WPBakery, Beaver Builder, Custom HTML blocks and existing content. It also removes emojis and hashtag links.

Recensioni

Leggi la recensione di 1

Contributi e sviluppo

“Remove layout destroying HTML-Tags” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.

Collaboratori

“Remove layout destroying HTML-Tags” è stato tradotto in 5 lingue. Grazie a chi traduce per il contributo.

Traduci “Remove layout destroying HTML-Tags” nella tua lingua.

Ti interessa lo sviluppo?

Esplora il codice segui il repository SVN, segui il log delle modifiche tramite RSS.

Changelog

0.8.0 – 2026-11-03

  • New: Leftover CSS that comes along when you paste e-mails or Word documents is removed
  • New: Several empty paragraphs in a row are reduced to a single one (not in the Gutenberg editor, where each block is cleaned on its own)
  • New: Empty paragraphs at the beginning and end of the content are removed
  • New: An empty paragraph after every paragraph (typical for Word and e-mail) is removed (not in the Gutenberg editor)
  • New: Two or more line breaks in a row become a paragraph break, in a Gutenberg block they are reduced to a single line break
  • New: The valign and cellpadding attributes of tables are removed
  • Tweak: Plugin description corrected – the content is cleaned up on click, not automatically on save
  • Tweak: Plugin description extended with a feature list
  • Tweak: FAQ updated – Gutenberg and Elementor 4 behavior explained

0.7.0 – 2026-10-08

  • New: b and i elements are converted to the semantic strong and em elements
  • New: Redundant nested formatting (e.g. bold inside bold) is merged into a single element
  • New: Horizontal rules (<hr />) are now kept and normalized
  • New: The start, type and reversed attributes that Word adds to numbered lists are removed
  • New: One-time, dismissible review reminder in the admin area about a week after the first cleanup
  • Fix: The DIV warning is shown again in the WPBakery text editor, now with a direct cleanup link
  • Fix: Apostrophes in translated texts are no longer shown with a stray backslash
  • Fix: Cleanup no longer empties the editor when the content is too large to process
  • Tweak: WPBakery 9.0.1 tested
  • Tweak: Elementor 4.3 tested
  • Tweak: Cleanup button in Elementor is now easier to read, also in the dark editor theme
  • Tweak: Beaver Builder 2.11 tested
  • Tweak: Alt texts of images hosted on your own website are now preserved during cleanup
  • Tweak: The DIV warning in the Classic Editor is now announced by screen readers, and its close button label is translatable
  • Tweak: Japanese translation added – thanks to @hiroshisato and @mayukojpn
  • Tweak: Spanish translation added – thanks to @nilovelez
  • Tweak: French translation added – thanks to @bonaldi and @clementpolito
  • Tweak: Italian translation updated – thanks to @lidialab
  • Tweak: Screenshots added showing content before and after cleaning
  • Tweak: Security policy added (SECURITY.md)
  • Tweak: Code cleanup and consistency improvements

0.6.1.2 – 2026-09-15

  • Fix: style and script blocks are now fully removed including their content when pasted

0.6.1.1 – 2026-09-15

  • Tweak: FAQ updated – GEO (Generative Engine Optimization) added alongside SEO reference
  • Tweak: Changelog format note removed from plugin page

0.6.1 – 2026-09-15

  • New: Bullet point lists using the • symbol are automatically converted to proper HTML list elements on cleanup
  • Tweak: Tested with WordPress 7.1
  • Tweak: DIV-Detector feature name introduced in plugin description
  • Tweak: Privacy information updated – added note that no external analytics tools are used

0.6.0 – 2026-09-01

  • New: Hashtag links (link text starting with #) are now removed
  • New: iframe elements are now removed completely including their content
  • New: blockquote elements are now removed (content is preserved)
  • New: pre elements are now removed (content is preserved)
  • New: aside elements are now removed (content is preserved)
  • New: Visual warning when div elements are detected after pasting – Classic Editor and Beaver Builder highlight the cleanup button, Divi and WPBakery show a TinyMCE notification, Gutenberg shows a notice in the sidebar panel, Elementor highlights the cleanup button
  • Fix: Output escaping improved in Elementor integration
  • Fix: Unnecessary context check removed from Elementor integration
  • Fix: Script versioning fixed in Beaver Builder integration
  • Fix: TinyMCE plugin registration restricted to post editor pages to prevent initialization errors in other admin areas
  • Tweak: img handling improved – only foreign-domain images are removed; local images (relative or same-domain src) are kept
  • Tweak: FAQ updated – img element handling explained
  • Tweak: Gutenberg editor strings are now fully translatable via WordPress translation system

0.5.2 – 2026-08-10

  • Fix: Missing capability check in AJAX handler (any logged-in user could call the endpoint)
  • Fix: ABSPATH guard missing in WPBakery include file
  • Fix: Unsanitized $_GET[‘action’] in Elementor integration
  • Fix: Gutenberg sidebar cleanup now sends parallel requests instead of sequential (performance)
  • Fix: RichText toolbar button now sends actual HTML instead of plain text
  • Fix: Performance improved in Beaver Builder integration
  • Tweak: Gutenberg sidebar panel updated to use current WordPress API

0.5.1 – 2026-08-10

  • Tweak: FAQ updated – Beaver Builder usage explained

0.5.0 – 2026-08-10

  • New: Beaver Builder support
  • Tweak: Divi 4 moved to dedicated integration file
  • Tweak: WPBakery 9.0 tested
  • Tweak: Elementor 4.2 tested
  • Tweak: Beaver 2.10 tested
  • Tweak: Updating compatibility information

0.4.3 – 2026-05-21

  • Fix: PHP 7.4 compatibility restored – replaced str_starts_with() with strpos()
  • Fix: Deprecated mb_convert_encoding() replaced with mb_encode_numericentity()
  • Fix: Added ABSPATH security check to main plugin file
  • Tweak: Script versioning improved to prevent stale browser cache
  • Tweak: Tested with WordPress 7.0

0.4.2 – 2025-12-03

  • Tweak: WPBakery 8.7 tested
  • Tweak: Elementor 3.33 tested
  • Tweak: Tested with WordPress 6.9
  • Tweak: Updating compatibility information

0.4.1 – 2025-09-16

  • Tweak: Updating compatibility information

0.4.0 – 2025-05-02

  • New: Elementor support
  • Tweak: FAQ Info on Gutenberg usage

0.3.1 – 2025-04-30

  • Fix: Version reference

0.3.0 – 2025-04-30

  • New: Gutenberg support

0.2.4.1 – 2025-04-16

  • Modifica: testato con WordPress 6.8
  • Correzione: alcuni filtri venivano eseguiti senza un’azione esplicita sull’anteprima e l’articolo veniva salvato

0.2.4 – 2025-04-11

  • Nuovo: rimuovere le emoji
  • Modifica: altre ottimizzazioni JavaScript
  • Modifica: FAQ informazioni sulle emoji
  • Modifica: testato con WordPress 6.8-RC3
  • Modifica: l’errore JavaScript è ora traducibile
  • Modifica: link di donazione aggiornato

0.2.3.1 – 2025-04-01

  • Modifica: file JavaScript rinominato
  • Modifica: aggiunta data di aggiornamento nel changelog
  • Modifica: aggiunte informazioni sulla privacy GDPR nella descrizione

0.2.3 – 2025-03-28

  • Nuovo: UX – finalmente il tooltip nella barra degli strumenti TinyMCE è ora traducibile
  • Nuovo: UI – finalmente integrato il logo del plugin nella barra degli strumenti TinyMCE
  • Modifica: PHP per lo scambio del page builder nella propria cartella
  • Modifica: aggiornati gli screenshot
  • Rimosso: l’integrazione di Gutenberg necessita di ulteriori test
  • Modifica: testato con Divi 4.27.4 e WPBakery 8.3.1

0.2.2.1 – 2025-03-27

  • Correzione: il contenuto di alcuni elementi viene cancellato

0.2.2 – 2025-03-27

  • Nuovo: gli attributi align, height, bgcolor, border, cellspacing saranno rimossi
  • Nuovo: aggiunti elementi di tabella (table, tr, td, th)
  • Nuovo: aggiunti b, i agli elementi approvati
  • Nuovo: l’elemento abbr sarà rimosso
  • Correzione: alcuni attributi aria-* e data-* non venivano rimossi

0.2.1 – 2025-03-25

  • Nuovo: gli attributi data- saranno rimossi
  • Nuovo: gli elementi article, figure e picture saranno rimossi
  • Nuovo: gli attributi aria-setsize, aria-posinset, translate, dir saranno rimossi
  • Modifica: swap JavaScript nella propria cartella
  • Modifica: aggiunta la guida all’installazione

0.2.0 – 2025-03-20

  • Nuovo: supporto per WPBakery 8.3

0.1.1 – 2025-03-19

  • Modifica: testato con Gutenberg e il page builder Divi 4
  • Modifica: adattamenti linguistici

0.1.0 – 2025-03-19

  • Nuovo: la pulizia del copia e incolla è finalmente integrata nella barra degli strumenti TinyMCE

0.0.20 – 2025-03-18

  • Nuovo: icona e banner

0.0.19 – 2025-03-14

  • Nuovo: aggiunta eccezione blockquote

0.0.18 – 2025-03-12

  • Nuovo: gli attributi aria-hidden e title saranno rimossi
  • Modifica: alcuni adattamenti linguistici per una traduzione corretta

0.0.17 – 2025-03-12

  • Modifica: il pulsante è ora traducibile

0.0.16 – 2025-03-11

  • Nuovo: icona e banner per la Directory dei plugin di WordPress
  • Modifica: dopo l’accesso nella Directory dei plugin di WordPress, piccole correzioni delle informazioni
  • Nuovo: il plugin è ora regolarmente disponibile tramite WordPress