Using WordPress ‘login_footer’ PHP action

The login_footer WordPress PHP action fires in the login page footer, allowing you to add custom code or content to the footer section of the WordPress login page.

Usage

add_action('login_footer', 'your_custom_function');

function your_custom_function() {
    // your custom code here
}

Parameters

  • No parameters required.

More information

See WordPress Developer Resources: login_footer

Examples

Add a custom copyright notice to the login page footer.

add_action('login_footer', 'add_copyright_notice');

function add_copyright_notice() {
    echo '<p>&copy; ' . date('Y') . ' Your Company Name. All rights reserved.</p>';
}

Add a “Back to Homepage” link to the login page footer.

add_action('login_footer', 'add_back_to_home_link');

function add_back_to_home_link() {
    echo '<p><a href="' . home_url() . '">Back to Homepage</a></p>';
}

Add social media icons

Add social media icons to the login page footer.

add_action('login_footer', 'add_social_media_icons');

function add_social_media_icons() {
    echo '<div class="social-icons">';
    echo '<a href="https://facebook.com/your_username" target="_blank">Facebook</a>';
    echo '<a href="https://twitter.com/your_username" target="_blank">Twitter</a>';
    echo '<a href="https://instagram.com/your_username" target="_blank">Instagram</a>';
    echo '</div>';
}

Add a custom message

Add a custom message to the login page footer.

add_action('login_footer', 'add_custom_message');

function add_custom_message() {
    echo '<p>Unauthorized access is prohibited. Violators will be prosecuted.</p>';
}

Add a privacy policy link to the login page footer.

add_action('login_footer', 'add_privacy_policy_link');

function add_privacy_policy_link() {
    echo '<p><a href="' . get_privacy_policy_url() . '">Privacy Policy</a></p>';
}