home_url()
will accept a parameter that will be used in the creation of the URL.
The bare minimum solution would be:
add_action(
'wp_logout',
create_function(
'',
'wp_redirect(home_url("/path/to/page"));exit();'
)
);
site_url()
will also accept the same parameter and may be (probably is) a better choice.
I believe that using either of those will make the link dependent on permalink settings. I don’t think that those function will translate between different settings, though I have not tested that.
I would suggest using get_permalink()
with an explicit page/post ID.
add_action(
'wp_logout',
create_function(
'',
'wp_redirect("'.get_permalink(1).'");exit();'
)
);
Note that you don’t need home_url()
or site_url()
since get_pemalink()
will generate the complete URL.
Related Posts:
- Logout redirect to home page
- How to change the default logout link on WordPress Admin
- handling login/logout redirects
- wp_logout_url() redirects to confirmation page even with nonce?
- Redirect user after logout
- After logout browser’s back button into twenty sixteen theme profile
- Logout without confirmation and SAME window on mobile
- How to redirect returning users who previously logged in?
- Conditional redirection with logout
- Custom, conditional redirect on logout
- Logging back into WordPress after logging out and having issues with ‘loggedout=true’ in redirect URL
- after logout, get_current_user_id still holds value
- WordPress Logout Redirect Follow up
- What does HTTP/1.1 302 mean exactly?
- Redirect entire website to a single page
- How do I programmatically generate a 404?
- User redirect to destination URL after login
- prevent/block direct access to a thank you page
- Redirect After Delete User in Backend
- How to create a php url redirection for nicer links
- Custom domain for sub-section of parent website
- Redirecting old site links to new site
- Redirect after closing Theme Customizer when user does not have permission for theme page
- Creating intro page in wordpress
- Redirect to https not working with .htaccess [closed]
- Perform a redirect after user action
- All pages showing up as homepage on WordPress website
- Redirect one of two domains on one WordPress installation
- WordPress site in subdirectory load site in main directory
- How do I redirect users after submitting a replies for moderation on bbpress?
- Redirect all pages except one to homepage via .htaccess
- Does WP always makes 301 redirection?
- WordPress Redirecting HTTPS Requests to HTTP
- How can I redirect my website’s homepage to a random blog post?
- htaccess redirects and WordPress
- Use virtual pages point to one specific page
- How to migrate production WordPress to Localhost
- Redirect first category archive page to normal page
- Blog index not going to wordpress folder
- Check Page requested, and redirect
- WordPress on a local machine redirecting to xampp dashboard page [closed]
- Redirect all requested url to new url
- Can’t control WordPress Addresses from admin panel
- reducing number of URL Redirects and increasing speed
- How to use https on one page only?
- WooCommerce – Redirect to a product after login
- Problem in disabling canonical 301 redirect
- How to redirect just one or two blog posts correctly?
- Why does the $_GET parameter ?search forward the front-page to the archive/blog page
- Prevent wordpress autoredirect
- Custom form redirect after login
- How to redirect only 404 pages with htaccess in WordPress
- How to redirect the frontend of a WordPress site (only)?
- My site is being redirected to itself
- Redirect Attachment Page to Attachment
- Permalinks do not include www subdomain
- Front page is being directed to an unknown site
- Redirect away from page if user is not admin
- Domain redirect to wp-admin/setup-config.php file
- Logout Redirect and also WP-login.php Redirect
- redirect to a child theme based on the town of Internet users in france with the verification of the ip address
- How do I change the home page to the registered user’s profile page
- Upload Directory question
- Change Category Slug Redirection
- custom login form redirect problem
- WordPress redirect to new domain name
- Blog post is redirecting to home page
- Trying to re-direct users to specific page based on an ACF variable
- wp_redirect is only working in Chrome Network, page is not redirecting
- Bulk redirect all post
- Disable redirect to homepage after successful Login, Stay on Current Page
- WordPress no permission redirection to a popup
- Open wordpress page in directory the way index.html would open
- How force WordPress redirect to current custom page after login
- How to remove redirection
- Redirect Homepage to another page when user login
- Site using static homepage, redirects (301) and removes pluses from query string
- Unusual Apache2 Error Causing WordPress Redirect Error?
- Redirect error after updating WordPress to 5.4.2
- 301 Redirect Loop www to non-www – Nginx + Apache2
- how to redirect 404 to attachment.php?
- 301 Redirect in WordPress not working in htaccess
- Toggle Redirect Function On/Off With Checkbox
- My wordpress site has “https://” on it but when I go to Dashboard and click visit site, it removes the “https://”
- After disabling Multisite, homepage redirects to non-existing page
- redirect to https://my-site/wp-admin/ instead of https://my-site/wordpress/wp-admin/ after options updating
- Redirect after login when WordPress in subdirectory
- I get “too many redirects” problem when migrating localhost site
- How to redirect non-admin/editors from specific pages?
- How to make a redirect link in wordpress?
- wp_redirect leading to an infinite loop
- Redirect after Permalink change – What regex do I use?
- Configure WordPress to listen on a port other than 80
- Do I need to keep the original page when 301 redirecting to a new one?
- I’ve move my site but URL still goes to the old site
- redirect users to the login page
- Moving an ASP Site to WordPress – Looking for Help on Redirects
- WordPress subfolders htaccess bypassing the root htaccess RewriteRule
- Rewrite Rule working different than expected
- WordPress Redirecting Form Action to Home Page