# "Join for Free" Bar for Visitors

> Shows a slim, dismissible bar at the bottom of the screen inviting visitors who are not logged in to create a free account or log in.

- Type: PHP
- Runs: Frontend only
- Category: [Memberships](https://wpide.com/library/category/memberships/)
- Tags: members, signup, conversion
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/guest-join-bar/

## Code

```php
$wpide_join_text = 'Get members-only articles and resources.';

add_action( 'wp_footer', function () use ( $wpide_join_text ) {
    if ( is_user_logged_in() || ! empty( $_COOKIE['wpide_join_dismissed'] ) ) {
        return;
    }

    $links = '<a href="' . esc_url( wp_login_url( home_url( add_query_arg( array() ) ) ) ) . '">Log in</a>';

    if ( get_option( 'users_can_register' ) ) {
        $links = '<a href="' . esc_url( wp_registration_url() ) . '" style="font-weight:600">Join for free</a> &middot; ' . $links;
    }
    ?>
    <div id="wpide-join-bar" role="region" aria-label="Membership invitation" style="position:fixed;left:0;right:0;bottom:0;z-index:9999;display:flex;flex-wrap:wrap;gap:.5em 1em;align-items:center;justify-content:center;padding:10px 48px 10px 16px;background:#1d2327;color:#fff;font-size:15px">
        <span><?php echo esc_html( $wpide_join_text ); ?></span>
        <span class="wpide-join-links"><?php echo wp_kses_post( $links ); ?></span>
        <button type="button" aria-label="Dismiss" style="position:absolute;right:10px;top:50%;transform:translateY(-50%);background:none;border:0;color:inherit;font-size:22px;cursor:pointer">&times;</button>
    </div>
    <style>#wpide-join-bar a{color:inherit;text-decoration:underline}</style>
    <script>
    (function () {
        var bar = document.getElementById('wpide-join-bar');
        bar.querySelector('button').addEventListener('click', function () {
            document.cookie = 'wpide_join_dismissed=1; max-age=' + (30 * 86400) + '; path=/; SameSite=Lax';
            bar.remove();
        });
    })();
    </script>
    <?php
} );
```

## Notes

Dismissing hides it for 30 days. It never shows to logged-in users or on the login page, and only links to registration when sign-ups are open.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find ""Join for Free" Bar for Visitors" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
