Removing WordPress Version and Thank You Message From Admin Footer

Published by John on August 5, 2012 Under Wordpress

When you login and goto the admin dashboard in WordPress, the WordPress Version and a ‘Thank you for creating with WordPress.’ message is printed in the footer of the page.

Both of these messages are printed/created in the wp-admin/admin-footer.php file and can be easily removed by adding two filters to your functions.php file.

To Remove These Notifications, add the following to your functions.php file:


add_filter('admin_footer_text', kcr_remove_admin_footer_text, 1000);

function kcr_remove_admin_footer_text($footer_text =''){
	return '';	
}

add_filter('update_footer', kcr_remove_admin_footer_upgrade, 1000);

function kcr_remove_admin_footer_upgrade($footer_text =''){
	return '';	
}

**Note that if you just wanted to remove these items, you could just use a single function for both filters**

Using the above will simply remove the items all together, but you could also edit these to display different text or messages. I left them as separate functions for this tutorial, so you can modify them as necessary.

The How and Why

As with most of these sorts of modifications, the version is still visible to people easily by viewing source, so this should only be used as something for aesthetics for your end-users and not as a means of preventing attacks.

The admin_footer_text filter is used in admin-footer.php to process the “Thank you for creating with WordPress.” message in the left hand side of the wp-admin footer. The text is first set within the admin-footer file and then passed to the filter.

The update_footer filter is used in admin-footer.php to process the “Version 3.X.X” message on the bottom right of the wordpress dashboard. Unlike the above, the text here is set via the filter itself. As a result, you need to specify a priority after this has been set, hence the priority of ‘1000’.

The “add_filter” wordpress function is used, which takes the filter name(‘update_footer’ or ‘admin_footer_text’) and then the name of the function to use and the priority. WordPress uses filters to process and modify text, as well as other data, working through a list of functions that are added via add_filter. In this case, the priority is set very high, so that these filters can be reasonably assumed to be called last.


No Comments |

Add a Comment