You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:WooCommerce商店登出未跳转至店铺页面,而是跳转至WordPress后台

Fix WooCommerce Logout Redirecting to WordPress Admin

Hey there, let's get that logout redirect sorted for your store at www.pathankotmandi.com! Here are practical steps you can take to fix the issue where users land on the WP admin page instead of your shop page:

1. Check WooCommerce Core Settings

First, start with the simplest fix—verify your WooCommerce configuration:

  • Head to your WordPress dashboard, go to WooCommerce > Settings > Advanced
  • Look for the My Account section, where you'll find the "Logout redirect" option
  • Select your desired shop page (like your homepage or dedicated shop archive) from the dropdown, then save changes. This should override the default admin redirect.

2. Add a Custom Code Snippet

If the built-in setting doesn't work, a small code snippet can force the correct redirect:
You can add this to your theme's functions.php file (use a child theme to avoid losing changes on theme updates) or use a code snippet plugin:

add_action('wp_logout', 'custom_woocommerce_logout_redirect');
function custom_woocommerce_logout_redirect() {
    // Replace home_url() with your shop page URL if needed, e.g., home_url('/shop/')
    wp_redirect( home_url() ); 
    exit();
}

This code hooks into the logout action and sends users straight to your site's homepage (or whatever URL you specify).

3. Rule Out Plugin Conflicts

Sometimes third-party plugins mess with redirects:

  • Temporarily deactivate all plugins except WooCommerce
  • Test the logout flow again. If it works correctly, reactivate plugins one by one until you find the culprit. Update or replace that plugin if needed.

4. Check Your Theme's Settings

Some themes include custom redirect controls for user actions like login/logout:

  • Navigate to your theme's options panel (usually under Appearance > Customize or a dedicated theme menu)
  • Look for sections like "User Accounts", "Shop Settings", or "Redirects" to see if there's a logout redirect setting you need to adjust.

If none of these steps work, you can also check your site's .htaccess file for any unexpected redirect rules (make a backup before editing!).

内容的提问来源于stack exchange,提问作者Harvinder Singh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:24:26