How to Delete the Language Branch for a Page or a Block in EPiServer 7

March 2022 Update: This post was originally written for EPiServer version 7. In 2021, Episerver (now known as Optimizely) released version 12. While some parts of this post are outdated, other parts are still relevant and may be helpful. If you run into any issues when working with localization and language branches, you should refer to Optimizely's official documentation. No content in this post has been changed for the current version.

The release of EPiServer 7 has brought numerous changes to the way editors interact with Edit Mode. One such change is the process needed to remove the language branch for a page or a block. Of course, you could always use the old Edit Mode to complete this task, but let's find out how to do this in EPiServer 7's new Edit Mode.

The EPiServer 6 Way

Delete language branch in EPiServer 6

In EPiServer 6, the process to delete the language branch for a page was pretty straightforward, primarily because the "Delete Language" link was located in the context menu (right-click) of the page.

If you prefer to use EPiServer 7's old Edit Mode, this hasn't changed at all; you'll still get the context menu and this menu still looks the same.

One issue with EPiServer 6, though, was that you couldn't delete a language branch for the Start Page. The workaround to solve this was to point the site's Start Page to a different page, remove the language branch, then point the site's Start Page back to the correct one. This might not be a big deal for development environments, but once you move to a production server, this could possibly cause some issues.

The EPiServer 7 Way

Note: In order to take advantage of this functionality, you'll need to be running EPiServer 7.1. You can upgrade to EPiServer 7.1 through the Add-Ons Store inside of EPiServer.

In EPiServer 7, since the context menu was removed, the link to delete the language branch for a page or a block had to be relocated. You'll now find the link in the Versions gadget.

Delete language branch in EPiServer 7

In the navigation pane or the assets pane, click the "Settings" button (the little cog) in the upper corner next to the "Pin" button, and click the "Add Gadgets" link. In the modal that opens, scroll down and click "Versions". (Simply clicking "Versions" will add the gadget; you will not receive any notifications that it added the gadget.) The gadget will appear by default at the bottom of the navigation/assets pane. Once the gadget has been added and is visible, you'll find the "Delete {insert your current language} Language Branch" link when you click the "More options" button.

You should note that the Versions gadget that you open in the navigation pane is the same that you open in the assets pane. So if you are trying to delete the language branch for a block, you need to go into the block's "Edit" screen, otherwise you'll still be working with the page's version. It's probably good idea to actually read the "Delete Language Branch" confirmation window, so you don't make a mistake when deleting the language branch. Deleting the language branch for a page or a block does not put it in the Trash. It cannot be undone.

EPiServer 7 also now has the ability to delete a language branch for the Start Page. The same link in the Versions gadget will allow you to do this.

Unfortunately, you will not be able to delete the language branch if you're on the master language branch (typically the "EN" branch). The link will be grayed out, disabled, and unclickable.