Disable HTML tags in post body


I let my users create posts using a form (advanced post creation add on).

I don’t want them to be able to add links to the post body by using (a href) tags or adding images by using (img) tags.

How can that be done?


I used the Advanced Post Creation add-on to create a post, as a visitor to the site, not logged in, and when I submitted my HTML markup (link and img tag) it is not rendered as HTML. This is how it looks once submitted:


The same thing happened when I submitted logged in as an editor:


What are you seeing when creating the post with the Advanced Post Creation add-on that you would like to stop?

For me it didn’t work. I tried the following:

<img src="someimage.jpg">

and I got the image embedded in the page.

This is how I solved it eventually:

add_filter( 'gform_allowable_tags_2', 'allow_basic_tags' );

function allow_basic_tags( $allowable_tags ) {

    return '<p><strong><em><b><i><table><tbody><td><th><tr><u><ul><span>';


OK, thank you for the update :slight_smile: