Acquia Copilot is a conversational AI connected into our product documentation and knowledge base. Ask Copilot about product features, technical details, troubleshooting and how to get started with Acquia products.
This document provides instructions on how to set up a source code exclusion with a CSS selector.
CSS selectors can find and filter elements by tagname, class, id, and attribute. Combine the elements as needed.
A more advanced introduction on how this works:
The API sends the parameter: source_exclude_rules. The scanner uses these as filters to create different texts which are then processed by the different modules. For example, "original" contains the original text with no filter, "pagefix" contains the text after the PageCorrect script runs, and "spelling" contains the text that remains after the crawler removes everything that is indicated by source_exclude_rules (this is the text that is used in post-processing to find spelling errors).
Instructions
Click Settings (gear icon) at the top of the Domain Overview page. The Admin Settings page opens.
Note
The Settings button is only available to site admins.
Select Source Code Excludes from the menu on the left side of the page.
The Source Code Excludes page opens.
Click Add Source Code Exclude.
The Source Code Excludes selection page opens.
Click to select Accessibility, Readability, or Misspellings.
The Source Code Exclude creation page opens.
Short Description (required): Click in the text field and type in a short description for this excluded snippet.
Default for CMS: Click in the field and identify the CMS from the drop-down menu, if applicable.
Notes
If a CMS is selected here and a domain with the same selected CMS exists on the account, the domain automatically has the source code exclude applied to it.
If you use a CMS and it is not present in the list, contact Support to see if it can be added.
Type (required): Click in the field and select the exclusion type from the drop-down menu.
Exact: Identifies and filters out all instances where the complete and exact HTML snippet appears. For example, the snippet https://www. example.com/ is an exact match for:
https://www.example.com/
While these HTML snippets are NOT a match:
https://www.example.com
http://www.example.com/
https://example.com/
https://example.com/?something=1
https://example.com/#something=1
Regex: Identifies and filters out specific patterns of HTML through the use of regular expressions.
Contains: Identifies and filters out all snippets that contain the HTML values entered. For example, the snippet example.com is a match forthese HTML values:
https://www.example.com/
https://www.example.com
http://www.example.com/
https://example.com/
https://example.com/?query=1
https://example.com/subpage
https://example.com/subpage/product_page
Value (required): Put the HTML snippet in the text input field.
Identify specific HTML snippets for the filter and enter them into the value field.
See the next section Locate HTML snippets to use in a source code exclude for instructions on how to find the snippets.
Note
The Source Code Exclude is now stored on an account level but not applied to any domains. See the steps Source Code Exclusions to apply the Source Code Exclude to a domain.
Locate HTML Snippets to use in a Source Code Exclusion
This section gives instructions on how to locate HTML snippets that can be used to set up a source code exclusion.
Locate snippets with Accessibility FastTrack:
HTML snippets that affect the website compliance level can be found in FastTrack, along with a list of the checks the snippets are flagged for.
How to find HTML snippets that affect website compliance levels:
From the landing page (the globe icon on the top menu bar), click the URL to the domain. The domain dashboard opens.
Click Accessibility (icon of a person standing with arms outstretched) on the menu bar at the top of the domain dashboard. The Accessibility page opens.
Click FastTrack, from the menu on the left-hand side of the page. The Accessibility FastTrack page opens.
Copy the HTML snippets to include and paste them into the form for Source Code Excludes.
Locate snippets in Accessibility Page Details:
Click Accessibility (icon of a human with outstretched arms) on the top menu bar.
Snippets with potential errors are listed in the panel on the right side of the page.
Copy the HTML snippets to include and paste them into the form for Source Code Excludes.
Note
The source code exclusion is now stored on an account level but not applied to any domains. See the steps belowfor instructions on how to apply the new Source Code Exclude to a domain.
Advanced CSS Target Selector Instructions
The scanner uses jsoup "select” to find source code snippets.
To find elements, refer to this external source: selector-syntax, and then use the Source Code Exclude function to remove the elements from the HTML.
Note
The symbol is almost identical to an upper-case M: /|/|
Find and filter elements by tagname,class, id, and attribute. It is also possible to combine elements in this way.
Anything in the front-end field CSS Target Selector is sent to the scanner as the value that is passed on the jsoup select.
The API sends the parameter source_exclude_rules and the scanner uses these asb filters to create different texts for processing by different modules.
For example,
"original" contains the original text with no filter.
"pagefix" contains the text after the PageCorrect script has run.
"spelling" contains the text after the scanner removes everything that is indicated by the source_exclude_rules.
Note
This is the text that is used in post-processing to find spelling errors.
Apply the source code exclusion to a domain
This section provides instructions on how to apply a source code exclusion to a domain.
Click AdminSettings (gear icon) on the toolbar at the top of the Domain Overview page. The Admin Settings page opens.
Note
The Settings button is only available to site admins.
Click Action on the same row as the domain you want to do a scan on.
Select Edit Domain from the drop-down list.
The Edit Domain page opens.
Locate the Features section.
Source Code Excludes: Click the drop-down arrow and select the domain that contains the source code.
This document provides instructions on how to set up a source code exclusion with a CSS selector.
CSS selectors can find and filter elements by tagname, class, id, and attribute. Combine the elements as needed.
A more advanced introduction on how this works:
The API sends the parameter: source_exclude_rules. The scanner uses these as filters to create different texts which are then processed by the different modules. For example, "original" contains the original text with no filter, "pagefix" contains the text after the PageCorrect script runs, and "spelling" contains the text that remains after the crawler removes everything that is indicated by source_exclude_rules (this is the text that is used in post-processing to find spelling errors).
Instructions
Click Settings (gear icon) at the top of the Domain Overview page. The Admin Settings page opens.
Note
The Settings button is only available to site admins.
Select Source Code Excludes from the menu on the left side of the page.
The Source Code Excludes page opens.
Click Add Source Code Exclude.
The Source Code Excludes selection page opens.
Click to select Accessibility, Readability, or Misspellings.
The Source Code Exclude creation page opens.
Short Description (required): Click in the text field and type in a short description for this excluded snippet.
Default for CMS: Click in the field and identify the CMS from the drop-down menu, if applicable.
Notes
If a CMS is selected here and a domain with the same selected CMS exists on the account, the domain automatically has the source code exclude applied to it.
If you use a CMS and it is not present in the list, contact Support to see if it can be added.
Type (required): Click in the field and select the exclusion type from the drop-down menu.
Exact: Identifies and filters out all instances where the complete and exact HTML snippet appears. For example, the snippet https://www. example.com/ is an exact match for:
https://www.example.com/
While these HTML snippets are NOT a match:
https://www.example.com
http://www.example.com/
https://example.com/
https://example.com/?something=1
https://example.com/#something=1
Regex: Identifies and filters out specific patterns of HTML through the use of regular expressions.
Contains: Identifies and filters out all snippets that contain the HTML values entered. For example, the snippet example.com is a match forthese HTML values:
https://www.example.com/
https://www.example.com
http://www.example.com/
https://example.com/
https://example.com/?query=1
https://example.com/subpage
https://example.com/subpage/product_page
Value (required): Put the HTML snippet in the text input field.
Identify specific HTML snippets for the filter and enter them into the value field.
See the next section Locate HTML snippets to use in a source code exclude for instructions on how to find the snippets.
Note
The Source Code Exclude is now stored on an account level but not applied to any domains. See the steps Source Code Exclusions to apply the Source Code Exclude to a domain.
Locate HTML Snippets to use in a Source Code Exclusion
This section gives instructions on how to locate HTML snippets that can be used to set up a source code exclusion.
Locate snippets with Accessibility FastTrack:
HTML snippets that affect the website compliance level can be found in FastTrack, along with a list of the checks the snippets are flagged for.
How to find HTML snippets that affect website compliance levels:
From the landing page (the globe icon on the top menu bar), click the URL to the domain. The domain dashboard opens.
Click Accessibility (icon of a person standing with arms outstretched) on the menu bar at the top of the domain dashboard. The Accessibility page opens.
Click FastTrack, from the menu on the left-hand side of the page. The Accessibility FastTrack page opens.
Copy the HTML snippets to include and paste them into the form for Source Code Excludes.
Locate snippets in Accessibility Page Details:
Click Accessibility (icon of a human with outstretched arms) on the top menu bar.
Snippets with potential errors are listed in the panel on the right side of the page.
Copy the HTML snippets to include and paste them into the form for Source Code Excludes.
Note
The source code exclusion is now stored on an account level but not applied to any domains. See the steps belowfor instructions on how to apply the new Source Code Exclude to a domain.
Advanced CSS Target Selector Instructions
The scanner uses jsoup "select” to find source code snippets.
To find elements, refer to this external source: selector-syntax, and then use the Source Code Exclude function to remove the elements from the HTML.
Note
The symbol is almost identical to an upper-case M: /|/|
Find and filter elements by tagname,class, id, and attribute. It is also possible to combine elements in this way.
Anything in the front-end field CSS Target Selector is sent to the scanner as the value that is passed on the jsoup select.
The API sends the parameter source_exclude_rules and the scanner uses these asb filters to create different texts for processing by different modules.
For example,
"original" contains the original text with no filter.
"pagefix" contains the text after the PageCorrect script has run.
"spelling" contains the text after the scanner removes everything that is indicated by the source_exclude_rules.
Note
This is the text that is used in post-processing to find spelling errors.
Apply the source code exclusion to a domain
This section provides instructions on how to apply a source code exclusion to a domain.
Click AdminSettings (gear icon) on the toolbar at the top of the Domain Overview page. The Admin Settings page opens.
Note
The Settings button is only available to site admins.
Click Action on the same row as the domain you want to do a scan on.
Select Edit Domain from the drop-down list.
The Edit Domain page opens.
Locate the Features section.
Source Code Excludes: Click the drop-down arrow and select the domain that contains the source code.