<?php
/*
Plugin Name: Exclude DIV in RSS
Plugin URI: http://wordpress.org/support/topic/88585
Description: Remove specified <div> element (defined by a class or id) from syndication feed content.
Version: R1
Author: Kaf Oseo
Author URI: http://szub.net
Copyright (c) 2006 Kaf Oseo (http://szub.net)
Exclude DIV in RSS is released under the GNU General Public
License (GPL) http://www.gnu.org/licenses/gpl.txt
This is a WordPress plugin (http://wordpress.org).
*/
function exclude_DIV_in_RSS($text) {
$class_id = "shoutout"; // change to your div's class or id value
if(is_feed())
$text = preg_replace("/<div.*(class|id)=(\"|')$class_id(\"|').*>.*<\/div>/smUi", '', $text);
return $text;
}
add_filter('the_content', 'exclude_DIV_in_RSS', 42);
add_filter('the_content_rss', 'exclude_DIV_in_RSS', 42);
add_filter('the_excerpt', 'exclude_DIV_in_RSS', 42);
add_filter('the_excerpt_rss', 'exclude_DIV_in_RSS', 42);
?>