WordPress Admin Switcher: A New Google Chrome Extension for Switching Between Admin and Frontend

photo credit: Ilya Pavlov
photo credit: Ilya Pavlov

If your job involves working with WordPress, you probably switch between front and backend countless times every day while getting things done. Kellen Mace, a developer at WebDevStudios, has just released a handy Google Chrome Extension that will save you a few clicks while switching back and forth.

WordPress Admin Switcher offers a keyboard shortcut that will zip you from frontend to admin without having to reach for your mouse/trackpad: cmd + shift + A (Mac) or ctrl + shift + A (Windows/Linux).

The keyboard shortcut works on any WordPress-powered site to do the following:

  • Sends a logged-out user to the admin login
  • Sends a logged-in user on the frontend to the post edit screen for the for the post/page/custom post type currently being viewed
  • Sends a logged-in user from the admin to the corresponding frontend for the post/page/custom post type being edited (or else the main site URL)

The extension also supports switching to/from the admin on a subdirectory multisite install with URLs like domain.com/site-name/. It works on WordPress.com VIP sites and any WordPress-powered website. Clicking the extension icon also performs the same behavior as the keyboard shortcut. This chart on the extension’s GitHub page shows how many clicks users can save with the extension:

wordpress-admin-switcher-chrome-extension

“I was envisioning this extension being most useful for experienced people who frequently work with WordPress sites and have a desire to speed up their workflow when logging into them and switching to/from the admin,” Mace said. However, the extension can also be useful for novice users who perpetually forget the URL for accessing their site’s admin.

In the future, Mace plans to add more features, including the ability to navigate to a specific post/page on any WordPress site, hit the shortcut to log in and then be taken back to the edit screen for the post you were viewing before logging in.

“That functionality depends on knowing the post ID, however, which not all WordPress sites expose on the front end,” he said. “So essentially the extension would try to infer the post ID from the page source. If found, it would send the user to its edit screen after login. If not found, it would just fall back to sending them to the main /wp-admin/ dashboard page.”

The keyboard shortcut doesn’t currently switch you to/from the admin if the focus is on Chrome’s omnibar, so Mace wants to update the extension to be able to listen for the keyboard shortcut and act on it even when in the omnibar. He also said he hopes to allow users the option to assign their own keyboard shortcuts if the default doesn’t seem natural for them.

If you work in WordPress and Chrome all day, this extension could boost your efficiency and productivity. I tested it and the current features work as expected. Install the extension directly from the Chrome web store or check out the project on GitHub.

Would you like to write for WP Tavern? We are always accepting guest posts from the community and are looking for new contributors. Get in touch with us and let's discuss your ideas.

