How to White Label WordPress

Rick R. Duncan

Web Developer • Search Marketer

How to White Label WordPress

Jan 17, 2016 | WordPress

On every website I build including my own, I use the code below to white label WordPress. Why would you white label WordPress? Because it’s those little details that make a big difference in your finished product. Not to mention that while your client is inside of WordPress they will see your brand name and know who to contact should they need further assistance.

Who Is This Code For?

If you’re in the business of building WordPress websites you might want to white label WordPress before delivering it to your client. In this WordPress tutorial I’m going to cover 7 WordPress functions that you can use to brand/white label WordPress in order to provide a more polished look to your theme.

Learn From My Experience

I used to include all of this code into the child theme’s functions.php file. Then as luck would have it, WordPress made some dashboard changes in version 3.8 which broke portions of the code. I then had to go to multiple websites and make the fix.

Now, I use a functionality plugin and host the update portion on my own website. I simply install the plugin on every client website and when I need to make an update I do so and the client website gets the same plugin update notification like all the other plugins.

Warning – Please Read!

Even though my tutorials instruct you to add code snippets into your theme’s functions.php file, it’s generally best practice to use a functionality plugin. It will prevent you from getting a White Screen of Death should you mistype any of the Php code that follows.

1. How to Change the WordPress Login Logo

One of the coolest features when it comes to white labeling WordPress is the ability to customize the login screen.

In my example below I create an image sized 311px wide by 100px tall. I named the image login.png then uploaded it into my theme’s images folder. Next you simply copy the code below and paste it into your theme’s functions.php file to change the WordPress login logo.

1 <?php
2 //* Do NOT include the opening php tag
3
4 //* Login Screen: Change login logo
5 add_action( login_head, b3m_custom_login_logo );
6 function b3m_custom_login_logo() {
7 echo <style type=”text/css”>
8 h1 a { background-image:url(.get_stylesheet_directory_uri()./images/login.png) !important; background-size: 311px 100px !important;height: 100px !important; width: 311px !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
9 .login form { margin-top: 10px !important; }
10 </style>;
11 }

view raw
logo-login.php
hosted with ❤ by GitHub

2. How to Change WordPress Logo URL

Once you change the WordPress login logo you’ll also want to change the URL that you go to should you click on the logo. By default, the logo will send you to wordpress.org. In the code snippet below, you’ll now be sent to the homepage of your own website. Learn more about get_bloginfo() at Codex.

1 <?php
2 //* Do NOT include the opening php tag
3
4 //* Login Screen: Use your own URL for login logo link
5 add_filter( login_headerurl, b3m_url_login );
6 function b3m_url_login(){
7
8 return get_bloginfo( wpurl ); //This line keeps the link on current website instead of WordPress.org
9 }

3. How to Change WordPress Logo Hover Text

To change the text “Powered by WordPress” when you hover over the login logo you can copy the code below and place it into your theme’s functions.php file to make it happen.

1 <?php
2 //* Do NOT include the opening php tag
3
4 //* Login Screen: Change login logo hover text
5 add_filter( login_headertitle, b3m_login_logo_url_title );
6 function b3m_login_logo_url_title() {
7
8 return REPLACE THIS WITH YOUR TEXT;
9
10 }

4. How to Cure the Forgetfulness of WordPress

Raise your hand if you get annoyed that WordPress will not keep the check mark in the ‘remember me’ check box. The code snippet below will keep it checked.

1 <?php
2 //* Do NOT include the opening php tag
3
4 //* Login Screen: Set ‘remember me’ to be checked
5 add_action( init, b3m_login_checked_remember_me );
6 function b3m_login_checked_remember_me() {
7
8 add_filter( login_footer, b3m_rememberme_checked )
9 ;
10 }
11
12 function b3m_rememberme_checked() {
13
14 echo <script>document.getElementById(‘rememberme’).checked = true;</script>;
15
16 }

view raw
wp-remember-me.php
hosted with ❤ by GitHub

5. Keeping WordPress Login Credentials Vague

By default when you login incorrectly, WordPress tells you which piece of information is incorrect. Now a hacker knows 50% of the information needed to get into your WordPress account. Stop that from happening by pasting the code below into your theme’s functions.php file.

1 <?php
2 //* Do NOT include the opening php tag
3
4 //* Login Screen: Don’t inform user which piece of credential was incorrect
5 add_filter ( login_errors, b3m_failed_login );
6 function b3m_failed_login () {
7
8 return The login information you have entered is incorrect. Please try again.;
9
10 }

view raw
wp-failed-login.php
hosted with ❤ by GitHub

OK. I realize that item #5 wasn’t really a function for white labeling WordPress, but I thought it to be a relevant function that should be included when branding a WordPress website for clients.

6. Modify the Admin Footer

The text that reads ‘Thank you for creating with WordPress’ can also be customized. Again, simply grab the code below and paste it into your theme’s functions.php file.

1 <?php
2 //* Do NOT include the opening php tag
3
4 //* Modify the admin footer text
5 add_filter( admin_footer_text, b3m_modify_footer_admin );
6 function b3m_modify_footer_admin () {
7
8 echo <span id=”footer-thankyou”>Theme Development by <a href=”http://rickrduncan.com” target=”_blank”>Rick R. Duncan</a></span>;
9
10 }

7. Custom Widget in Admin Dashboard

Once you deliver your finished product it’s nice when the user can log into WordPress and see your contact information in case they need to get in touch with you.

1 <?php
2 //* Do NOT include the opening php tag
3
4 //* Add theme info box into WordPress Dashboard
5 add_action(wp_dashboard_setup, b3m_add_dashboard_widgets );
6 function b3m_add_dashboard_widgets() {
7
8 wp_add_dashboard_widget(wp_dashboard_widget, Theme Details, b3m_theme_info);
9
10 }
11
12
13 function b3m_theme_info() {
14
15 echo <ul>
16 <li><strong>Developed By:</strong> B3Marketing, LLC</li>
17 <li><strong>Website:</strong> <a href=’http://rickrduncan.com’>www.rickrduncan.com</a></li>
18 <li><strong>Contact:</strong> <a href=’mailto:[email protected]’>[email protected]</a></li>
19 </ul>;
20
21 }

Conclusion

So that’s what I use to white label WordPress before delivering my final product to the client. How about you? Do you do something similar or are you using a plugin that does this and more?

The article How to White Label WordPress appeared first on RickRDuncan.com. It was published on January 15, 2016 and was last updated January 17, 2016.

About Rick R. Duncan

I’ve been working in web development since 1996 and specializing as a WordPress Developer since 2007. Contact me to schedule a risk free consultation for your web development or search marketing needs.

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment

Name *

Email *

Website

Sitemap

© 2016 Rick R. Duncan