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