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?
- WP_User_Query and non-unique usermeta data
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- WordPress: How to get the current logged in author page URL?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Get the last post ID
- Enable comments for post with comments meta box removed
- Unique post-id for WordPress Multisite Network
- plugin for wp_list_categories with posts
- Adding “ ” before the last word in multiple defined areas with a plugin
- How to change ID of an attachment in wp_posts and its related tables correctly?
- How to show popup to a group of users?
- CKEditor: Uncaught TypeError: switchEditors.switchto is not a functiononclick
- update_user_meta add value on the top on existing value
- Execute a plugin only on post pages
- Cron job not firing
- How do I “get the next 10 posts after post_id == x”?
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Can’t delete Draft Post [closed]
- Display by Category in Admin
- WP Plugin for onpage link suggestions [closed]
- Custom User meta field display
- Redirect to another page using contact form 7? [closed]
- edit_user_profile and show_user_profile are not firing inside a class
- 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?
- Import Instagram post to WordPress blog post
- Specific way to allow WordPress users to view their current password? And edit it?
- In Woocommerce theme need to add custom external link [closed]
- Making my plugin create a page?
- Any idea how to get something like this to work? [closed]
- How can I automatically download all images from all imported posts, place them on my new host, and replace all the links
- check uncategorized category by default
- how to make dynamic subdomain for each user registering?
- Article content navigator in wordpress like mbaskool website
- Getting a list of the published posts
- If post exists in the database – each time goes on `else`
- What hook can I use to modify custom post data before it is displayed on the page?
- get current page number with wp_link_pages()
- How can i summerize posts or news automatically in word press site?
- Delete data from custom table when deleting a post
- Plugin is creating posts twice
- WordPress plugin for Limited days user
- How to write a new file when new post has been published in WordPress
- How to Get Recent 5 post in My Title bar?
- Plugin for visitors to edit content without logging in? [closed]
- WP Insert Post If user refreshes override new post
- Summary and Comments on Main landing Page
- Method/Plugin/Hack to Start a Post with an Writing Outline?
- Is it possible to pin a post in second position from top
- Oops! That page can’t be found
- page duplication on wordpress that wont stop
- WordPress is redirecting me to homepage
- Adding custom post category to categories widget
- How to implement data residency in my WordPress site
- Clean old users
- How can I see $post object in frontend from functions.php?
- Allow members to create groups on my site
- WordPress User profile with Avatar upload on the front end without plugin?
- WordPress website working fine on localhost but not displaying front pages on webhost
- Unset plugins on front-end belonging to specific category
- Simulate Update User button click
- How to wrap image tag into div for post only?
- Update User Meta Via Ajax
- User Following System
- What action or filter can I use to change all the html returned from server for a page?
- User Affiliate Token Generator?
- My own metabox checkbox plugin only saves the last value I’ve checked
- How to prevent authors from editing their post count?
- Every time I use wp_get_current_user() my plugin breaks
- How to add featured image on front end form?
- How to use shortcode of any plugin to show it visually where i want?
- WordPress not updating post or disable plugin instead a white page appear
- Ger posts from similar tags and categories
- Internationalization of Blog Posts
- single.php fires more than once after clicking on any post to view with different post id each time
- Twitter List Tweets and Delicious Links as Posts
- Custom feed parameters / Template overriding
- How to make only selected posts appear on a selected wordpress page
- Notifications Bar on home page only
- Distribute post content through several divs [closed]
- Does anyone have the Custom Post Permalinks plugin from John P. Bloch? [closed]
- How to get an error message if a form is empty (plugin: Post for site) [closed]
- how to embed a crop feature for cropping images uploaded by the user
- Is there a plugin or another way that can help me find out the underlying files of a page/post? [closed]
- How to update a lot of posts on my WP site with additional content?
- Display Any Field fromAdmin Panel in Frontend via Shortcode?
- Show the author only own types of publications. (JetEngine, Elementor)
- How to add entity in WordPress that have metadata such as name, age