There are a number of instances where you may need to relocate links from one item to another in Sitecore as a content author.
For me, I recently needed to delete an old landing and had to make sure that all of the items that linked to that landing page and its sub-items would now link to the new page that I created.
If there were only a few items linking to this old landing page, it wouldn’t be too tedious to click on each item and relink them to the new page.
This was not the case for me. There were nearly 100 items linked to this landing page and I needed a quick solution.
This blog will show you how to relocate links when deleting an item/page to prevent broken links on your site.
To see what other items (if any) link to the item you are wanting to delete, check out our other blog to Find Out Where An Item Is Being Used.
1. You’ll want to locate and right-click the item to be deleted in the content tree. Select ‘Delete’ from the menu.
2. A message modal will appear asking if you are sure you want to delete the item, as well as a warning that the sub-items on the item you’re about to delete, will also be deleted. Click ‘OK’.
3. The following window will let you know that other items contain links to this item or sub-items. You can choose from one of three options:
This will remove the links to this item from the other items that link to it.
Link To Another Item:
This is the option to select to relocate the links to another item/page in the content tree.
This will cause broken links on your site and appear in the Broken Links report (this option is not recommended).
4. If you would like to view what other items link to the item you are going to delete, click the ‘Edit Links’ button.
Here you can see which links you want to edit, remove, or link to another item. If you only have a few links to relocate or only want to relocate some of the links that point to this item, you can do so in this window.
Select ‘Close’ when you are finished.
5. If you find yourself in an instance like mine where you needed to relocate all the links that pointed to the item, go back to the Breaking Links window, select ‘Link to another item’, and then click ‘Continue’.
6. Select where you want to relocate the links to (the new landing page in my case). Click ‘Continue’.
7. You will see that the old landing page is no longer in the content tree and the links now point to the new landing page. You can check to confirm that the links have been relocated correctly by watching the tutorial video below.
It’s best practice to avoid broken links on your website, so be sure to always double-check before deleting items.
‘Linking to another item’ will ensure that the existing links transfer from one item to another and avoid broken links.
Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.