How to remove broken links in Sitecore

放肆的年华 提交于 2019-12-03 06:58:34

There is Sitecore admin page that allows removing broken links. You can find it here:

http://localhost/sitecore/admin/RemoveBrokenLinks.aspx

You just select the database and execute the action. You can also serialize all items changed during this process.

You may need to change timeout settings in web.config:

<setting name="DefaultSQLTimeout" value="10:00:00" />
<setting name="DataProviderTimeout" value="00:00:00" />

Sitecore maintains a table named Links in the database specified in the LinkDatabase section of web.config. You can get all broken links in following way:

Sitecore.Data.Database db = Sitecore.Context.Database;
Sitecore.Links.LinkDatabase linkDb = Sitecore.Globals.LinkDatabase;
Sitecore.Links.ItemLink[] brokenLinks = linkDb.GetBrokenLinks(db);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!