{"id":4572,"date":"2025-02-05T17:59:30","date_gmt":"2025-02-05T17:59:30","guid":{"rendered":"https:\/\/ibex.tech\/wordpress-sites\/?p=4572"},"modified":"2025-02-05T18:39:09","modified_gmt":"2025-02-05T18:39:09","slug":"log-out","status":"publish","type":"post","link":"https:\/\/ibex.tech\/wordpress-sites\/page-builders\/elementor\/users\/user-signup-and-login\/log-out","title":{"rendered":"Log out"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Log out link<\/h4>\n\n\n\n<p><a href=\"\/wp-login.php?action=logout\">\/wp-login.php?action=logout<\/a><\/p>\n\n\n\n<p>This takes you to a log out confirm screen which is meh. Better solution is just to create a blank &#8220;log out&#8221; page to use as a link target and use code to have it log out and redirect to home page<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Example log out code to use<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/************************************************************\n\/\/************************************************************\n\/\/********** HIGH LEVEL FILTERING &amp; VALIDATION HOOK **********\n\/\/************************************************************\n\/\/************************************************************\nadd_action( 'wp', 'mysite_wp' );\nfunction mysite_wp()\n{\n \n  \/\/--------------------------------------\n  \/\/----- CHECK FOR LOG OUT PAGE URL -----\n  \/\/--------------------------------------\n  if($_SERVER&#91;\"REQUEST_URI\"] == '\/log-out')   \/\/&lt;&lt;&lt;The URL the page is set to use\n  if($_SERVER&#91;\"REQUEST_URI\"] == '\/log-out')\n  {\n    if (is_user_logged_in())\n      wp_logout();\n    wp_redirect( home_url( '\/' ) );\n    die();\n  }\n  \n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Log out link \/wp-login.php?action=logout This takes you to a log out confirm screen which is meh. Better solution is just to create a blank &#8220;log out&#8221; page to use as a link target and use code to have it log out and redirect to home page Example log out code to use<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[380],"tags":[],"class_list":["post-4572","post","type-post","status-publish","format-standard","hentry","category-user-signup-and-login"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/comments?post=4572"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4572\/revisions"}],"predecessor-version":[{"id":4578,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4572\/revisions\/4578"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/media?parent=4572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/categories?post=4572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/tags?post=4572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}