How to enable 'unfiltered_html'?

  1. Home
  2. Docs
  3. How to’s
  4. How to enable 'unfiltered_html'?

How to enable 'unfiltered_html'?

Due to the growing number of XSS vulnerabilities in WordPress, we restrict access to the editor for user roles without 'unfiltered_html' capability.

The capability is enabled by default for Super admin, Admin, and Editor.

If you wish to use Visual Composer by other user roles, make sure to enable 'unfiltered_html' capability for a specific user.

Also you can implement it by adding this code in theme functions.php:

function author_level_up() {
    // Retrieve the  Author role.
    $role = get_role('author');
    $role->add_cap('unfiltered_html');
}
add_action( 'admin_init', 'author_level_up');

Additionally, to control 'unfiltered_html' capability, you can use User Role Editor plugin.

Note: If you are a Contributor, Author, or another non-admin or editor user of the site. Please contact your site administrator.

Was this article helpful to you? No Yes 1

How can we help?