Title: WordPress Logout From CMS
Last modified: August 19, 2016

---

# WordPress Logout From CMS

 *  [lightyearllc](https://wordpress.org/support/users/lightyearllc/)
 * (@lightyearllc)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/wordpress-logout-from-cms/)
 * I’ve integrated wordpress into a Content Mgmt Solution (CMS) for a membership
   site and want to logout the wordpress user from the CMS but am having difficulty
   figuring out how to do it.
 * Here’s the code I’m using to logout the wordpress user from the CMS:
    require_once(‘/
   blog/wp-config.php’); require (“/blog/wp-includes/pluggable.php”); if (is_user_logged_in()){
   wp_logout(); }
 * I’m getting the error: Fatal error: Call to undefined function is_user_logged_in()
   in /home/eaglehb/public_html/growmyhomebusiness.com/members/logout.php on line
   15
 * Here’s how I’m logging the wordpress user in w/ modification to the wordpress
   file header.php.
 * if (!is_user_logged_in()) {
    $field=’login’; $user_info = get_user_by($field,
   $_SESSION[SESS_USERNAME]); $user_login = $user_info->user_login; $user_level 
   = $user_info->user_level; $user_id = $user_info->ID; wp_set_current_user($user_id);
   wp_set_auth_cookie($user_id); do_action(‘wp_signon’, $user_id); }
 * Your guidance is greatly appreciated ….. Rick

The topic ‘WordPress Logout From CMS’ is closed to new replies.

## Tags

 * [integration](https://wordpress.org/support/topic-tag/integration/)
 * [Logout](https://wordpress.org/support/topic-tag/logout/)
 * [wp_logout](https://wordpress.org/support/topic-tag/wp_logout/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [lightyearllc](https://wordpress.org/support/users/lightyearllc/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/wordpress-logout-from-cms/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
