跳至主要內容
WordPress.org

Taiwan 正體中文

  • 佈景主題目錄
  • 外掛目錄
  • 最新消息
  • 技術支援
  • 關於我們
  • 團隊
  • 取得 WordPress
取得 WordPress
WordPress.org

Plugin Directory

Login or Logout Menu Item

  • 提交外掛
  • 我的最愛
  • 登入
  • 提交外掛
  • 我的最愛
  • 登入

Login or Logout Menu Item

由 cartpauj 開發
下載
  • 詳細資料
  • 使用者評論
  • 安裝方式
  • 開發資訊
技術支援

外掛說明

With this plugin you can easily add a dynamic login/logout menu item to any menu on your WordPress site. The menu item will change based on whether the current user is logged in or logged out. You can also set a specific login page url, login redirect url and a logout redirect url.

Thanks to Juliobox for his prior efforts on the BAW Login/Logout Menu plugin which this is derived from

CONFIGURE SETTINGS

After installing and activating the plugin, you can find the settings in your dashboard under: Settings > Login or Logout

Login Page URL – This should be the URL to the page where your users will login at. For most wordpress sites this will be /wp-login.php but if you’re using a membership plugin like MemberPress, it might be something like /login/ instead.

Login Redirect URL – This is the URL you would like your users to be redirected to after they’ve successfully logged in. You can set it to / to take them to the home page after logging in. If you’re using a membership plugin like MemberPress, you might want to use /account/ instead. NOTE: Some plugins may override this if they are configured to redirect your users somewhere else during login.

Logout Redirect URL – This is the URL you would like your users to be redirected to after they click the Logout link from this menu item. Use a / to redirect them to the home page, or you might want to redirect them back to the login page at /login/ or /wp-login.php etc.

ADD ITEM TO MENU

In your dashboard visit Appearance > Menus.

Then at the top right of that page click the Screen Options button and ensure that Login/Logout checkbox is checked.

Then select a menu to edit, or create a new menu if you don’t already have one.

In the left sidebar find Login/Logout and click the checkbox next to Login|Logout and then click Add to Menu.

You can now drag the menu item wherever you’d like it to appear in your menu. The URL in the menu settings must be left at #lolmiloginout# but you can change the Navigation Label if you’d like it to say something else. Just ensure that the | is there in the label separating the two words.

Now save your menu. That’s it!

BLOCK EDITOR (NAVIGATION BLOCK)

If you’re using the block editor’s Navigation block:

  1. Add or edit a Navigation block on your page or in the Site Editor
  2. Click the (+) to add a new link
  3. In the search field, type “login” or “logout”
  4. Select “Login|Logout” from the suggestions
  5. The link will automatically show “Login” to logged-out users and “Logout” to logged-in users

You can also manually type #lolmiloginout# as the URL if you prefer.

Troubleshooting

After logging in, menu still shows “Login” or Vice-Versa – This is most commonly caused by caching. If you’re using a caching solution such as Cloudflare, WPRocket, or others, be sure that caching is disabled for logged in users, and disable browser caching options as well.

Login is redirecting users somewhere other than my settings – Many times other plugins will have their own login redirect handling which overrides this plugin’s, such as MemberPress for example. In this case, the other plugins will need to be configured to redirect the user where you’d like them to go.

螢幕擷圖

  • Login or Logout Menu Item
  • Login or Logout Menu Item – Settings

安裝方式

  1. Download a .zip of this plugin file
  2. Go to your WordPress Dashboard -> Plugins page
  3. Click “Add New” -> “Upload”
  4. Upload the .zip of this plugin and activate it
  5. For usage instructions, see Details tab and screenshots

使用者評論

No support for PHP version 8.0 or later

henhed 2026 年 1 月 5 日 3 則留言
The plugin don’t seem to work from PHP version 8.0 and above.

Worked Easily and Flawlessly

Lockhart 2025 年 7 月 12 日
I don’t know why this isn’t a standard with Wordpress, but am so grateful this developer saw the need and created a functioning, lightweight, easy to use option! Highly recommend this.

It’s incredible…

MTC 2024 年 4 月 17 日
… that WP doesn’t offer this functionality on its own 😀 Great plugin, works like a charm.

Fantastic! Thank you.

melbatoast4 2022 年 9 月 14 日
Thank you so much for this plugin. Elegantly does what I needed two plugins to do before, with less setup and better functionality.

Damn cool

yannickburky 2022 年 1 月 18 日
Thanks for this piece of software

Does what WordPress should already do

ChickenWhisperer 2021 年 10 月 17 日
thanks!
閱讀全部 23 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Login or Logout Menu Item〉的開發相關工作。

參與者
  • cartpauj

將〈Login or Logout Menu Item〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

1.3.0

  • Added support for the block editor Navigation block
  • Search “login” or “logout” in the Navigation block link picker to add the dynamic link

1.2.3

  • Small tweaks to help avoid hosting blocks
  • Fix nonce validation

1.2.2

  • Bump WP Compatibility

1.2.1

  • Fixed error when saving options on some web-host’s

1.2.0

  • Fixed save options security vulnerability

1.1.1

  • Fixed – Do not redirect Administrator users when logging in

1.1.0

  • Added a settings page
  • Added setting for login page URL
  • Added setting for login redirect URL
  • Added setting for logout redirect URL

1.0.0

  • First Release

中繼資料

  • 版本 1.3.0
  • 最後更新 2 週前
  • 啟用安裝數 20,000+
  • WordPress 版本需求 6.0 或更新版本
  • 已測試相容的 WordPress 版本 6.8.3
  • 語言
    English (US)
  • 標籤
    Dynamicloginlogoutmenumenu item
  • 進階檢視

評分

4.8 星,滿分為 5 星
  • 22 5-star reviews 5 星 22
  • 0 4-star reviews 4 星 0
  • 0 3-star reviews 3 星 0
  • 0 2-star reviews 2 星 0
  • 1 1-star review 1 星 1

新增使用者評論

查看全部使用者評論

參與者

  • cartpauj

技術支援

最近 2 個月解決的問題:

總計 1 個問題,已解決 0 個

檢視技術支援論壇

  • 關於我們
  • 最新消息
  • 主機代管
  • 隱私權
  • 展示網站
  • 佈景主題目錄
  • 外掛目錄
  • 區塊版面配置目錄
  • Learn
  • 技術支援
  • 開發者資源
  • WordPress.tv ↗
  • 共同參與
  • 活動
  • 贊助基金會 ↗
  • Five for the Future
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

Taiwan 正體中文

  • 查看我們的 X (之前的 Twitter) 帳號
  • Visit our Bluesky account
  • 造訪我們的 Mastodon 帳號
  • Visit our Threads account
  • 造訪我們的 Facebook 粉絲專頁
  • Visit our Instagram account
  • Visit our LinkedIn account
  • Visit our TikTok account
  • Visit our YouTube channel
  • Visit our Tumblr account
程式碼,如詩