{"id":29226,"date":"2021-09-04T17:00:21","date_gmt":"2021-09-04T15:00:21","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=29226"},"modified":"2021-09-03T12:23:27","modified_gmt":"2021-09-03T10:23:27","slug":"how-to-customize-wordpress-admin-panel-footer","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/how-to-customize-wordpress-admin-panel-footer\/","title":{"rendered":"How to Customize the Admin Panel Footer in WordPress"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]Besides coding the functionalities of their themes or plugins, developers also need to think about expanding their outreach and branding their content. While this can be done in a lot of ways, including creating customized landing websites and using social media, there is one simple thing that is often overlooked. And that is the fact that theme and plugin authors can customize the footer within the WordPress Admin panel.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Default-Admin-Footer-Labels.jpg\" class=\"attachment-full size-full\" alt=\"Default Admin Footer Labels\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Default-Admin-Footer-Labels.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Default-Admin-Footer-Labels-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Default-Admin-Footer-Labels-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Default-Admin-Footer-Labels-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Instead of the default admin footer labels, shown above, developers can include valuable links and messages specific to their content.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Fortunately, achieving this is simpler than it might seem at first glance, and we will be showing you how to do it in this article. Before we dive in, you should bear in mind that this process relies on the use of <a href=\"https:\/\/developer.wordpress.org\/plugins\/hooks\/\" target=\"_blank\" rel=\"noopener\">WordPress hooks<\/a>. We will take care to cover them in-depth, so this article can prove interesting for any WordPress users interested in learning more about hooks. Given that they are one of the most important advanced WordPress concepts this will be a useful way for anyone to expand knowledge.[\/vc_column_text][vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-top-picks-banner&#8221;][vc_empty_space height=&#8221;80px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Before we start<\/h2>\n<p>[\/vc_column_text][vc_column_text]Whether you\u2019d like to customize your WordPress admin panel footer as part of your promotion efforts or for some other reason entirely, you\u2019ve come to the right place. We have separated this article into two sections, which will let us cover all you need to know about this topic. The first section will provide an in-depth overview of WordPress hooks and the second will showcase the custom snippets that utilize specific filter hooks. Let\u2019s begin!<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\">Understanding WordPress hooks<\/h3>\n<p>[\/vc_column_text][vc_column_text]Simply put, WordPress hooks represent small code placeholders that developers have left inside the files. By \u201chooking\u201d custom functions onto these placeholders, you can add a custom functionality to your website or edit an existing one. The great thing about hooks is that, by using them, you don\u2019t have to directly edit any existing WordPress template files or your theme and plugin files. This lets you avoid the risk of losing your modifications when the theme, plugins, or WordPress core get updated.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]By \u201chooking\u201d your code onto the appropriate hook, you will achieve the same functionality as if the code you created was placed in the same spot as the hook. And, you can easily keep track of all your code, as it\u2019s recommended practice to place it either in the functions.php file of your child theme or <a href=\"https:\/\/qodeinteractive.com\/magazine\/wordpress-site-specific-plugin\/\">a site-specific plugin<\/a>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]There are <strong>two types of WordPress hooks. Action hooks<\/strong>, or actions, are used for adding new functionalities or features. <strong>Filter hooks<\/strong>, or filters, are used to alter existing functionalities. Let\u2019s examine what makes them different.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>First, actions can have input parameters, whereas filters must have them.<\/strong> Actions can perform some operations on their input but they don\u2019t need to return the altered value, only echo or print some output. On the other hand, filters return the altered value of the input after performing operations on it. Then the altered value, which is returned as the output, is used in the code.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]There are also differences between the two types of hooks in the way they are put as placeholders in the code, as well as how you need to \u201chook onto\u201d them. <strong>The action hooks are placed inside template files using the <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/do_action\/\" target=\"_blank\" rel=\"noopener\">do_action()<\/a> function, while filter hooks use the <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/apply_filters\/\" target=\"_blank\" rel=\"noopener\">apply_filters()<\/a> function.<\/strong> These functions are responsible for the placement of the hook and the execution of any function \u201chooked onto\u201d it.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]As for how \u201chooking onto\u201d works, you will first need to create a custom function, called a callback function or simply callback. Then, you will need to use the <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/add_action\/\" target=\"_blank\" rel=\"noopener\">add_action()<\/a> function or the <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/add_filter\/\" target=\"_blank\" rel=\"noopener\">add_filter()<\/a> function to \u201chook onto\u201d a specific action or filter hook. Both these functions\u2014add_action() and add_filter()\u2014accept the same arguments. Those are the appropriate hook name, the name of the callback function that is hooked onto it, the priority of the hooking process, and the number of arguments the callback function accepts.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>The priority is a natural number that specifies the order in which callback functions are hooked onto a single hook.<\/strong> The lower the number, the sooner they are executed. In the case of multiple callback functions that share the same priority, they are executed in the order that the calls of the add_action() or add_filter() function are added. <strong>The default priority is 10, while the default number of arguments of the callback function is 1.<\/strong> If both values are omitted then the default ones are used when calling the add_action() or add_filter() function. Although the priority may be omitted in some cases, it is important to understand its purpose and how it affects the code, both in terms of actions and filters.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Since action hooks are used to add new functionalities, the outputs of the callback functions hooked onto them are displayed one below the other. They are shown in an ascending order based on the priorities of the respective callback functions.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]However, this is not the case for filter hooks. Every callback hooked onto a filter hook alters the input value differently and returns it differently. This means that every callback that is executed will override the output of a previously executed one. Therefore, if hooked onto a filter hook, the output of the callback function with the highest priority will be displayed on the website. You should keep this in mind when using filter hooks.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]For additional flexibility, you can use the <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/remove_action\/\" target=\"_blank\" rel=\"noopener\">remove_action()<\/a> and <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/remove_filter\/\" target=\"_blank\" rel=\"noopener\">remove_filter()<\/a> functions, which \u201cunhook\u201d a given callback function from a specific action or filter. Both functions accept three parameters\u2014the name of the hook, the name of the callback function being removed (i.e. unhooked), and the unhooking priority, which should be higher than the priority used when the callback was hooked.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]With this, we conclude our overview of WordPress hooks. You\u2019ll need to have some grasp of them to be able to understand the code below. We deliberately separated the explanation and the code to make it easier for our readers to navigate the article and quickly find any information they need.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]With that being said, let\u2019s move on to the code snippets. These provide a way of editing the WordPress admin panel footer labels. And they do so using filter hooks.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\">Using custom code<\/h3>\n<p>[\/vc_column_text][vc_column_text]When adding any custom code snippets to your WordPress website, there are several things you should know beforehand. Generally speaking, making a backup of your website before adding any code is a security precaution against any potential mishaps or website breaks due to faulty code. And we encourage you to do this. You can opt to <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-manually-backup-wordpress-website\/\">manually back up the website<\/a> or automate the backup process <a href=\"https:\/\/qodeinteractive.com\/magazine\/wordpress-backup-with-updraftplus-plugin\/\">using a suitable backup plugin<\/a>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Additionally, it is important to know where you can safely insert the custom code snippets. The two locations we recommend are either in the functions.php file of your child theme (<a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-use-ftp\/\">using FTP<\/a>) or in a suitable <a href=\"https:\/\/qodeinteractive.com\/magazine\/wordpress-site-specific-plugin\/\">site-specific plugin<\/a>. Now let\u2019s move on to the code snippets ew prepared.[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><strong>Editing the left admin footer label<\/strong><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To edit the left admin footer label, you will need to use a custom code snippet similar to the one given below. The snippet we created for this article represents a custom callback function named <strong>qode_change_footer_admin_label()<\/strong>, which is hooked onto the admin_footer_text filter hook. The function is very simple\u2014it takes the default label value (\u201cThank you for creating with WordPress\u201d) and changes it into <strong>\u201cCreated with WordPress | Powered by Qode Interactive\u201d.<\/strong> Furthermore, both the words <a href=\"https:\/\/wordpress.org\/\" target=\"_blank\" rel=\"noopener\">WordPress<\/a> and <a href=\"https:\/\/qodeinteractive.com\/\">Qode Interactive<\/a> are linked to their respective websites. The links are set to open in separate tabs.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">function qode_change_footer_admin_label( $default_value ) {\r\n$default_value = 'Created with &lt;a href=\"https:\/\/wordpress.org\/\" target=\"_blank\"&gt;WordPress&lt;\/a&gt; | Powered by &lt;a href=\"https:\/\/qodeinteractive.com\/\" target=\"_blank\"&gt;Qode Interactive&lt;\/a&gt;';\r\nreturn $default_value;\r\n}\r\nadd_filter( 'admin_footer_text', 'qode_change_footer_admin_label' );<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Since we covered what the code does, we just need to insert it into one of the two previously suggested locations. After you\u2019ve done so, you will notice the following result.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Left-Label-Result.jpg\" class=\"attachment-full size-full\" alt=\"Left Label Result\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Left-Label-Result.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Left-Label-Result-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Left-Label-Result-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Left-Label-Result-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]You can change the left admin footer label as you see fit. This is done by changing the string value of the single PHP variable used in that code, called $default_value.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]However, there is another thing you should be aware of, and that is the priority of the code. In the code snippet example above, <strong>we omitted the priority since it wasn\u2019t necessary<\/strong>. Therefore, the priority was set to 10. But, some plugin or theme authors whose products you\u2019re using may have chosen to customize the left admin footer label on specific screens as well. In that case, you may notice that the label changes on specific screens, depending on the plugin(s) or theme(s) you might be using. We will examine the issues of priority in the next code snippet, given below.[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><strong>Editing the right admin footer label<\/strong><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To change the right admin footer label, you will need to create a suitable callback function and hook it onto the <a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/update_footer\/\" target=\"_blank\" rel=\"noopener\">update_footer<\/a> filter hook. We have done just that in this example. The callback function we created is called <strong>qode_change_footer_admin_version_label()<\/strong>. It returns the label <strong>\u201cWordPress news, resources and tutorials: Qode Magazine\u201d<\/strong> instead of the default one that displays the current WordPress version. Similar to the previous example, we included a link. This one leads to the <a href=\"https:\/\/qodeinteractive.com\/magazine\/\">Qode Magazine<\/a> homepage and it opens in a separate tab.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]But, the difference from the previous code snippet, apart from which filter hook we used, is that we inserted a priority value. We\u2019ll explain why we added it now.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]The default right admin footer label\u2014\u201cVersion \u201d, followed by your current WordPress version is added using the following line of code:<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">add_filter( 'update_footer', 'core_update_footer' );<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]This code is located in this template file: wp-admin\/includes\/admin-filters.php, which is part of the WordPress Core files. Therefore, if we hadn\u2019t added a priority higher than 10 (the default value) to our code, then the code that would be executed\u2014between ours and the default WordPress one\u2014is the one loaded second. In this case, the line of code that is added in the wp-admin\/includes\/admin-filters.php template file is the one that\u2019s executed. Meaning, without a priority higher than 10, our code wouldn\u2019t do anything, as it would be executed first and then overridden by the default WordPress code. This will end up restoring the default right admin footer label. Therefore, we opted to use a priority of 11, as it was high enough in our case.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">function qode_change_footer_admin_version_label( $default_value ) {\r\n$default_value = 'WordPress news, resources and tutorials: &lt;a href=\"https:\/\/qodeinteractive.com\/magazine\/\" target=\"_blank\"&gt;Qode Magazine&lt;\/a&gt;';\r\n\r\nreturn $default_value;\r\n}\r\nadd_filter( 'update_footer', 'qode_change_footer_admin_version_label', 11 );<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Sometimes, as we mentioned previously, your plugins or theme may hook onto the same filter hook to achieve a specific custom functionality or feature. And, even though the examples we mentioned in this article are quite simple and harmless, you should always take special care when adding custom functionalities in general.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]As a word of caution\u2014your custom code can override specific theme or plugin functionalities leading to compatibility issues, or, even, breaking your website. Therefore, it\u2019s a good rule of thumb to consult with theme or plugin authors before overriding any custom functionality. Also, make sure to prepare a backup of your website beforehand, just in case.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]After adding the code, you should expect to see a result similar to the one we got, visible in the bottom right corner of your admin dashboard screen.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Right-Label-Result.jpg\" class=\"attachment-full size-full\" alt=\"Right Label Result\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Right-Label-Result.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Right-Label-Result-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Right-Label-Result-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/09\/Right-Label-Result-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]As with the previous code snippet, you are free to edit the example we provided according to your needs. Just make sure to carefully review all the points we made regarding its purpose and functionality.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Final Thoughts<\/h2>\n<p>[\/vc_column_text][vc_column_text]The WordPress Admin panel footer area can be customized to showcase messages specific to your website, theme, or plugin. This is done with the help of WordPress hooks. In this article, we took a look at how the admin panel footer can be changed using only a couple of lines of code. The examples we put together are both straightforward, so you can easily implement them on your end. Additionally, we covered the concept of WordPress hooks, which should make this article a helpful resource on that topic. That knowledge of WordPress hooks will help you when adding any new functionality to your website. So we invite you to learn more as well as bookmark this article to keep on hand.<br \/>\n[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Find out how to give your dashboard that special touch by customizing the WordPress admin panel footer.<\/p>\n","protected":false},"author":11229,"featured_media":29313,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[135,4,13],"class_list":["post-29226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-customization","tag-tips","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/29226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/11229"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=29226"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/29226\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/29313"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=29226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=29226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=29226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}