Disable html in custom post types

My webstie have custom post type created, and now I want to disable usage of any html tag in content editor, so only plain text is saved in database (and to remove content editor and html editor if possible).

I found functions to remove (rich) content editor:

add_filter('user_can_richedit' , create_function('' , 'return false;') , 50);

And HTML editor remained. But even if I maange to remove HTML editor (this: http://prntscr.com/26uj6u ), users will be able to just type html tags and they will be saved in database.

Can someone help me with this?

Topic allowedtags wp-editor html-editor visual-editor Wordpress

Category Web


You can restrict the use of tags with Java-script. Before the comment being saved to the database you can trigger an on change event and check the comment text( which is basically a string) for keywords like html using functions like indexOf. Based on the result of the check you can then force the user to comment without using html.

Need help with the code? If not, please share your final solution.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.