How to remove unwanted formatting, like class=”MsoNormal”, in Joomla content

If a content administrator pastes text containing styling into the editor in Joomla, the formatting is kept as it is in the source (another web page or a Microsoft Office Word document for example). The general idea using a template on a website is that the template should control the looks of headers, paragraphs etc. By keeping the formatting on the pasted text, it will cause your website to have a variety of fonts, styles and sizes.

It can also be a problem when a content administrator receives text material for the website, it can be written in Microsoft Office Word, causing a paste to include unwanted formatting, like the class=”MsoNormal” (Mso = Microsoft Office formatting).

This solution removes all class and style tags from the content. This means the user will no longer be able to set a different font style or size on the content. So that will be entirely controlled by the template. However, if you as the super super admin, who knows what you are doing, need to be able to create content with class and style you can add an unfilterered group for your own account. Note that if your content then is being edited and saved by a filtered user, your classes and styles will be lost.

We assume for this example that all content administrators are Super Users.

  1. Go to System -> Global options -> Text filters
  2. For Super Users, select Filter type = My own blacklist
  3. In the column Filter tags enter span
  4. In the column Filter attributes enter class,style
  5. Click Save

If you need to be able to save unfiltered content for a user, such as yourself, do this:

  1. Go to Users -> Groups
  2. Click New to add a new group
  3. Name it Unfiltered and make it a subgroup to Super Users
  4. Click Save & Close
  5. Go to Users -> Users
  6. Click on the user you want to edit (presumbaly yourself)
  7. Click on the Groups tab
  8. Unselect Super Users and select Unfiltered (make sure it really is a subgroup to Super Users, otherwise you have just removed your accounts super users priviliges)
  9. Click Save & Close
  10. Go to System -> Global settings -> Text filters 
  11. Make sure the group Unfiltered has No filtering selected as Filter type
  12. Click Save


0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

two − 1 =