Skip to content
SilktideHelp

Policies

A policy is a custom check you build from rules. Each rule looks for one thing on a page: a link to an old address, an image with particular , a word in the page title, and so on. Put rules together and choose whether a page has an issue when it matches every rule or any of them. Once saved, a policy runs whenever the websites it applies to are tested, and its issues appear in the Inspector like those of any other check.

If your organisation also uses Silktide 4, Silktide 4 reports your policies too, and editing a policy in Silktide 5 keeps the Silktide 4 settings it already has. To find words or phrases and nothing else, a text match is quicker to set up.

Adding a policy

Open any website, choose Settings in its sidebar, then under All sites choose Checks. Select Add check, then Policy. You can also press ⌘K (Ctrl+K on Windows or Linux) and run Add policy from anywhere in Silktide.

The Checks screen with the Add check menu open, offering Policy and Text match

The policy opens in a full-screen editor: the form on the right, and a tester on the left that tries the policy on one of your pages. To change a policy later, select it in the same Checks list. The back arrow at the top left returns to Checks without saving.

If Add check does not offer Policy, ask an account administrator. Making policies needs permission to manage policies, which account administrators have.

Give the policy a Name, which it needs before it can be saved, and a Description if you want to say what it is for.

Rules

Under Rules, select Add rule and choose what the rule looks for. Each rule shows as a card titled with its number and kind, such as Rule 1: Email address, with a sentence underneath saying what it finds, such as "Has an email address that contains “@winebarrel.co”". Read the sentence back to check the rule says what you meant. Select the card's title to open or close it, use its arrows to move it up or down, and its trash button to remove it.

The top of the policy editor: the name and description, two rules matched with Any rule, and the second rule open to show its fields

Inside a rule, its fields say what to look for. Many fields hold rows, added with the button under the field, such as Add URL rule or Add link text rule:

  • An empty field does not narrow the rule. A Link rule with nothing filled in finds every link.
  • Rows in one field are alternatives, so any one of them can match. The Attribute and Text content rows of an HTML tag rule are the exception: every row must match. Once a field has more than one row, it says which.
  • Everything you fill in must be true of the same thing. A Link rule with a Link URL and a Link text finds links that have both.

Most rows have a Type, a Match and a Case sensitive switch. The types are Equals, Starts with, Ends with, Contains, Contains whole word, Not equals, Doesn't start with, Doesn't end with, Doesn't contain, Doesn't contain whole word, Shorter than, Longer than, Regular expression, Contains more words than and Contains fewer words than. Fields that hold an address (Link URL, Image source, Resource URL and Page URL) leave out the whole-word and word-count types. Shorter than and Longer than count characters. Write a on its own, such as colou?r, without slashes around it.

A rule with a mistake in it, such as a regular expression that is not valid or a required field left empty, shows the problem under the field, and its card says "This rule has a problem to fix." while it is closed. Fix it before you test or save the policy.

What each kind of rule looks for

The Add rule menu offers 13 kinds of rule. Text, Page title, Page type and Languages read web pages and PDFs. The rest read web pages only.

