Remove certain links from Meta

How do I remove Log in or Log out and WordPress.org from my META part of my wordpress blog. I use twenty eleven, if that is relevant. I’ve tried editing sidebar.php but seems nothing is being changed, I mean this part :

enter image description here

Read More
<aside id="meta" class="widget">
                    <h3 class="widget-title"><?php _e( 'Meta', 'twentyeleven' ); ?></h3>
                    <ul>
                        <?php wp_register(); ?>
                        <li><?php wp_loginout(); ?></li>
                        <?php wp_meta(); ?>
                    </ul>
                </aside> 

Tried removing <?php wp_meta(); ?> and/or <li><?php wp_loginout(); ?></li>, nothing happens.

Related posts

Leave a Reply

1 comment

  1. Since you asked for a PHP solution…

    Put this at the top of sidebar.php:

    <?php
    function _wpMeta($o){
      $links = 'Log in|Logout|WordPress.org';
      return preg_replace('#<li>.+?('.$links.').+?</li>#','',$o);
    }
    ob_start("_wpMeta");
    ?>
    

    And this at the bottom:

    <?php ob_end_flush(); ?>