Use wp_logout_url()
https://developer.wordpress.org/reference/functions/wp_logout_url/
<a href="<?php echo wp_logout_url(); ?>">Logout</a>
Related Posts:
- Log out without confirmation request (nonce)
- Can I use the same nonce for multiple requests on the same page?
- How to use nonce with front end submission form?
- Do I require the use of nonce?
- WordPress “Link has expired” error on updating posts
- How to log out everywhere else, destroy all sessions “all other devices”?
- Security – Ajax and Nonce use [closed]
- When must I use and verify nonce?
- What SQL / WordPress queries would need a nonce?
- Displaying a button on each post
- Using Multiple Submit buttons to trigger customised php functions
- Insert a button on a page with random number generation
- WP nonce invalid
- Button not refreshing page
- How to make a search button that will search my website?
- How to: PHP Log Out Link?
- Login/logout in header
- Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
- Why ajax doesn’t work on certain wordpress hooks?
- Are nonces in WP REST API optional by default?
- Change “add to cart” button color based on Woocommerce product category [closed]
- Why my image upload button is not working in wordpress widget area?
- Form Security: nonce vs. jQuery
- AJAX button action in foreach
- element not working in Safari [closed]
- WordPress comment submit button substitutes/options
- Function won’t run onclick using Ajax
- Force Users To Relogin
- How to remap one of the TinyMCE Advanced Editor button to open the wordpress media library?
- How to hook a logout funtion for specific usr role in wordpress?
- How to use the wpsnonce clone post link?
- Logout redirects to default page
- Cannot access $wpdb, comes back NULL
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Add a product category to a specific product via a button
- Send an e-mail on address with the link with disliked post
- Reliable way to add nonce to HTTP Header in WordPress?
- Check if user had autologin & if so, logout
- How to edit button permalink inside function.php using a child theme?
- Change Login or Logout text based on status
- How do I stop my form from adding code to current page URL instead of re-directing. Been stuck for days
- Nonce fail after second submit attempt
- Functions are causing errors
- Using Nonce for my Form
- Unable to logout correctly after wp-login file was modified
- Data insertion after clicking a button does not work (script, AJAX, PHP)
- Nonce code vulnerability
- Experiences with compiling WordPress using Hip Hop?
- Debugging upload problem: What part of WP does actual image-resizing?
- login wp impossible
- Custom image upload
- How to scale image with equal width and height without distortion?
- PHP 5.5, w3 Total Cache, and opcache [closed]
- How do I add text in a shortcode?
- How to display php source code inside a post using visual editor?
- Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]
- WordPress – how to replace with string on the_content() in single.php
- Getting array of customizer settings
- Ajax – Call to undefined function get_option()
- Display PHP within HTML values
- Show full posts in archive
- User management system similar to wordpress one?
- How does WordPress know wich language is chosen when there is a database connection error
- populate form fields in a loop with ajax
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Contact form won’t submit
- can i fetch a custom metabox data in another page or post type?
- Call to undefined function get_userdata() in plugin
- How to add different text in each result of foreach?
- ‘Post-thumbnails’ feature does not seem to register
- multiple where condition in result query
- Featured or last post with a different WordPress style without plugin
- How to get User Time Zone in WordPress?
- Different SMTP based on domain
- How to replace the default domain on wp get shortlink
- show recent posts php code error?
- How to track who has deleted files
- Show Featured Image Dimensions and size frontend with shortcode
- How to remove/hide collapse menu for user/subscriber?
- remove values within an array user meta
- Get only relevant sub-category of category “Genre” that applies to current product only
- How to escape echo for input tag?
- Add Shortcode to ::before class
- Warning: count(): syntax problem of the count () function
- How to display custom seo title before the loop?
- WooCommerce get products based on the taxonomy
- Displaying child taxonomy before parent
- Add div after every 4 posts then every 2 posts for a responsive loop
- Update same content in multiple posts at once?
- Different home page for logged off users
- Non-static method error when trying to use class in widgets
- Send data from plugin to external database
- Changes in header.php not reflecting
- Newly published content gives 404 on wordpress
- Show custom default avatar instead of gravatar
- Advanced Custom Fields Show PHP in Text Areas
- New to WordPress & Freelancing [closed]
- Add a “Next Post” & “Previous Post” styled button manually to a post
- Changing regular db connection to $wpdb
- Is there a way to get a path to the theme directory without the server name?