Title: editor trimming HTML
Last modified: June 13, 2018

---

# editor trimming HTML

 *  Resolved [Daniel](https://wordpress.org/support/users/damen02/)
 * (@damen02)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/editor-trimming-html/)
 * Hi guys. Awesome plugin! thanks for doing it.
 * I’m having some trimming on your content editor, in HTML mode.
    I need to publish
   an audio player, and works fine. But I need to avoid the download button. I found
   how to solve it, and works fine on normal WP pages and posts. But for some reason
   the code on your editor is being trimmed.
 * Here is the code that works on pages:
 *     ```
       <audio controls controlsList="nodownload">
         <source src="xxx.mp3"" type="audio/mpeg">
       </audio>
       ```
   
 * On your editor, after saving I get only this:
 *     ```
       <audio controls>
       </audio>
       ```
   
 * Any suggestion? Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [NiteoThemes](https://wordpress.org/support/users/niteo/)
 * (@niteo)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/editor-trimming-html/#post-10398679)
 * Howdy Daniel, hmm you are right – same thing happens on my development server.
 * I played with the post HTML sanitation for a while, but I am unable to make it
   work, it always strips the custom tags even when I specifically allow them.
 * Please hold on a little, I asked around on WordPress plugin development slack
   channel and I am eagerly waiting for a help or hint:)
 * Anyway if I am able to make it work, it would have to wait for next update release,
   which is planned for someday in next week.
 * Alex
 *  Plugin Author [NiteoThemes](https://wordpress.org/support/users/niteo/)
 * (@niteo)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/editor-trimming-html/#post-10399263)
 * OK, found the solution – I can make it to next update (about a week more or less).
 * Or if you know how to edit plugin files, I can send you a code snippet what to
   change.
 * Alex
 *  Thread Starter [Daniel](https://wordpress.org/support/users/damen02/)
 * (@damen02)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/editor-trimming-html/#post-10406935)
 * Hi Alex
    Thanks for your answers, and apologize for my delay. I know how to edit
   plugin files, if you tell me what file to edit, it will be great! We are on launching
   countdown 🙂
 *  Plugin Author [NiteoThemes](https://wordpress.org/support/users/niteo/)
 * (@niteo)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/editor-trimming-html/#post-10407004)
 * No problem 🙂
 * Find and edit niteo-cmp.php file in plugin’s folder and search for “niteo_sanitize_html”
   function.
 * replace:
 *     ```
       public function niteo_sanitize_html( $html ) {
       	global $allowedposttags;
       	return wp_kses( $html, $allowedposttags );
       }
       ```
   
 * with:
 *     ```
       public function niteo_sanitize_html( $html ) {
   
       	if ( !current_user_can( 'unfiltered_html' ) ) {
              	$allowed = wp_kses_allowed_html( 'post' );
              	$html = wp_kses( $html, $allowed );
           }
   
           return $html;
       }
       ```
   
 * this should do a trick – you must be logged in as administrator or editor to 
   allows unfiltered HTML in editor 🙂
 * Also I will include this change in next update so feel free to update CMP plugin
   to latest version anytime.
 * Alex
    -  This reply was modified 8 years, 1 month ago by [NiteoThemes](https://wordpress.org/support/users/niteo/).
 *  Thread Starter [Daniel](https://wordpress.org/support/users/damen02/)
 * (@damen02)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/editor-trimming-html/#post-10407510)
 * Thanks Alex. I will test the code and let you know.
 *  Plugin Author [NiteoThemes](https://wordpress.org/support/users/niteo/)
 * (@niteo)
 * [8 years ago](https://wordpress.org/support/topic/editor-trimming-html/#post-10419678)
 * Resolved in 2.7 update

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘editor trimming HTML’ is closed to new replies.

 * ![](https://ps.w.org/cmp-coming-soon-maintenance/assets/icon-256x256.png?rev=
   2393184)
 * [CMP - Coming Soon & Maintenance Plugin by NiteoThemes](https://wordpress.org/plugins/cmp-coming-soon-maintenance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmp-coming-soon-maintenance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/)
 * [Active Topics](https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [NiteoThemes](https://wordpress.org/support/users/niteo/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/editor-trimming-html/#post-10419678)
 * Status: resolved