Here is one idea to strip link- and image tags from the post content (before you save it) by using the edit_post_content
filter and the wp_kses
function:
add_filter( 'edit_post_content', 'my_edit_post_content', 10, 1 );
function my_edit_post_content( $content ) {
if (!current_user_can('manage_options')) { // only strip for non-admins
global $allowedposttags;
$mytags = $allowedposttags;
unset($mytags['a']); // don't allow links
unset($mytags['img']); // don't allow images
$content = wp_kses($content, $mytags);
}
return $content;
}
where $allowedposttags
is defined here:
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/kses.php#L48
Related Posts:
- User-Specific Timezones? Hack? Plugin?
- Let readers suggest edits from the frontend
- Tag link suggestion plugin
- How to get all posts belongs to a user between a certain date
- Why the internal link get converted into a comment?
- .com creates automated link in post
- How to upload PDF from Front-End and post automatically?
- Add Filter to get_next_posts_link
- Get a submitted value from front end post form for single template
- How to block external download link access if visitor not referred from WP?
- custom user profiles like linktree fully customizable on the front end
- With W3 Total Cache when I publish a post it does not appear in the homepage. Only if i purge all cache [closed]
- Preview featured image using frontend post plugin
- How to add an image from web-link?
- Implement Autocomplete for a custom field on WordPress Plugin Frontend
- The problem with WordPress Importer
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- Cron job not firing
- Solutions to repost categories into multisite blogs?
- How to enable qTranslate languages tabs in custom plugin page
- How do I “get the next 10 posts after post_id == x”?
- New User Form – Custom Menu Page
- Hiding posts – WP Hide Post not working
- WordPress Central User Database
- SEO smart plugin not working for words ending with ä, ö, å
- Build a list of partners with Link, Logo and text
- How to add a full edit link to front-end editor?
- How to read individual user’s directory and display content to that specific user?
- submit posts by unregistered users in wordpress
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Is there an easy way to flag posts in the admin area?
- Show an image in my header.php
- finding whether request is for post, and post id
- Any built-in function to associate a post to category through a plugin?
- How to hide some section in WordPress under Post
- Display post lists in 2nd paragraph
- wp_set_auth_cookie causes 403 error in the wooCommerce checkout
- Can’t delete Draft Post [closed]
- Matching Chapters to a Custom posts [closed]
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- WordPress display breadcrumbs using Yoast plugin [closed]
- Outbound link autometic converted into linkdirect , and not opening
- Display by Category in Admin
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Two problems on my WordPress installation [closed]
- posts comments goes to trash
- Contributive page where people logged in can write
- WP Plugin for onpage link suggestions [closed]
- How can I copy all users to newly created site on a multisite network in WordPress?
- Excerpts on category page
- How to pull email and name from Flamingo plugin
- How to create restrict content to users (by user, not by role)
- Which widget to use for display category post with view more? [closed]
- Enable users to change change and add taxonomies of posts
- External RSS feed to WordPress Portfolio
- How can I change the meta_key for a particular piece of information?
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- ob_start() combined with wp_query
- Front end inline editing?
- Custom User meta field display
- Display wordpress post’s in popup?
- Unable to add TAB character to post?
- How to add subcategories to the blogroll?
- how to add text to posts from tags
- How to call plugin functions in a custom template
- Add category selection to custom post type (plugin)
- Add script into front from my plugin
- Redirect to another page using contact form 7? [closed]
- Fullscreen Video/GIF Intro
- edit_user_profile and show_user_profile are not firing inside a class
- Would Gutenberg be considered a PlugIn?
- pagination on data fetched using SQL query
- How to delete all trashed item in one-go
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- How to get the first post and second post in a wordpress blog?
- Is it possible to send blog posts via email to subscribers?
- Custom setup of wordpress comments that are displayed
- Is there any plugin which can paste a common content to my every post?
- Recent posts per category loop?
- ‘Organize Series Plugin’ as muti author feature
- How to create multiple users at once?
- Shortcode to update user meta
- Import Instagram post to WordPress blog post
- Multisite – maximum number of users with specific role
- Problem of encoding characters (apostrophes) in my posts publications
- AJAX on Front-End Button Click not working – Custom Plugin
- How to backup single post in wordpress [closed]
- How do I get the user ID of the user that was updated in WordPress?
- How to handle WordPress Plugin Front-end AJAX Call [duplicate]
- Understanding State in WordPress Multisites
- How to have sample page for each new register users in a membership website
- Front-end CSS Library for plugin [closed]
- How do I publish portfolio items with a future date?
- Specific way to allow WordPress users to view their current password? And edit it?
- In Woocommerce theme need to add custom external link [closed]
- wordpress content .php file in an iframe’s src in a wordpress post
- how can I query all wordpress users of a blog
- Making my plugin create a page?