In this post, we ate going to learn about woo-commerce get logout URL and let’s make that step by step
First: get the my account page id by using the code get_option( ‘woocommerce_myaccount_page_id’ );
Second: check if there is any my-account page id
Third: get the permalink bypassing my account page id through the function get_permalink( $myaccount_page_id )
Fourth: now get the logout URL bypassing my-account URL through the function wp_logout_url( get_permalink( $myaccount_page_id ) )
Fifth: Check if there is SSL checkout
Sixth: now replace Http: to https:
Now you can print the logout URL
Here is the code to get a woo-commerce logout URL.
Thanks for Reading