Title: Accessibility code standards for WordPress core
Author: Rian Rietveld
Published: December 15, 2015

---

 [  ](https://profiles.wordpress.org/rianrietveld/) [Rian Rietveld](https://profiles.wordpress.org/rianrietveld/)
10:13 am _on_ December 15, 2015      

# Accessibility code standards for WordPress core

During the WCUS community summit 2015 in Philadelphia we made a start with accessibilityAccessibility
Accessibility (commonly shortened to a11y) refers to the design of products, devices,
services, or environments for people with disabilities. The concept of accessible
design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning
compatibility with a person’s assistive technology (for example, computer screen
readers). (https://en.wikipedia.org/wiki/Accessibility) code standards for WordPress
coreCore Core is the set of software required to run WordPress. The Core Development
Team builds WordPress.. Joe Dolson put a concept for the a11yAccessibility Accessibility(
commonly shortened to a11y) refers to the design of products, devices, services,
or environments for people with disabilities. The concept of accessible design ensures
both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility
with a person’s assistive technology (for example, computer screen readers). (https://
en.wikipedia.org/wiki/Accessibility) code standards together (see below or as [Google Doc](https://docs.google.com/document/d/1iySvDJ4duHYt6YlnnjnBNbU5LKAn1uRBMH8FKAfmswE/edit#)).

These are the standards expected from new code (like feature plugins) at the time
it’s to be merged into core. Our target for released code is WCAG2.0 AA. Proposed
place to put them is the Core Handbook: [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/),
we aim for a short list of very basic things with references to the Accessibility
Handbook.

Feedback (in the comment section below) is very welcome.

### Concept Accessibility code standards for core:

This document is a list of standards that a WordPress feature plug-in should meet
for accessibility in order to be merged into core. These standards are focused on
best practices and easily testable concerns.

The expectations for all code released in WordPress is conformance with WCAGWCAG
WCAG is an acronym for Web Content Accessibility Guidelines. These guidelines are
helping make sure the internet is accessible to all people no matter how they would
need to access the internet (screen-reader, keyboard only, etc) [https://www.w3.org/TR/WCAG21/](https://www.w3.org/TR/WCAG21/).
2.0 at the AA level.

 * HTMLHTML HTML is an acronym for Hyper Text Markup Language. It is a markup language
   that is used in the development of web pages and websites. Semantics
 * Headings Hierarchy
 * Definition of HTML for Controls
 * Usage of ARIA
 * Color Contrast
 * Keyboard Accessibility
 * Images and Icons
 * Labeling

#### HTML Semantics

Take a pragmatic approach to HTML semantics. Don’t add semantics purely for the 
sake of semantics; but if there is an HTML structure that clearly matches the content,
use that element. For example, if you have a group of links, it should most likely
use a list element.

#### Heading structure

The H1 is the main heading representing the page title on every core page. For sub
sections, use a reasonable HTML heading structure — including the use of heading
elements for page sub-sections. Heading markup should not be used for presentational
purposes.

 * Use H2 through H6 to give internal structure to the page.
 * Don’t skip heading levels.
 * Don’t add extra functionality inside a heading, like links or buttons.

#### Semantics for Controls

Controls with a native keyboard interaction (buttons or links) are always preferred.
If there is a valid target link for the control, either an in-page reference or 
a link, then the control should use an <a href=”url”>. If there isn’t, it should
use a <button>

Related ticket: [#26504](https://core.trac.wordpress.org/ticket/26504) Semantic 
elements for non-link links

#### Dynamic Content

When there are dynamic changes within a page without a page reload you must provide
audible feedback with ARIA for important changes, like a successful saving for example.

[Provide documentation and links for aria-live, wp.speak, etc.]

#### Color Contrast

In most cases, feature plug-ins are not expected to add or modify colors in core.
However, if a feature plug-in needs to add new color combinations, those combinations
must meet minimum contrast requirements. Minimum contrast requirements are 4.5:1
for font sizes rendering smaller than 24px or smaller and 3.0:1 for font sizes larger
than 24px or 19px and bold.

[in detailed reference, comment on why we’re referencing as pixels]

#### Keyboard Accessibility

Users must be able to reach and successfully interact with all elements on the page
that are actionable, including all form inputs, buttons and links by using the keyboard.
They must be able to see a visual indicator of keyboard focus. You should be aware
that keyboard events may operate differently when a screen reader is running.

#### Images and Icons

Any image resource must include an accessible name. An image can be represented 
by an actual  element, an icon font, or an svg element; but any graphical representation
is considered an image for these purposes. Different types of elements use different
types of accessible names.

For <img> elements, the accessible name should be in the alt attribute. If the img
is ornamental, the alt attribute should still be included, but left empty.

For icon fonts, the font icon itself should be aria-hidden, with screen-reader-text
in a neighbor element. e.g.

<a href=’this.html’>
 <span class=’dashicons dashicon-something’ aria-hidden=’true’
></span> <span class=’screen-reader-text’>Something</span> </a>

`[Something](https://make.wordpress.org/accessibility/2015/12/15/accessibility-code-standards-for-wordpress-core/this.html?output_format=md)`

For SVG, the SVG should be inline, so that accessible information isn’t hidden from
assistive technology. SVG elements should contain aelement with the accessible name
of the image. For cross-technology support, the title element should be associated
with the svg element via aria-labelledby. For more information, see http://www.sitepoint.
com/tips-accessible-svg/

#### Labeling

All form inputs must include an explicitly associated <label> element. Labels are
not required to be visible, but must use the .screen-reader-text class when hidden.
Placeholders are fine, but are not a substitute for labels.

### Share this:

 * [  Threads ](https://make.wordpress.org/accessibility/2015/12/15/accessibility-code-standards-for-wordpress-core/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/accessibility/2015/12/15/accessibility-code-standards-for-wordpress-core/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/accessibility/2015/12/15/accessibility-code-standards-for-wordpress-core/?share=bluesky)
 * [  LinkedIn ](https://make.wordpress.org/accessibility/2015/12/15/accessibility-code-standards-for-wordpress-core/?share=linkedin)
 * [  X ](https://make.wordpress.org/accessibility/2015/12/15/accessibility-code-standards-for-wordpress-core/?share=x)
 * [  Facebook ](https://make.wordpress.org/accessibility/2015/12/15/accessibility-code-standards-for-wordpress-core/?share=facebook)

 1.  ![](https://secure.gravatar.com/avatar/323cf209e19dd825678e9ccc51bc3f745f96571f1c68af26ae7955c1fa9ad1f2?
     s=32&d=mm&r=g)
 2.   [Aaron Jorbin](https://profiles.wordpress.org/jorbin/)  6:02 pm _on_ December
     15, 2015
 3.  This looks great! I am a fan. A few pieces of feedback:
 4.  Under Keyboard AccessibilityAccessibility Accessibility (commonly shortened to
     a11y) refers to the design of products, devices, services, or environments for
     people with disabilities. The concept of accessible design ensures both “direct
     access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s
     assistive technology (for example, computer screen readers). (https://en.wikipedia.
     org/wiki/Accessibility), I would consider adding specific wording along the lines
     of “All actions that a user can complete with a mouse, must be completable with
     a keyboard”.
 5.  For labeling, I think we should add that for all checkboxes and radio buttons 
     clicking on the label must cause the associated field to toggle.
 6.  I would also like to suggest that we add as a requirement all videos included 
     inside coreCore Core is the set of software required to run WordPress. The Core
     Development Team builds WordPress. (right now it’s just the about page that usually
     has a video, but that doesn’t mean other videos won’t ever be added) must be include
     captioning (even if the captioning is off by default).
 7.   * ![](https://secure.gravatar.com/avatar/4fd344e387cd0febbb417ee2a2bef7db6b40c8f7ecf4265fb41dcef8e9fa8c4b?
        s=32&d=mm&r=g)
      *  [Joe Dolson](https://profiles.wordpress.org/joedolson/)  7:38 pm _on_ December
        21, 2015
      * The keyboard and labeling suggestions are great, and I’ll definitely incorporate
        those. I’m wondering if this is the right document for talking about videos
        included inside coreCore Core is the set of software required to run WordPress.
        The Core Development Team builds WordPress.? The document is intended to be
        geared at code authors primarily, and I feel like while that’s a great policy
        to have in place, I’m not sure this is the document to put it in. Thoughts?
 8.  ![](https://secure.gravatar.com/avatar/82e095c8bc229017b128e53940ea534aa31f6624431bedee24c7e8756e42dd1c?
     s=32&d=mm&r=g)
 9.   [Adam Silverstein](https://profiles.wordpress.org/adamsilverstein/)  3:48 pm 
     _on_ December 16, 2015
 10. Yea! Thanks for working on this. I’m excited to see these standards headed to 
     the handbook. Having a standard in place will help us improve everyone’s efforts.
 11. ![](https://secure.gravatar.com/avatar/daec184bd36571411f2d61003a2d355804d6a997fd8f583631bbbb1c2f267a47?
     s=32&d=mm&r=g)
 12.  [RachieVee](https://profiles.wordpress.org/rachievee/)  4:07 pm _on_ December
     16, 2015
 13. This is awesome. My favorite parts here are making use of the screen-reader-text
     class for images/icons and the semantics for controls. It’ll be great having a
     guide with examples to reference from the handbook. 🙂
 14. ![](https://secure.gravatar.com/avatar/5612a0b1e26e958b7cb153ad8d69325be61525b2bba4819361bb69f127ec34b4?
     s=32&d=mm&r=g)
 15.  [Mark Root-Wiley](https://profiles.wordpress.org/mrwweb/)  5:26 pm _on_ December
     16, 2015
 16. These are so awesome! I can’t wait to see them finalized. The accessibiility progress
     in WordPress (CoreCore Core is the set of software required to run WordPress. 
     The Core Development Team builds WordPress. and the community) this past year 
     has been so heartening.
 17. One issue not included that maybe should addressed is color blindness. WCAGWCAG
     WCAG is an acronym for Web Content Accessibility Guidelines. These guidelines 
     are helping make sure the internet is accessible to all people no matter how they
     would need to access the internet (screen-reader, keyboard only, etc) [https://www.w3.org/TR/WCAG21/](https://www.w3.org/TR/WCAG21/).
     Level A (and AA, then) requires that “color not be used as the sole method of 
     conveying content or distinguishing visual elements.” ([http://webaim.org/blog/wcag-2-0-and-link-colors/](http://webaim.org/blog/wcag-2-0-and-link-colors/))
     The two issues with which I often run into this are:
 18.  * Links. They can’t just be a different color from the text but should be underlined,
        designed as a button, etc.
      * State. Color should be used as the indicator of a state (which includes :focus,
        disabled states, toggles, etc.) This might affect the visual :focus requirement
        in keyboard accessibilityAccessibility Accessibility (commonly shortened to
        a11y) refers to the design of products, devices, services, or environments 
        for people with disabilities. The concept of accessible design ensures both“
        direct access” (i.e. unassisted) and “indirect access” meaning compatibility
        with a person’s assistive technology (for example, computer screen readers).(
        https://en.wikipedia.org/wiki/Accessibility).
 19. This standard can get a little tricky (for instance if you want to support a :
     visited link state), but aspiring to meet it feels like a bare minimum we should
     be requiring. For instance, this would at least catch issues like the long-standing
     Yoast SEO color blindness issue, were that a feature pluginFeature Plugin A plugin
     that was created with the intention of eventually being proposed for inclusion
     in WordPress Core. See [Features as Plugins](https://make.wordpress.org/core/handbook/about/release-cycle/features-as-plugins/).(
     [https://github.com/Yoast/wordpress-seo/issues/440](https://github.com/Yoast/wordpress-seo/issues/440))
 20.  * ![](https://secure.gravatar.com/avatar/4fd344e387cd0febbb417ee2a2bef7db6b40c8f7ecf4265fb41dcef8e9fa8c4b?
        s=32&d=mm&r=g)
      *  [Joe Dolson](https://profiles.wordpress.org/joedolson/)  7:36 pm _on_ December
        21, 2015
      * Hi, Mark! We’re not going to address color directly in this document, generally,
        because we’re aiming to separate developer and designer concerns; that’s why
        there are issues explicitly addressed about adding new colors. Preparing a 
        document for designers on color choice and WCAGWCAG WCAG is an acronym for 
        Web Content Accessibility Guidelines. These guidelines are helping make sure
        the internet is accessible to all people no matter how they would need to access
        the internet (screen-reader, keyboard only, etc) [https://www.w3.org/TR/WCAG21/](https://www.w3.org/TR/WCAG21/).
        would be great, however; and I’ll definitely look into that. This is supposed
        to be primarily a code standards guide, and I want to keep it as focused as
        possible, so it doesn’t become overwhelming.
         - ![](https://secure.gravatar.com/avatar/5612a0b1e26e958b7cb153ad8d69325be61525b2bba4819361bb69f127ec34b4?
           s=32&d=mm&r=g)
         -  [Mark Root-Wiley](https://profiles.wordpress.org/mrwweb/)  1:53 am _on_
           December 22, 2015
         - Thanks for the reply, Joe. I had missed that these were so explicitly code
           focused, but that makes sense to me. If/when the contrast/color/design page
           were added, I at least hope they would be tightly linked, seeing that developers
           often make small design decisions for expediency so should be aware of design
           requirements.
         - I had assumed that the Theme Handbook would already have something like 
           this, but I was really surprised to see that the one section on Colors doesn’t
           really address actual scenarios where colorblindness is a problem: [https://developer.wordpress.org/themes/functionality/accessibility/#color](https://developer.wordpress.org/themes/functionality/accessibility/#color)(
           It also uses the word “commonest”…)
         - The accessibilityAccessibility Accessibility (commonly shortened to a11y)
           refers to the design of products, devices, services, or environments for
           people with disabilities. The concept of accessible design ensures both “
           direct access” (i.e. unassisted) and “indirect access” meaning compatibility
           with a person’s assistive technology (for example, computer screen readers).(
           https://en.wikipedia.org/wiki/Accessibility)-ready requirements similarly
           don’t seem to touch colorblind-related color requirements.
            * ![](https://secure.gravatar.com/avatar/4fd344e387cd0febbb417ee2a2bef7db6b40c8f7ecf4265fb41dcef8e9fa8c4b?
              s=32&d=mm&r=g)
            *  [Joe Dolson](https://profiles.wordpress.org/joedolson/)  9:54 pm _on_
              December 28, 2015
            * The accessibilityAccessibility Accessibility (commonly shortened to a11y)
              refers to the design of products, devices, services, or environments 
              for people with disabilities. The concept of accessible design ensures
              both “direct access” (i.e. unassisted) and “indirect access” meaning 
              compatibility with a person’s assistive technology (for example, computer
              screen readers). (https://en.wikipedia.org/wiki/Accessibility)-ready 
              requirements explicitly require that all contrasts in the default settings
              have to meet WCAGWCAG WCAG is an acronym for Web Content Accessibility
              Guidelines. These guidelines are helping make sure the internet is accessible
              to all people no matter how they would need to access the internet (screen-
              reader, keyboard only, etc) [https://www.w3.org/TR/WCAG21/](https://www.w3.org/TR/WCAG21/).
              AA contrast requirements. However, since the colors of a theme are the
              most changed aspect of a theme in actual usage, there’s not a lot to 
              be done with those requirements that is practical.
 21. Pingback: [Как WordPress в 2015 стал самой популярной платформой для создания сайтов | Теплица Социальных Технологий (ТеСТ)](https://te-st.ru/2015/12/23/wordpress-2015-2016-trends/)
 22. Pingback: [WordPress — лидер! | WordPress в Омске](https://wpomsk.wordpress.com/2015/12/30/wordpress-%d0%bb%d0%b8%d0%b4%d0%b5%d1%80/)

Comments are closed.

# Post navigation

[← Team Chat Summary November 16, 2015](https://make.wordpress.org/accessibility/2015/11/16/team-chat-summary-november-16-2015/)

[Team meeting summary December 14, 2015 →](https://make.wordpress.org/accessibility/2015/12/15/team-meeting-summary-december-14-2015/)