Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

logout link

// Add Shortcode
function doc_logout_link() {

	// Code
$logoutlink = wp_logout_url( home_url() );
return '<a href="' . $logoutlink . '">Logout</a>';
}
add_shortcode( 'doc_logout', 'doc_logout_link' );