0
votes

To Remove broken links from sitecore I have used below URL: http://localhost/sitecore/admin/RemoveBrokenLinks.aspx

This has removed some of the links. But still scan for broken links window is showing some broken links.What should I do to remove all that broken links.

1
Heve you tried Rebuild link databases application from Sitecore Control Panel? And then removing broken links again?Marek Musielak
@Marek Musielak I have tried this. Still count for broken links remained same. Do I need to change someting in config file to use rebuild link database? In config the linkdatabase node is this: <LinkDatabase type="Sitecore.Data.$(database).$(database)LinkDatabase, Sitecore.Kernel"> <param connectionStringName="core" /> </LinkDatabase>Namita Roy
No. It's ok. Should all work. You may want to contact Sitecore Support.Marek Musielak

1 Answers

0
votes

You can try to use Sitecore Powershell Extensions:

$item = Get-Item -Path "master:/sitecore/content"

$linkDb = [Sitecore.Globals]::LinkDatabase

$links = $linkDb.GetReferrers($item)

foreach($link in $links) {
$linkedItem = Get-Item -Path master:\ -ID $link.SourceItemID 
$itemField = $linkedItem.Fields[$link.SourceFieldID]
$field = [Sitecore.Data.Fields.FieldTypeManager]::GetField($itemField)
$linkedItem.Editing.BeginEdit()
$field.RemoveLink($link)
$linkedItem.Editing.EndEdit()
}