Skip to main content

Code is automatically deleted

After adding custom HTML code in an article or module, you may find that the HTML code has been removed, when the item is saved. This problem occurs with scripts (for example, when trying to add Google Adsense) or with iframe and embed tags (for example, with YouTube videos).

Why is the code removed from the editor?

In the Joomla configuration, you can define several filter options regarding the HTML code for members of a certain user group. These filter options allow more control over the HTML being added. Filtering is done on an opt-in basis and the default settings provide good protection against markup usually associated with website attacks.

Text filters in Joomla

These are the text filters applied to all text processing fields in the selected groups.

First of all, check which filter type is assigned to your user group.Go to"System > General Settings > Text Filters" and you will see this page:


Tekstfilters

Forbidden List allows all tags and attributes except for those listed.

Tags for the Default Forbidden List include:
'applet', 'body', 'bgsound', 'base', 'basefont', 'canvas', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml'

Attributes for the Default Forbidden List include:
'action', 'background', 'codebase', 'dynsrc', 'lowsrc', 'formaction'

You can forbid additional tags and attributes by adding to the Filter Tags and Filter Attributes fields, separating each tag or attribute name with a comma.

Custom Forbidden List allows you to override the Default Forbidden List. Add the tags and attributes to be forbidden in the Filter Tags and Filter Attributes fields.

Allowed List allows only the tags listed in the Filter Tags and Filter Attributes fields.

No HTML removes all HTML tags from the content when it is saved.

Please note that these settings work regardless of the editor that you are using.
Even if you are using a WYSIWYG editor, the filtering settings may strip additional tags and attributes prior to saving information in the database.

Make sure the super users and administrator group are set to No filter. This means that Joomla will not remove code from a the editor when you belong to this administrator group. For each user group, select the appropriate option from the list next to the group name, then click the Save button.

Code is removed from the JCE Editor

When using a text editor in the administrator area, you may need to change the settings to display all desired HTML tags. The most commonly used editor in Joomla is JCE.

Go to Components > JCE Editor (PRO) > Editor Profiles and choose the appropriate profile assigned to the user group, often Default.

At the top, go to the "Plugin Parameters" tab and then on the left side to "Media Support" and make sure the elements you want to use are set to "Yes."

Tekstfilters JCE

 

 

Code is removed from the TinyMCE Editor

When using a text editor in the admin area, you may need to change the settings to display all the HTML tags you want. The default editor in Joomla is TinyMCE.

Go to System > Plugins > Text Editor - TinyMCE and choose the appropriate Set assigned to the user group.

Tekstfilters tinyMCE set

You will see these plugin parameters

Tekstfilters tinyMCE

You have to remove the HTML tags from the list of forbidden elements. Do not leave this field blank, as this will restore the default tags after saving. If you don't want to ban any element, enter a dummy text such as "empty" or something similar.

 

Iframes becomes i-frames by RSFirewall

If you are using RS Firewall then the code of an iframe may be modified. Read how to fix this here:

https://www.rsjoomla.com/support/documentation/rsfirewall-user-guide/frequently-asked-questions/scrambled-tags-iframe-becomes-i-frame.html

Was this helpful? Share it with your friends!
This article was updated on: 24 May 2025

About Jeroen

I have been working with the Joomla! CMS since 2006. Besides building and maintaining Joomla! websites and webshops, I am also familiar with search engine optimization (SEO), Joomla hosting and developing templates and extensions. Furthermore, I am a frequent visitor and speaker at JoomlaDays and various Joomla user groups.

I am committed to the Joomla! community as a member of the Extensions Directory team and the organization of Joomla user group Breda and JoomlaDagen Netherlands. In short: Are you looking for a Joomla Specialist, you should contact me!