If you want to redirect to the page you’re currently on use:
wp_logout_url( $_SERVER['REQUEST_URI'] );
or
wp_logout_url( get_permalink() );
Or if you want to redirect to another site use the allowed_redirect_hosts function.
Related Posts:
- Masking logout URL
- Logout Redirect and also WP-login.php Redirect
- How to load scripts/styles specific for a page
- Logout redirect to current page – function
- How do I create a new WP admin color scheme?
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- Add attribute to link tag that’s generated through wp_register_style?
- TinyMCE custom stylesheets for different post types
- Remove “says” from comments
- Is it possible to be more page/post specific with admin_enqueue_script?
- Child Theme Not Overriding Parent Theme
- CSS stylesheet not loading
- Add class or ID to any WordPress function
- Register and enqueue style.css custom theme
- Multiple CSS body classes to specific page I.D.’s – is this possible?
- Ninja form Redirect depending on text field content [closed]
- Load .txt file for login_message in wp-login.php
- How do I redirect all 404 error url to Subcategory url
- How to change login labels
- Child Theme files – what is needed?
- How do I add Bootstrap and LESS to my migrated WordPress site?
- How to Display Frontend CSS for Administrator only
- Removing wp_login_viewport_meta
- WordPress Menuing Question :focus
- 404 redirect to previous category
- Login Redirect if Logged in from Specific Page
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Incorrect redirect after commenting
- Change CSS for logged in users
- How to stop wordpress from injecting hard-coded style into image attachments with captions
- different style sheet for just one page template
- header_image() with CSS
- Not all CSS elements transferring via parent to child?
- How i can put $_GET codes in function.php?
- Split Media Queries in different files!
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- problem loading stylesheets to wp_head dynamically
- Page get parameter doesn’t work with is_single() function
- Contact Form 7 If Condition
- Solved: redirect to another page using functions.php
- Redirect to other page if login
- Parent theme styles overriding child theme CSS [closed]
- Theme JS is available but theme CSS isn’t
- Proper Way to Load stylesheet on Condition
- Default Nav Highlight
- Custom styles in Tiny MCE with an external CSS file
- why can’t i add front.css to my frontpage.php
- WordPress website keeps loading the maintenance page
- get_template_directory_uri() links to child theme not parent
- Redirects based on a JSON file
- Getting out side of wp root folder from function.php using absolute path
- Page Template Won’t Load Correct CSS File
- current_page_item is missing inside wp_nav_menu
- define css class in functions.php
- Add Login and logout buttons to top menu bar
- Show errormessages on wrong username/password on custom loginform?
- template_redirect action only firing if logged in
- Completely Disable WordPress RSS Feeds
- How to redirect Subscribers on login to specific page, when logging in from a Page
- Advanced method to control cache of enqueued style/script
- Redirect to one of two pages after data submitted, depending on the current url
- Combine page types and Custom Taxonomy in a functions.php command
- Can’t load assets
- Unable to login after registration
- CSS style and app.js not loading
- Stylesheet does not load despite functions.php
- Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
- Re-style Login Form Whilst Keeping CSS Separate from Frontend CSS
- Wildcard 301 Redirect Using Theme Function
- How do I make a custom “Read More Blogs” button for my blog page
- Help using ShortCodes to style whole chunks of the post
- Setting Up Child Theme To Take Priority
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- CSS disabled after getting rid of emoji
- Restrict access if logged out except for homepage
- Woocommerce – Switching Price for Category
- Redirect specific author posts to another url
- How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?
- Child Theme not loading multiple stylesheets
- True email confirmation for registration (keeping unvalidated users from user table)
- Correct way of Enqueue self hosted fonts in sass project
- Help with is_page() and calling css for specific pages in a Child Theme
- Child theme style.css didn’t work properly but the Customize Additional CSS did [closed]
- Redirect after login to current URL
- How to create a function to redirect a specified page to another page
- Language switcher for subdomains
- Changing the color of post title [closed]
- Preventing PHP Execution in Parent Theme
- Functions.php in child theme that loads CSS file breaks website
- Syling Custom Fields echo’s from from functions.php
- How to request login for user but not for bots
- Making an under maintenance page (without using plugins)
- Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Image width issue in IE [closed]
- How do I make my child theme’s CSS update when I save it?
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- Logout redirect via page template without confirmation?
- Template Redirect Function Only Working When Logged In