Table of Contents

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.


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-​[email protected]:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@;:%_\+.~#?&\/\/=*]*)|tel:\+?[0-9\-]+|mailto:[a-z0-9\-_\.][email protected][a-z0-9\-_\.]+?[[email protected]\.\?=\s\%,\-&_;*]+)$/i', $link);

Professional publishing plugins for WordPress! Get PublishPress