Change WordPress Meta Widget
Posted by CodeMonkeyJun 5
Want to change your meta links contained in a WordPress sidebar widget?

If you are trying to edit the meta data that appears in the sidebar of your Wordpress blog, such as removing the RSS links, find this code in /includes/widget.php file and remove the unwanted lines.
This is what the original looks like:
/**
* Display meta widget.
*
* Displays log in/out, RSS feed links, etc.
*
* @since 2.2.0
*
* @param array $args Widget arguments.
*/
function wp_widget_meta($args) {
extract($args);
$options = get_option('widget_meta');
$title = empty($options['title']) ? __('Meta') : apply_filters('widget_title', $options['title']);
?>
<?php echo $before_widget; ?>
<?php echo $before_title . $title . $after_title; ?>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php echo attribute_escape(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php echo attribute_escape(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<li><a href="http://wordpress.org/" title="<?php echo attribute_escape(__('Powered by WordPress, state-of-the-art semantic personal publishing platform.')); ?>">WordPress.org</a></li>
<?php wp_meta(); ?>
</ul>
<?php echo $after_widget; ?>
<?php
}
And this is my modified one:
/**
* Display meta widget.
*
* Displays log in/out, RSS feed links, etc.
*
* @since 2.2.0
*
* @param array $args Widget arguments.
*/
function wp_widget_meta($args) {
extract($args);
$options = get_option('widget_meta');
$title = empty($options['title']) ? __('Meta') : apply_filters('widget_title', $options['title']);?>
<?php echo $before_widget; ?>
<?php echo $before_title . $title . $after_title; ?>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
<?php echo $after_widget; ?>
<?php
}
Tags: Tips & Tricks, WordPress


3 comments
Comment by joded
on July 3, 2009 at 6:50 am
Nice article
Comment by james
on July 19, 2009 at 6:10 am
Hi, thanks for the help, although, my widgets.php page looks a lot bigger than the one above and there is no code similar to the one you posted here in mine.
maybe my WP version is different. I am rockin version 2.8.1
Thanks
Comment by Agus Siswoyo
on January 28, 2010 at 2:08 pm
nice info and very helpfull…