Site-wide Link Checker?

Mike Bilz asked on June 5, 2017 18:03

Hello Kentico Team,

Is there a site-wide link checker built in to Kentico?

I know that I can check on the links for an individual page through the Validation Menu, but my site contains over 1000 pages and it is not really feasible to test each page individually.

Just wondering if a centralized system is available, or if anyone here has suggestions for an outside tool or service that can do what I need?

Thanks in advance.


Recent Answers

Trevor Fayas answered on June 5, 2017 18:39 (last edited on June 5, 2017 18:40)

Hi Mike!

I do not believe there is a site-wide link checking tool. My recommendation is to download and use Xenu Link Slueth, it can scan an entire site and report broken links.

If you want to try to program and use the tools Kentico uses, The actual Link Checker tool is the /CMSAdminControls/Validation/LinkChecker.ascx (version K10)

In it there is a code to generate a link to a page that will generate the link report:

newWindow.OnClientClick = String.Format("modalDialog('" + ResolveUrl("~/CMSModules/Content/CMSDesk/Validation/ValidationResults.aspx") + "?datakey={0}&docid={1}&hash={2}', 'ViewValidationResult', 800, 600);return false;", encodedKey, Node.DocumentID, QueryHelper.GetHash(String.Format("?datakey={0}&docid={1}", encodedKey, Node.DocumentID)));

In order to generate this, you need the following:

string Url = "/The/Url/Of/Document/To/Be/Validated.aspx";
string CultureCode = "en-US";
string ResultKey = "validation|link|" + CultureCode + "|" + Url;
string encodeKey = ScriptHelper.GetString(HttpUtility.UrlEncode(ResultKey), false);
int DocumentID = 123;
string UrlToTry = string.Format(ResolveUrl("~/CMSModules/Content/CMSDesk/Validation/ValidationResults.aspx") + "?datakey={0}&docid={1}&hash={2}", encodedKey, DocumentID, QueryHelper.GetHash(String.Format("?datakey={0}&docid={1}", encodedKey, DocumentID));

// Try loading hte UrlToTry in a new window

Note this is untested...but should work if you really want to at least have a quick link reference to all of them.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.