Insights

Relocating Links To Another Item In Sitecore

Introduction

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.

See Where An Item Is Being Used

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.

Relocating Links To Another Item

1. You’ll want to locate and right-click the item to be deleted in the content tree. Select ‘Delete’ from the menu.

Right click an item to delete it in Sitecore

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’.

Confirm deletion of an item in Sitecore

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:

Breaking Links in Sitecore when deleting an item in the Content Tree

Remove Links:

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.

Leave Links:

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.

Edit, remove, or link to another item when viewing the links to an item in Sitecore

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’.

Select a new item to relocate links to in the Sitecore content tree

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.

Wrap Up

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.

If you have any questions or would like to know more about Sitecore for content authors, check out our Facebook group or connect with me on Twitter!

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting