check if user is not logged in wordpress using jquery code example Example: detect logged user wordpress javascript document.body.classList.contains( 'logged-in' );