Create A Wordpress Logout Link
Adding a logout button to your Wordpress site can be a nice little timesaver – it saves you having to access your Wordpress admin area and logging out from there. Whilst it doesn’t take much time to logout from the admin area, it can become a little irritating at times (especially if you have multiple sites and/or are developing Wordpress themes).
Adding a logout button can also be useful for sites that have multiple authors – it’s very simple to do and only requires a few lines of code.
Add the following code to the area on your site that you would like the logout link to appear (e.g. you might put it in your footer (footer.php) or at the bottom of your sidebar (sidebar.php)):
<?php if (is_user_logged_in()){ <a href="<?php echo wp_logout_url(); ?>">Logout</a> } ?>
This will then add a link to your site that when clicked will log you out!















