{"id":32654,"date":"2010-05-24T20:12:51","date_gmt":"2010-05-25T00:12:51","guid":{"rendered":"http:\/\/wpmu.org\/?p=32654"},"modified":"2012-10-02T23:32:01","modified_gmt":"2012-10-03T03:32:01","slug":"daily-tip-are-you-sure-you-want-to-logout-error-heres-the-fix","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/daily-tip-are-you-sure-you-want-to-logout-error-heres-the-fix\/","title":{"rendered":"&#8220;Are you sure you want to logout&#8221; Error? Here&#8217;s the Fix."},"content":{"rendered":"<p>Have you ever gotten that annoying message &#8220;<strong>You are attempting to log out of example.com. Please try again.<\/strong>&#8221; while trying to logout of your site?<\/p>\n<p>Here&#8217;s what the codex has to say about that:<\/p>\n<blockquote><p>The Template Tag <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_logout_url\" rel=\"noopener\" target=\"_blank\">wp_logout_url<\/a> was added in <a href=\"http:\/\/codex.wordpress.org\/Version_2.7\" rel=\"noopener\" target=\"_blank\">Version 2.7<\/a> to provide a nonced URL for logout purposes. If a theme uses a construct such as \/wp-login.php?action=logout to offer the user a logout link that code should be updated to use the wp_logout_url. A good example of the usage of <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_logout_url\" rel=\"noopener\" target=\"_blank\">wp_logout_url<\/a> can be seen in the WordPress Default and Classic themes comments.php and comments-popup.php Templates.<\/p><\/blockquote>\n<h2>The Fix:<\/h2>\n<p>Replace your old logout tag with something similar to this:<\/p>\n<pre>&lt;a href=\"&lt;?php echo wp_logout_url(); ?&gt;\" title=\"Logout\"&gt;Logout&lt;\/a&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever gotten that annoying message &#8220;You are attempting to log out of example.com. Please try again.&#8221; while trying to logout of your site? Here&#8217;s what the codex has to say about that: The Template Tag wp_logout_url was added in Version 2.7 to provide a nonced URL for logout purposes. If a theme uses [&hellip;]<\/p>\n","protected":false},"author":4099,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[1,557],"tags":[],"tutorials_categories":[],"class_list":["post-32654","post","type-post","status-publish","format-standard","hentry","category-news-community","category-development"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/32654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=32654"}],"version-history":[{"count":2,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/32654\/revisions"}],"predecessor-version":[{"id":181729,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/32654\/revisions\/181729"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=32654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=32654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=32654"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=32654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}