How can I export the Broken Links report from Sitecore out ? I am on Sitecore version 7.0

1.1k views Asked by At

I can generate the reports in Sitecore, but the results come back is very big report.
How can I export them out into XCEL to email them or filter them ?

2

There are 2 answers

2
DougCouto On

I would recommend you install the Advanced System Reporter module available on the Marketplace - https://marketplace.sitecore.net/en/Modules/Advanced_System_Reporter.aspx.

This module comes with a few reports and one of them is a "broken links" report.

0
Marek Musielak On

Below is the code you can use to get broken links. You can use it to generate Excel sheet or whatever you want:

Globals.LinkDatabase.Rebuild(database);
ItemLink[] brokenLinks = Globals.LinkDatabase.GetBrokenLinks(database);
foreach (ItemLink itemLink in brokenLinks)
{
    Item sourceItem = itemLink.GetSourceItem();
    if (sourceItem != null)
    {
    CustomField field = FieldTypeManager.GetField(sourceItem.Fields[itemLink.SourceFieldID]);
    }
}