Enable unfiltered HTML in WordPress

WordPress has a security feature that disables the use of certain code and attributes in text fields. This is to prevent Cross Site Scripting (XSS) attacks with malicious code. This also means that some types of adverts can not be created right from the get-go because the code is filtered out.

To disable this filter you can allow Editors, Administrators and Super Admins to use ‘Unfiltered HTML’. Using a Role Manager plugin you can assign this permission to other users as well, but this is not recommended.

Check if the Unfiltered HTML permission is already set

To see if your users are allowed to use unfiltered HTML you can simply take a look at Settings > Maintenance, look for the Unfiltered HTML heading and see what it says there.

Setting up the Unfiltered HTML Permission

Caution: This is a manual edit to your wp-config.php file. Making typos or mistakes in this file may cause your site to fail! If it does, simply undo the change.

Here’s how to add the DISALLOW_UNFILTERED_HTML definition to your site. This is a boolean (true/false) value.

  • Login to your site via (s)FTP and look in the root/base directory of your site.
  • Download the wp-config.php file to your desktop.
  • Edit the file with your favourite Editor – I use Coda 2.
  • Somewhere below Line 52 add define('DISALLOW_UNFILTERED_HTML', false); on a new line.
  • Save and upload the wp-config.php file overwriting the current online version.

For my version of wp-config.php the first best spot is on line 58. Right below the WordPress security salts and the W3TC hash. Something like you see in the screenshot below.

Article Details

Article ID:
43
Category:
Rating :

Related articles

More plugins and services

AdRotate Pro Single License
AdRotate Professional
Banner manager

Get started with successful advertisement campaigns on your WordPress and Classicpress website within minutes. Use features like Geo Targeting, scheduling and post injection to start making that passive income!
AJdG Solutions Plugins
All my plugins
WordPress and Classicpress

Check out my handy plugins for WordPress and Classicpress. Also take a look at these extensions for WooCommerce and bbPress and run your webshop and forum more efficiently!