WordPress.org

Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Safe Paste

Removes a lot of HTML tags from post and page content before inserting it to database. Preventing users to paste undesired HTML tags to content.

Will this plugin works in WordPress older than 3.x?

Maybe... But the question is... WTF are you using anything older than that?

I would like to customize the allowed tags and protocols

Starting from Safe Paster 1.1.7 you can use the filters safepaste_allowed_tags and safepaste_allowed_protocols to add a snippet to your theme functions.php file (or create a child theme).

The format used to pass the tags and protocols is the same that uses the wp_kses() function.

Examples:

add_filter( 'safepaste_allowed_tags', 'my_custom_tags');

function my_custom_tags( $allowed_tags ) {

//Add ftp to allowed protocols
$allowed_tags['b'] = array();

return $allowed_tags;

}

add_filter( 'safepaste_allowed_protocols', 'my_custom_protocols');

function my_custom_protocols( $allowed_protocols ) {

//Add ftp to allowed protocols
$allowed_protocols[] = 'ftp';

return $allowed_protocols;

}

I want Safe Paste to take care also of my custom post type

By default only 'post' and 'page' post types are filterd by Safe Paste. But you can use the safepaste_post_types filter to set modify this.

Example:

add_filter( 'safepaste_post_types', 'my_custom_post_types');

function my_custom_types( $types_to_filter ) {

//Add book post type
$types_to_filter[] = 'book';

return $types_to_filter

}

Requires: 3.0 or higher
Compatible up to: 4.4.5
Last Updated: 9 months ago
Active Installs: 100+

Ratings

5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2 100,1,1
100,1,1