Nicola Mustone

Support Lead @ Automattic


Leadership, web, programming. Short essays and hands-on guides, focused on results, not hype.


Adding a Logout Link in the Main Menu

2–3 minutes
Customer Logout Link

Want a simple way to add a login/logout link to your WordPress menu, no coding, no plugins required?
With Full Site Editing, you can do it in seconds.

For years, adding a logout link to WordPress menus meant editing your functions.php file or relying on custom plugins. With Full Site Editing (FSE), that’s no longer necessary. You can now manage login and logout links visually, right inside the Site Editor.

This guide shows how to add a dynamic login/logout link using WordPress’ built-in blocks. It automatically switches between “Login” and “Logout” depending on the visitor’s session.

From your WordPress Dashboard, go to Appearance → Editor.
This opens the Full Site Editor (FSE), where you can visually customize templates, headers, and navigation.

💡 Tip: If you don’t see the Editor option, you may be using a classic theme. Consider switching to a block theme like Twenty Twenty-Five or this website’s theme, Bitácora, to unlock full editing capabilities. You can also switch to WordPress.com and use them for free!

Step 2: Find Your Navigation Block

In the editor view, click on your header area or use the List View panel to locate your Navigation block.
This is where all your menu links live.

Select the Navigation block to open its settings and view your current menu structure.

Scroll to the end of your menu links and click the “+” button to add a new item. Search for “Login/out” and select it.

WordPress will automatically insert a dynamic link that shows Login or Logout depending on the user’s status.

That’s it — no PHP snippets, no shortcodes.

the logout link in the Navigation block in the FSE editor

Step 4: Reorder and Customize

You can drag and drop the link anywhere in your menu.
If you want to rename it (e.g. show only “Logout” when logged in), you can do that directly in the block settings panel.

Benefits of Using FSE for Menu Customization

  • Ease of use: Everything happens in the visual editor — no coding needed.
  • Dynamic behavior: The link adapts based on the user’s session.
  • Consistent design: It matches your theme’s typography and layout.
  • Fewer plugins: One less thing to maintain.

If your goal is to simplify your WordPress setup, Top 5 Essential WordPress Plugins I Always Install (and Why) might give you more ideas on keeping things lean and fast.

Cite This Essay

Use this ready-formatted reference in your work or research notes.


2 responses to “Adding a Logout Link in the Main Menu”

  1. Weekly Roundup: June 3, 2016 – Sell with WP

    […] Add a customer logout link to your main menu with this tutorial from Nicola Mustone — it will even be hidden for logged-out users. […]

  2. Hey Nicola

    It would be great to have a step two or option two to this tutorial…
    As option two could be to hover over the logout link in the menu and see a submenu with a confirm to logout button in it. One then just clicks the button and is logged out without having another page open to then log out.

Leave a Comment

Discover more from Nicola Mustone

Subscribe now to keep reading and get access to the full archive.

Continue reading