22 Comments


  1. It works great, nice idea, my thanks to the author, I imagine this will save me quite some time.

    Report


    1. You’re very welcome, OriginalEXE. Glad you find it useful :)

      Report


  2. Hope they release it for Firefox as well!

    Report


  3. Oh, nice little extension, I love it! Thanks so much, Kellen! :)

    Report


    1. Welcome Joan! Glad you love it :)

      Report


    1. Thanks Jason! Glad you find it useful.

      Report


  4. For those interested in this type of keyboard shortcut timesavers, I definitely recommend checking out Vimium, which provides a TON of useful shortcuts that can be used in tandem with any web app, including WP.

    Report


  5. It not working with multi website or if you install wordpress in folder : if you have example.com/blog/ it will go back into example.com/wp-admin/.
    I hope they fix it , It’s a great idea.

    Report


    1. Hey AdelDima,

      This extension does work for subdirectory multisite installations and when WP is installed in a folder as long as it can tell that that’s the WP root directory. When you hit the keyboard shortcut, it works like this:

      1. Check if the links in the admin bar at the top are present (which are only there when logged in). If so, use those to switch to/from the admin.
      2. If not, search the links in the page source for instances of ‘/wp-content/’ or ‘/wp-includes/’. If at least one URL is found that contains either of those, assume that everything to the left of it is the WP root url, and use that the build the admin URL. So if your site’s URL is example.com/folder/ and you hit the shortcut, you’ll be prompted to login, then redirected to example.com/folder/wp-admin as long as at least one URL on the page contained ‘/wp-content/’ or ‘/wp-includes/’.

      So one example would be an HTML script tag that contains this: src=’http://example.com/folder/wp-includes/js/jquery/jquery.js?ver=1.12.4′

      Until you’re logged in, that’s the only way the extension can tell that the WP install is inside of a folder.

      I hope that helps out. I’m glad you like the idea of the extension :)

      Report


  6. Awesome Sauce! Loved it!

    Can you also add option to define custom admin urls? E.g. if my admin URI is /login instead of /wp-admin. This extension fails in that scenario!

    Report


    1. Ahmad,

      Using custom admin URLs is a bit of an edge case and would require adding more complexity in the form of a settings page where users could enter domains and their corresponding login paths, then checking against those every time a login or admin switch is taking place. Since I’m trying to keep the extension simple and lightweight, I don’t have plans to add that feature at the present.

      However, since it’s open source, you or anyone else can feel free to fork the original and add any custom settings you like – https://github.com/kellenmace/wp-admin-switcher/

      Glad you’re finding it useful! ?

      Report


    1. Thierry,

      That’ll do the trick if you’re just interested in switching to the WP admin, but this extension has these additional features:

      1. Switch from the admin back to the front end (to the specific post/page/CPT you were editing, if applicable).
      2. Supports subdirectory multisite installs and WP installs inside of a folder, such as example.com/site-name/wp-admin/.
      3. Sends you to the edit screen for the post/page/CPT you were viewing before you logged in/switched to the admin.
      4. Works via a keyboard shortcut or a click on the extension icon.

      To get all of those features (except #4) in a bookmark, you can use the code below. I think this may be especially handy on mobile devices where users don’t have the option to install Chrome extensions.

      Bookmark code (obfuscated & minified):
      https://gist.github.com/61090fe78f6a4244b1d3f5434d8987bd

      Full bookmark source code:
      https://gist.github.com/927bca22202ea8b223ea11dc8d0d2c80

      Report


  7. Thierry,

    That’ll do the trick if you’re just interested in switching to the WP admin, but this extension has these additional features:

    1. Switch back from the admin to the front end.
    2. Supports subdirectory multisite installs and WP installs inside of a folder, such as example.com/site-name/wp-admin/.
    3. Sends you to the edit screen for the post/page/CPT you were viewing before you logged in/switched to the admin.
    4. Works via a keyboard shortcut or a click on the extension icon.

    To get all of those features (except #4) in a bookmark, you can use the code below. I think this may be especially handy on mobile devices where users don’t have the option to install Chrome extensions.

    Bookmark code (obfuscated & minified):
    https://gist.github.com/61090fe78f6a4244b1d3f5434d8987bd

    Full bookmark source code:
    https://gist.github.com/927bca22202ea8b223ea11dc8d0d2c80

    Report


  8. For anybody following this project, I have implemented two of the features mentioned in the article:

    1. Now after logging in you will be directed to the admin post edit screen for the post/page/custom post type you were viewing before you logged in, if possible, or else the main admin screen.

    2. The cmd/ctrl+shift+A keyboard shortcut now works everywhere, even if the focus is on the omnibar/address bar.

    Report


  9. The final feature listed in this article has been added to the extension: the ability to set a custom keyboard shortcut. If you want to switch from using the default cmd/ctrl + shift + A to something else, here’s how you can do that:

    Go to the Chrome menu > More Tools > Extensions and check the “Keyboard shortcuts” link at the bottom. Find WordPress Admin Switcher on the list click the field next to “Switch to/from admin”. Enter your own custom keyboard shortcut.

    Report

Comments are closed.