Remove ‘Powered by WordPress’ from Login Screen Easily
Explanation
If you're looking to tidy up your WordPress login screen by removing the "Powered by WordPress" text and logo, here's a simple way to do it.
- Hide "Powered by WordPress": The code uses a bit of CSS to hide the "Powered by WordPress" text. This is done by setting the display property to none for specific elements on the login page.
- Remove WordPress Logo: Similarly, the WordPress logo is hidden by targeting the logo element and setting its display to none.
- Change Logo URL: By default, clicking the WordPress logo on the login page takes you to WordPress.org. This code changes the URL to your site's homepage instead.
- Customize Logo Title: When you hover over the logo, a tooltip appears. This code changes the text of that tooltip to your site's name.
These tweaks help make your login page look more professional and personalized without any WordPress branding. Just add this code to your theme's functions.php file, and you're good to go!
Code
<?php
// Function to remove 'Powered by WordPress' from the login screen
function wp_dudecom_remove_powered_by_wordpress() {
?>
<style type="text/css">
/* Hide the 'Powered by WordPress' text on the login page */
.login #backtoblog, .login #nav {
display: none;
}
</style>
<?php
}
add_action('login_enqueue_scripts', 'wp_dudecom_remove_powered_by_wordpress');
// Function to remove the WordPress logo from the login page
function wp_dudecom_remove_wordpress_logo() {
?>
<style type="text/css">
/* Hide the WordPress logo on the login page */
.login h1 a {
display: none;
}
</style>
<?php
}
add_action('login_enqueue_scripts', 'wp_dudecom_remove_wordpress_logo');
// Function to change the URL of the WordPress logo on the login page
function wp_dudecom_custom_login_logo_url() {
return home_url();
}
add_filter('login_headerurl', 'wp_dudecom_custom_login_logo_url');
// Function to change the title attribute of the WordPress logo on the login page
function wp_dudecom_custom_login_logo_url_title() {
return 'Your Site Name';
}
add_filter('login_headertext', 'wp_dudecom_custom_login_logo_url_title');
?>
Instructions
To remove the 'Powered by WordPress' text and logo from the login screen, follow these steps:
File Location: Add the code to your theme's functions.php
file.
Prerequisites: Ensure you have access to your WordPress theme files, either via the WordPress admin dashboard or through FTP.
Implementation Steps:
- Access Your Theme Files:
- Log in to your WordPress admin dashboard.
- Navigate to Appearance > Theme Editor.
- In the right sidebar, find and click on
functions.php
.
- Add the Code:
- Scroll to the bottom of the
functions.php
file. - Copy and paste the provided code snippet into the file.
- Scroll to the bottom of the
- Save Changes:
- Click the Update File button to save your changes.
- Verify Changes:
- Log out of your WordPress admin dashboard.
- Visit the login page to ensure the 'Powered by WordPress' text and logo are removed.
These steps will help you customize your WordPress login page, making it look more professional and aligned with your brand. If you need further assistance or want to explore more advanced customizations, consider reaching out to wp-dude.com for expert help.