Skip to main content
1 of 3
Buttered_Toast
  • 2.8k
  • 1
  • 8
  • 21

Using wp_logout_url() is your best choice.

You will need to create a <a> tag and in the href attribute output wp_logout_url()

<a href="<?= wp_logout_url('/'); ?>" title="Logout">Logout</a>

I passed / as an argument because after the user will click the link he will be redirected back to the homepage, you can change it to what ever you want

Buttered_Toast
  • 2.8k
  • 1
  • 8
  • 21