Sunday, April 14, 2013

Remove Version Number from Wordpress

By default WordPress displays version number publicly on your Website. But sometimes this might be a security risk for WordPress site. Hackers can easily identify the WordPress version. To prevent this, just remove WordPress version from the site.

Just add the following function in function.php to remove the version number.


function remove_wp_version() {
return '';
}

add_filter('the_generator', 'remove_wp_version');

Change WP Login Logo and URL using function.php

To replace wordpress default login logo with a custom one, just add following function in function.php



function wp_custom_login_logo() {
    echo '<style type="text/css">
        h1 a { background-image:url('.get_bloginfo('template_directory').'/images/your-logo.png) !important; }
    </style>';
}

add_action('login_head', 'wp_custom_login_logo');

To customize wordpress login url, add following function in function.php


function wp_custom_login_url() {
  return site_url();
}

add_filter( 'login_headerurl', 'my_custom_login_url', 10, 4 );