Words and code

  • Text - words on the page, including the alternative text of images. Put each word or phrase on its own line in Text to find (one per line), and choose Contains (whole words), Contains (also inside words) or Regular expression.
  • Page title - the title of a web page, or the document title of a PDF.
  • HTML code - the page's source, for things with no visible sign, such as a tracking snippet or a meta tag. Each Match HTML code row uses Contains, Shorter than, Longer than or Regular expression. The rule needs at least one row.
  • HTML tag - elements by HTML tag name, such as p, img or meta, narrowed by Attribute (an attribute's name and value) and Text content if you want. With no tag name, it looks at every element.
  • XPath selector - the elements an Selector picks out, for anything the other rules cannot reach.

Links, images and files

  • Link - links, by Link URL, Link text, Opens in (Any, New tab or Same tab) and Points to (Any, This website or Other websites). A link to one of your own pages is compared by its full address, such as https://example.com/contact, so choose Contains to match a path. mailto: and tel: links are compared as written.
  • Image - images, by Image source (the image's address) and Alternative text.
  • Email address - email addresses, by Email address rows. Email format chooses where to look: Find email addresses in text and links, Only match emails in links or Only match emails not in links.
  • Resource - files the page loads, such as images, , fonts and scripts, by Resource URL, Resource type (All types, Image, CSS, Font, HTML, JavaScript or Text) and Resource size (Size in bytes).

The page itself

  • URL - the page's own address, by Page URL.
  • Page type - HTML page or PDF document. With Every rule, it limits a policy to one kind of page.
  • Page depth - how many clicks the page is from the homepage, as found when Silktide tests the website. The homepage is 1, a page it links to is 2, and so on. Compare it with Equals, Less than, Greater than, Less than or equal to or Greater than or equal to.
  • Languages - content written in any of the languages you add.

Every rule or any rule

Once a policy has two or more rules, choose how they combine under A page has an issue when it matches:

  • Every rule - a page has an issue only when all of the rules match. Use it to narrow a policy down, such as pages under /news/ that link to an old blog.
  • Any rule - one matching rule is enough. Use it to gather several things into one policy, such as an old email address or an old phone number.

On a PDF, Silktide leaves out the rules that read web pages only and judges the PDF on the rest. A policy made only of such rules finds nothing in PDFs.

Find pages that don't match

Each rule has a Find pages that don't match switch, to "Raise the issue on pages where this rule finds nothing." Turn it on to look for something that is missing. The rule's sentence then starts with "Doesn’t match:".

For example, to find product pages with no buy link, choose Every rule and add:

  1. A URL rule whose Page URL contains /products/.
  2. A Link rule whose Link text contains Buy, with Find pages that don't match turned on.

Testing before you save

Type the address of one of your pages in the bar at the top of the editor and select Run test. The tester runs the policy as it stands in the editor, saved or not, on that live page. Once a policy is saved, the arrow beside the address lists the pages you have tested it on.

The tester after running a policy on a contact page: two issues on the left, the first open and reading Found by rule 1, the matching email address highlighted in the page preview, and the policy's rules on the right

Issues lists each issue the policy would raise on that page, and Log records how the test ran. Select an issue to see what it matched, highlighted in the page preview beside it.

Each issue names the rule that found it, such as Found by rule 1: Has an email address that contains “@winebarrel.co”. The same line shows on the policy's issues in the Inspector once your websites are tested. When a match is about the page as a whole, such as its address or its type, or something missing found by Find pages that don't match, the page has one issue. That issue names a rule only when the policy has a single rule, because otherwise every rule played a part.

If a rule has a problem, the tester shows "Fix the problems shown on this policy’s rules, then test it again." and opens the rules that need fixing.

Issues

Under Issues, choose how the policy reports what it finds:

  • Priority - the same priority levels as every other check. A new policy starts at your account's default priority.
  • Confidence - Error when a match is certainly something to fix, or Warning when someone should confirm it applies to your site.
  • Issue text - "Shown on each issue this policy finds, to say what is wrong and how to fix it."
  • One issue per page - "Report each page once, however many places on it match." Leave it off for an issue at each match.

The Issues and Apply to sections of the policy editor: priority P3, confidence Error, issue text filled in, One issue per page off, and Specific websites with Wine Barrel selected

Choosing websites

Under Apply to, choose All websites, or Specific websites and select the websites the policy should run on. Use Search websites… to find one, and open a website with its arrow to choose only some of its .

Saving

Select Add policy, or Save changes for a policy you are editing. A policy saves once it has a name, at least one rule, no rule problems and somewhere to run. Silktide then offers to re-run the affected websites: choose Re-run now to see the policy's issues straight away, or Skip, and the policy runs from each website's next test.

To delete a policy, open it and choose Delete policy from the menu beside Save changes.

A policy affects scores when it belongs to a criterion, like any other check. See Making custom checks count.

  • Custom checks - policies and text matches, and how custom checks affect scores
  • Inspector - where a policy's issues appear
  • Criteria - the scored areas checks belong to
Last updated

Was this page helpful?