All links use a valid format

This requirement ensure that all the links in your content (both external and internal) use a valid link format.

This feature won't check the destination URL, but it will check the link format to make sure you haven't used URLs such as htpps// or .nt.

  • Go to Checklists > Settings. The image below shows the internal links option.
  • You can choose from “Disabled, Recommended, or Required” options.
  • You can choose “Who can ignore this task?”
Valid Format
Valid Format

If you enable this link validation option, it will be visible when you edit content.

If you have broken links in your content, this task will be marked in red in the sidebar:

Valid Format Red 1
Valid Format Red 1

If you do not have broken links, this task will be marked in green in the sidebar:

Valid Format Green
Valid Format Green

The Checklists plugin uses these regular expressions to check for broken links. You will find this code in this file: /core/Utils/HyperlinkValidator.php

preg_match('/^(?:https?:\/\/(?:www\.)?[-a-​zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@;:%_\+.~#?&\/\/=*]*)|tel:\+?[0-9\-]+|mailto:[a-z0-9\-_\.]+@[a-z0-9\-_\.]+?[a-z0-9@\.\?=\s\%,\-&_;*]+)$/i', $link);