This fix is only available in paid versions of Accessibility Checker.
U.S. Web Design System (USWDS) and other accessibility guidelines worldwide require that links to documents warn users about the file type and size in the text of the link. This notifies users before clicking the link that it doesn’t go to a web page and may, instead, trigger a download.
If you have a large number of documents on your WordPress site, adding these warnings one by one can be very time-consuming. This article explains how to automatically add file type and size warnings to all document links on your WordPress site with just the click of a button.
How to Display File Type and Size in Links to Documents in WordPress
If you want your website to include the file type and size of linked documents in the anchor text, you can have this information automatically inserted into links (no manual content editing) using the WordPress Accessibility Checker plugin.
Step 1
Click into the Accessibility Checker plugin settings in your WordPress dashboard (you must be logged in with an administrator account to access these settings).
Step 2
Go to the “Fixes” tab in the Settings Tabs navigation.
Step 3
Check the box for Add File Size & Type To Links, then scroll to the bottom of the page and click the “Save Changes” button.
Note: Automated accessibility fixes use JavaScript or other methods to modify how your website functions. Occasionally, a WordPress theme or extension may conflict with or prevent our fixes from working as expected. We recommend testing these fixes on a local or staging copy of your website first.
Not seeing the fix?
The Add File Size & Type To Links accessibility fix should start working immediately; however, if you don’t see the fix, it could be because you’re seeing a cached version of your website. Try clearing the cache in any caching plugins and on your hosting account, then look at your site in an incognito window to confirm the fix worked.
Note: Turning on a fix will not instantly remove related issues from Accessibility Checker reports. After turning on a fix, you can clear issues from reports by running a full site scan in Accessibility Checker Pro or by saving any individual post/page to trigger a rescan of that post/page only.
What The Fix Does
When enabled, the Add File Size & Type To Links fix automatically scans your content for any links pointing to downloadable files (based on file extensions). When a link to a document is found, Accessibility Checker updates the visible link text to display the file type and, when possible, the file size, following the USWDS format for links to non-HTML content.
The USWDS format is [FILE_TYPE, SIZE]
with square brackets, uppercase for the file type, and a comma for the separator.
Files hosted on your site
For files hosted on your WordPress site, both the file type and size are added to the link text. Currently, the size is available in MB or KB format. In the future, support will be added for showing page counts.
Example of a linked PDF hosted on-site:
Files hosted on a different website
If you link to files that are not hosted on your website, the size information will not be available, and Accessibility Checker will only be able to add the file type to your link text.
This is an example of a link to a document hosted on a different website:
If you are concerned with meeting the U.S. Web Design System formatting for linked files, we recommend uploading them to your WordPress website rather than linking to them on other websites. This will allow Accessibility Checker to determine and display the file size.
Linking to documents you host is also a good practice to prevent possible broken links that would result if the website owner moves or deletes the document.
Impact on Accessibility
Providing precise details about file types and sizes helps improve your website’s accessibility and usability. Many users, particularly those with cognitive disabilities or those relying on assistive technology, benefit from knowing the type of file being linked to before they click on links. This helps set clear expectations, reduces confusion, and can prevent frustration when unexpected file types or large downloads are encountered.
Knowing the size of a file before downloading it can help users with slower internet connections or data limits make informed decisions and potentially avoid costly or time-consuming downloads.