Halloween Sale 15% off Ends in See the plans
PHP

Accessibility Statement Shortcode

Adds an [accessibility_statement] shortcode that prints a ready-made accessibility statement with your site name, target standard, contact email and review date.

Don’t have WPIDE yet? Install it on your site

Code

// Values used in the statement.
$wpide_statement = array(
    'standard' => 'WCAG 2.2 level AA',
    'email'    => get_option( 'admin_email' ),
    'reviewed' => '2026-01-15', // Date of your last review (YYYY-MM-DD).
    'known'    => array( 'Some older PDF documents are not fully accessible.' ),
);

add_shortcode( 'accessibility_statement', function () use ( $wpide_statement ) {
    $site = get_bloginfo( 'name' );
    $html = '<section class="wpide-a11y-statement">';
    $html .= '<p>' . esc_html( sprintf( '%s wants everyone to be able to use this website, including people with disabilities. We aim to meet %s.', $site, $wpide_statement['standard'] ) ) . '</p>';

    if ( $wpide_statement['known'] ) {
        $html .= '<h2>Known limitations</h2><ul>';
        foreach ( $wpide_statement['known'] as $item ) {
            $html .= '<li>' . esc_html( $item ) . '</li>';
        }
        $html .= '</ul>';
    }

    $html .= '<h2>Feedback</h2><p>' . esc_html( 'If you find a barrier on this site, please tell us and we will do our best to fix it:' ) . ' <a href="' . esc_url( 'mailto:' . antispambot( $wpide_statement['email'] ) ) . '">' . esc_html( antispambot( $wpide_statement['email'] ) ) . '</a></p>';
    $html .= '<p>' . esc_html( sprintf( 'This statement was last reviewed on %s.', date_i18n( get_option( 'date_format' ), strtotime( $wpide_statement['reviewed'] ) ) ) ) . '</p>';

    return $html . '</section>';
} );

Notes

Edit the values at the top, then review the text with whoever is responsible for accessibility on your site; this is a starting point, not legal advice.

How to add this snippet

  1. Install WPIDE on your WordPress site (it is free) and open Code Snippets.
  2. Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
  3. It is added inactive: review the code and settings, then switch it on.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.

Which site should get this snippet?

Enter the address of your WordPress site. WPIDE opens there in a new tab with the snippet ready to review and save.

Remembered in this browser only, so you are asked once.

Report this snippet

Tell the WPIDE team what is wrong: broken code, something harmful, spam or copied work.