10

Is there a way to edit the text "thank you for creating with Wordpress" in version 3.3.1 at the bottom of the CMS? If so what file do I need to edit?

5 Answers 5

13

Credit definitely goes to @kaiser, but here is a full working solution. You can add this code to your functions.php file (in your theme):

function wpse_edit_footer() {
    add_filter( 'admin_footer_text', 'wpse_edit_text', 11 );
}

function wpse_edit_text($content) {
    return "New Footer Text";
}

add_action( 'admin_init', 'wpse_edit_footer' );
0
5

Just hook into the filter. The only thing remaining will be the <hr />.

/**
 * Change/Disable the footer text line
 * @return void
 */
function wpse_remove_footer()
{
    add_filter( 'admin_footer_text',    '__return_false', 11 );
    add_filter( 'update_footer',        '__return_false', 11 );
}
add_action( 'admin_init', 'wpse_remove_footer' );

In case you want to change it:

add_action( 'admin_init', function()
{
    add_filter( 'admin_footer_text', function() {
        echo "This is a custom admin footer text";
    }, 11 );
    add_filter( 'update_footer', function() {
        echo "This is a custom footer update text";
    }, 11 );
} );
2
  • Ok thanks, I don't want to remove it though, just edit what it says.
    – Rob
    Mar 22, 2012 at 13:42
  • @Rob Just replace the __return_false callback fn for admin_footer_text with a custom callback that does a return with your custom string.
    – kaiser
    Mar 22, 2012 at 13:53
1
add_filter('admin_footer_text', remove_admin_footer_text, 1000);

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

add_filter('update_footer', remove_admin_footer_upgrade, 1000);

function remove_admin_footer_upgrade($footer_text =''){
return '';  
}
1
  • 1
    Please post a proper answer, that is, please explain what your code does and how it works. File an edit and comply Jun 20, 2016 at 16:37
0

There you go:

// Admin footer modification

function remove_footer_admin () {
    echo '<span id="footer-thankyou">Developed by <a href="https://www.example.com" target="_blank">www.example.com</a></span>';
}

add_filter('admin_footer_text', 'remove_footer_admin');
0

Why not just set a very high priority and use some modern programming ? :-)

add_filter( 'admin_footer_text', fn () => 'Your custom text', 99, 0 );

99 means priority 99 - WP is usually within 0-20 range. It means this will filter last.

If you need to do more logic - use classic anonymous function:

add_filter( 'admin_footer_text', function () { return 'Your custom text'; }, 99, 0 );

Unless you are planning to remove a filter/action, please use anonymous/arrow functions.
(WP has bug for removing anonymous callbacks...)
It makes the code more clear and efficient. If you want to reference the function more times, in modern PHP you can do functionName(...) or $o->methodName(...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.