Skip to main content

Joomla Configuration

Code is automatically deleted

After adding custom HTML code in an article or module, you might 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 various filter options regarding the HTML code for members of a certain user group. These filter options allow more control over the HTML that is added. Filtering is opt-in based 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

Banned allows all tags and attributes except those listed.

The default forbidden list includes the following tags:
"applet", "body", "bgsound", "base", "basefont", "canvas", "embed", "frame", "frameset", "head", "html", "id", "iframe", "ilayer", "layer", "link", "meta", "name", "object", "script", "style", "title", "xml

The default forbidden list includes the following attributes:
'action', 'background', 'codebase', 'dynsrc', 'lowsrc', 'formaction'

The forbidden list can be completed by adding tags and attributes via the Filter tags and Filter attributes fields. Separate tag or attribute names by a comma.

A custom banned list overrides the default banned list. Add the unwanted tags and attributes via the Filter tags and Filter attributes fields.

The allowed list allows only the tags and attributes listed in the Filter tags and Filter attributes fields.

Choosing 'No HTML' removes all HTML tags from the content after it has been saved.

Recall that these settings are always in effect no matter which text editor is used.
Even when using a WYSIWYG text editor, the filter settings may remove additional tags and attributes before the data is stored 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 an editor when you belong to this administrator group. For each user group, select the appropriate option from the list next to the group name and then click the Save button.

Code is removed from the JCE Editor

If you use 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 to "Media Support" and check that the elements you want to use are set to "Yes".

Tekstfilters JCE

Code is removed from the TinyMCE Editor

If you use a text editor in the administrator 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 need 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 like "empty" or something similar.

Iframes become i-frames by RSFirewall

If you are using RS Firewall, 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

Jeroen Moolenschot

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!

Popular articles

Redirecting an old URL to a new URL in Joomla

Sometimes, some of your valuable links may lead to the 404 page. This usually happens when the alia…

Disable Joomla Update Notification email

Joomla has a plugin by default that emails every administrator with superuser privileges when a Joo…

Preventing spam in Joomla with Captcha

Nothing is more annoying than a mailbox full of spam responses or fake requests via your contact fo…

Hiding a menu item

In some cases, it is desirable to link to another article. This is not always possible without affe…

Blocking an IP address on your Joomla website

It is, of course, possible to deny a particular IP address access to your Joomla website. Reason…

Joomla GDPR settings

25 May 2018, the GDPR came into force. Probably your mailbox has also been flooded with privacy pol…