Penn's Blog
-
JCE editor keeps removing AdSense and HTML in Joomla!
I use Joomla! 1.5 for all my websites and I really really love it, I would never go back to using a website editor such as Dreamweaver, using Joomla! is so easy once you get your head around how to use it, it really is a fantastic content management system.
I have had a problem that has been bugging me for quite a long time. I first noticed it happening when I first started using Google AdSense on my website. Google AdSense uses a JavaScript to insert it advert on your website. The problem I was having was when I used an editor such as JCE to write my articles, when I inserted the AdSense code, on save, the editor would strip the JavaScript out of the page completely, in other words you couldn't get your AdSense adverts to stay unless you completely disabled the editor. Now there's nothing wrong with not using an editor, as long as you know how to write using HTML, you can get around that quite easily, however using an enter means you can get the layout just right, it also takes a lot less time than if you are actually writing the HTML manually.
Anyway, to cut a long story short I installed a brand-new version of JCE last night, bought a subscription so I could gain access to their forum and low and behold, I have now found a solution to my problem, and here it is, I hope that it helps you as much as it helped me.
The first thing to do is make a small adjustment in the article section of your Joomla! website in the backend. You may not need to do this so maybe follow step 2 first and then if your HTML/JavaScript still keeps getting stripped, try this. However, it didn't hurt for me to do this first anyway.
Changing the Article Global Configuration
If the default filtering option is not suitable for your needs, you can change it by using the Article Global Configuration options. For example, to change the default settings so that no filtering happens for members of the Super Administrator group:
- Navigate to Content → Article Manager.
- Press the Parameters icon in the toolbar to show the Articles - Global Configuration screen.
- Scroll down to Filtering Options, highlight all Filter groups except Super Administrator, and select Filter type of Blacklist (Default), as shown in the screenshot below.

Now this is the important part, this is what will stop your HTML/JavaScript from being removed from your article when you click save.
Go to components > JCE administrator > profiles > Default (top of the list) > Editor Parameters > Options > Allow JavaScript (make sure this is set to yes)
I hope this works for you, it did for me and has saved me one hell of a lot of work in the long running.









