Disable HTML tags in post body

Hello,

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?

Thanks.

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:

[SITE REMOVED]

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

[SITE REMOVED]

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: