Make WordPress Core

Ticket #18465: nofollow.patch

File nofollow.patch, 1.4 KB (added by neoxx, 13 years ago)

Reduce links to wp-login.php by rel="nofollow"

  • general-template.php

     
    184184 */
    185185function wp_loginout($redirect = '', $echo = true) {
    186186        if ( ! is_user_logged_in() )
    187                 $link = '<a href="' . esc_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>';
     187                $link = '<a rel="nofollow" href="' . esc_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>';
    188188        else
    189                 $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
     189                $link = '<a rel="nofollow" href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
    190190
    191191        if ( $echo )
    192192                echo apply_filters('loginout', $link);
     
    333333
    334334        if ( ! is_user_logged_in() ) {
    335335                if ( get_option('users_can_register') )
    336                         $link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;
     336                        $link = $before . '<a rel="nofollow" href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;
    337337                else
    338338                        $link = '';
    339339        } else {
    340                 $link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;
     340                $link = $before . '<a rel="nofollow" href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;
    341341        }
    342342
    343343        if ( $echo )